linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: backlight: Add pcf50633 backlight driver
@ 2012-02-01  9:42 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2012-02-01  9:42 UTC (permalink / raw)
  To: linux-fbdev

Hello Lars-Peter Clausen,

This is a semi-automatic email about new static checker warnings.

The patch 2ddfd12f3584: "backlight: Add pcf50633 backlight driver" 
from May 12, 2010, leads to the following Smatch complaint:

drivers/video/backlight/pcf50633-backlight.c +136 pcf50633_bl_probe()
	 error: we previously assumed 'pdata' could be null (see line 118)

drivers/video/backlight/pcf50633-backlight.c
   117	
   118		if (pdata) {
                    ^^^^^
check.

   119			bl_props.brightness = pdata->default_brightness;
   120			pcf_bl->brightness_limit = pdata->default_brightness_limit;
   121		} else {
   122			bl_props.brightness = 0x3f;
   123			pcf_bl->brightness_limit = 0x3f;
   124		}
   125	
   126		pcf_bl->pcf = dev_to_pcf50633(pdev->dev.parent);
   127	
   128		pcf_bl->bl = backlight_device_register(pdev->name, &pdev->dev, pcf_bl,
   129							&pcf50633_bl_ops, &bl_props);
   130	
   131		if (IS_ERR(pcf_bl->bl))
   132			return PTR_ERR(pcf_bl->bl);
   133	
   134		platform_set_drvdata(pdev, pcf_bl);
   135	
   136		pcf50633_reg_write(pcf_bl->pcf, PCF50633_REG_LEDDIM, pdata->ramp_time);
                                                                     ^^^^^^^^^^^^^^^^
dereference with checking.

   137	
   138		/* Should be different from bl_props.brightness, so we do not exit

regards,
dan carpenter


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-01  9:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-01  9:42 backlight: Add pcf50633 backlight driver Dan Carpenter

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).