Commit b225e742 authored by Markus Elfring's avatar Markus Elfring Committed by Jyri Sarha

drm/tilcdc: panel: Use common error handling code in of_get_panel_info()

Add a jump target so that a bit of exception handling can be better reused
at the end of this function.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarJyri Sarha <jsarha@ti.com>
parent 3366ba38
...@@ -289,10 +289,8 @@ static struct tilcdc_panel_info *of_get_panel_info(struct device_node *np) ...@@ -289,10 +289,8 @@ static struct tilcdc_panel_info *of_get_panel_info(struct device_node *np)
} }
info = kzalloc(sizeof(*info), GFP_KERNEL); info = kzalloc(sizeof(*info), GFP_KERNEL);
if (!info) { if (!info)
of_node_put(info_np); goto put_node;
return NULL;
}
ret |= of_property_read_u32(info_np, "ac-bias", &info->ac_bias); 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); ret |= of_property_read_u32(info_np, "ac-bias-intrpt", &info->ac_bias_intrpt);
...@@ -311,11 +309,11 @@ static struct tilcdc_panel_info *of_get_panel_info(struct device_node *np) ...@@ -311,11 +309,11 @@ static struct tilcdc_panel_info *of_get_panel_info(struct device_node *np)
if (ret) { if (ret) {
pr_err("%s: error reading panel-info properties\n", __func__); pr_err("%s: error reading panel-info properties\n", __func__);
kfree(info); kfree(info);
of_node_put(info_np); info = NULL;
return NULL;
} }
of_node_put(info_np);
put_node:
of_node_put(info_np);
return info; return info;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment