mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jyri Sarha <jsarha@ti.com>
To: SF Markus Elfring <elfring@users.sourceforge.net>,
	<dri-devel@lists.freedesktop.org>,
	David Airlie <airlied@linux.ie>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: LKML <linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH 2/2] drm/tilcdc: panel: Use common error handling code in of_get_panel_info()
Date: Wed, 14 Feb 2018 15:30:25 +0200	[thread overview]
Message-ID: <8ea87afa-0713-eaac-640f-85085e148832@ti.com> (raw)
In-Reply-To: <23b2cf6c-7b69-9ade-d97a-18af0c6eb73f@users.sourceforge.net>

On 06/02/18 23:24, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 6 Feb 2018 22:10:11 +0100
> 
> 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>

Well, it is couple of lines less. If I would just have couple weeks time
to implement proper drm panel support for tilcdc and get rid of this
driver all together...

Picked for the next tilcdc pullrequest.

Thanks,
Jyri


> ---
>  drivers/gpu/drm/tilcdc/tilcdc_panel.c | 12 +++++-------
>  1 file 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;
>  }
>  
> 


-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

      reply	other threads:[~2018-02-14 13:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-06 21:22 [PATCH 0/2] GPU-DRM-TILCDC: Adjustments for seven function implementations SF Markus Elfring
2018-02-06 21:23 ` [PATCH 1/2] drm/tilcdc: Delete an error message for a failed memory allocation in seven functions SF Markus Elfring
2018-02-14 13:27   ` Jyri Sarha
2018-02-06 21:24 ` [PATCH 2/2] drm/tilcdc: panel: Use common error handling code in of_get_panel_info() SF Markus Elfring
2018-02-14 13:30   ` Jyri Sarha [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8ea87afa-0713-eaac-640f-85085e148832@ti.com \
    --to=jsarha@ti.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=elfring@users.sourceforge.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®