Skip to content

Commit

Permalink
drm/tilcdc: panel: Use common error handling code in of_get_panel_info()
Browse files Browse the repository at this point in the history
Add a jump target so that a bit of exception handling can be better reused
at the end of this function.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
  • Loading branch information
Markus Elfring authored and Jyri Sarha committed Feb 28, 2018
1 parent 3366ba3 commit b225e74
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions drivers/gpu/drm/tilcdc/tilcdc_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,8 @@ static struct tilcdc_panel_info *of_get_panel_info(struct device_node *np)
}

info = kzalloc(sizeof(*info), GFP_KERNEL);
if (!info) {
of_node_put(info_np);
return NULL;
}
if (!info)
goto put_node;

ret |= of_property_read_u32(info_np, "ac-bias", &info->ac_bias);
ret |= of_property_read_u32(info_np, "ac-bias-intrpt", &info->ac_bias_intrpt);
Expand All @@ -311,11 +309,11 @@ static struct tilcdc_panel_info *of_get_panel_info(struct device_node *np)
if (ret) {
pr_err("%s: error reading panel-info properties\n", __func__);
kfree(info);
of_node_put(info_np);
return NULL;
info = NULL;
}
of_node_put(info_np);

put_node:
of_node_put(info_np);
return info;
}

Expand Down

0 comments on commit b225e74

Please sign in to comment.