diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2018-02-06 16:10:11 -0500 |
---|---|---|
committer | Jyri Sarha <jsarha@ti.com> | 2018-02-28 04:25:36 -0500 |
commit | b225e742542d944c883f578a5c0106157ff4fb7f (patch) | |
tree | 5b7ea8e0ad2fdb2b5e11e0728dbfa2e98d99de51 | |
parent | 3366ba38cad887e587b28b7ab83a01e1c59a8466 (diff) |
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: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
-rw-r--r-- | drivers/gpu/drm/tilcdc/tilcdc_panel.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c b/drivers/gpu/drm/tilcdc/tilcdc_panel.c index 0b6aa95aec89..cf9ca16fee81 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c | |||
@@ -289,10 +289,8 @@ static struct tilcdc_panel_info *of_get_panel_info(struct device_node *np) | |||
289 | } | 289 | } |
290 | 290 | ||
291 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 291 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
292 | if (!info) { | 292 | if (!info) |
293 | of_node_put(info_np); | 293 | goto put_node; |
294 | return NULL; | ||
295 | } | ||
296 | 294 | ||
297 | ret |= of_property_read_u32(info_np, "ac-bias", &info->ac_bias); | 295 | ret |= of_property_read_u32(info_np, "ac-bias", &info->ac_bias); |
298 | ret |= of_property_read_u32(info_np, "ac-bias-intrpt", &info->ac_bias_intrpt); | 296 | 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 | if (ret) { | 309 | if (ret) { |
312 | pr_err("%s: error reading panel-info properties\n", __func__); | 310 | pr_err("%s: error reading panel-info properties\n", __func__); |
313 | kfree(info); | 311 | kfree(info); |
314 | of_node_put(info_np); | 312 | info = NULL; |
315 | return NULL; | ||
316 | } | 313 | } |
317 | of_node_put(info_np); | ||
318 | 314 | ||
315 | put_node: | ||
316 | of_node_put(info_np); | ||
319 | return info; | 317 | return info; |
320 | } | 318 | } |
321 | 319 | ||