Skip to content

Commit 1fd949f

Browse files
Yttrium-32lag-linaro
authored andcommitted
backlight: sky81452-backlight: Remove unnecessary call to of_node_get()
`dev->of_node` already has a reference to the device_node and calling of_node_get on it is unnecessary. All conresponding calls to of_node_put are also removed. Signed-off-by: Shresth Prasad <[email protected]> Reviewed-by: Daniel Thompson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent f80460c commit 1fd949f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/video/backlight/sky81452-backlight.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static const struct attribute_group sky81452_bl_attr_group = {
182182
static struct sky81452_bl_platform_data *sky81452_bl_parse_dt(
183183
struct device *dev)
184184
{
185-
struct device_node *np = of_node_get(dev->of_node);
185+
struct device_node *np = dev->of_node;
186186
struct sky81452_bl_platform_data *pdata;
187187
int num_entry;
188188
unsigned int sources[6];
@@ -194,10 +194,8 @@ static struct sky81452_bl_platform_data *sky81452_bl_parse_dt(
194194
}
195195

196196
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
197-
if (!pdata) {
198-
of_node_put(np);
197+
if (!pdata)
199198
return ERR_PTR(-ENOMEM);
200-
}
201199

202200
of_property_read_string(np, "name", &pdata->name);
203201
pdata->ignore_pwm = of_property_read_bool(np, "skyworks,ignore-pwm");
@@ -217,7 +215,6 @@ static struct sky81452_bl_platform_data *sky81452_bl_parse_dt(
217215
num_entry);
218216
if (ret < 0) {
219217
dev_err(dev, "led-sources node is invalid.\n");
220-
of_node_put(np);
221218
return ERR_PTR(-EINVAL);
222219
}
223220

@@ -237,7 +234,6 @@ static struct sky81452_bl_platform_data *sky81452_bl_parse_dt(
237234
if (ret < 0)
238235
pdata->boost_current_limit = 2750;
239236

240-
of_node_put(np);
241237
return pdata;
242238
}
243239
#else

0 commit comments

Comments
 (0)