linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: linux-fbdev@vger.kernel.org
Subject: Re: [patch] backlight/pcf50633: check for NULL consistently in pcf50633_bl_probe()
Date: Tue, 29 Mar 2011 11:19:05 +0000	[thread overview]
Message-ID: <4D91C029.5040507@metafoo.de> (raw)
In-Reply-To: <20110329032020.GD9856@bicker>

On 03/29/2011 05:20 AM, Dan Carpenter wrote:
> We checked "pdata" for NULL at the start of the function so we should
> check it here as well.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Acked-by: Lars-Peter Clausen <lars@metafoo.de>

> ---
> Compile tested only.  Please review.
> 
> diff --git a/drivers/video/backlight/pcf50633-backlight.c b/drivers/video/backlight/pcf50633-backlight.c
> index ef5628d..0fe934f 100644
> --- a/drivers/video/backlight/pcf50633-backlight.c
> +++ b/drivers/video/backlight/pcf50633-backlight.c
> @@ -136,7 +136,9 @@ static int __devinit pcf50633_bl_probe(struct platform_device *pdev)
>  
>  	platform_set_drvdata(pdev, pcf_bl);
>  
> -	pcf50633_reg_write(pcf_bl->pcf, PCF50633_REG_LEDDIM, pdata->ramp_time);
> +	if (pdata)
> +		pcf50633_reg_write(pcf_bl->pcf, PCF50633_REG_LEDDIM,
> +					pdata->ramp_time);
>  
>  	/* Should be different from bl_props.brightness, so we do not exit
>  	 * update_status early the first time it's called */


      reply	other threads:[~2011-03-29 11:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-29  3:20 [patch] backlight/pcf50633: check for NULL consistently in Dan Carpenter
2011-03-29 11:19 ` Lars-Peter Clausen [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=4D91C029.5040507@metafoo.de \
    --to=lars@metafoo.de \
    --cc=linux-fbdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).