summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tilcdc
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2018-02-07 00:10:11 +0300
committerJyri Sarha <jsarha@ti.com>2018-02-28 12:25:36 +0300
commitb225e742542d944c883f578a5c0106157ff4fb7f (patch)
tree5b7ea8e0ad2fdb2b5e11e0728dbfa2e98d99de51 /drivers/gpu/drm/tilcdc
parent3366ba38cad887e587b28b7ab83a01e1c59a8466 (diff)
downloadlinux-b225e742542d944c883f578a5c0106157ff4fb7f.tar.xz
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>
Diffstat (limited to 'drivers/gpu/drm/tilcdc')
-rw-r--r--drivers/gpu/drm/tilcdc/tilcdc_panel.c12
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)
}
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);
@@ -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;
}