From patchwork Tue Mar 29 03:20:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 670552 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2T3JU6T018045 for ; Tue, 29 Mar 2011 03:20:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755665Ab1C2DUi (ORCPT ); Mon, 28 Mar 2011 23:20:38 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:53222 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753236Ab1C2DUh (ORCPT ); Mon, 28 Mar 2011 23:20:37 -0400 Received: by fxm17 with SMTP id 17so3161975fxm.19 for ; Mon, 28 Mar 2011 20:20:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=Tmq52SOkDBxc10N2zTbH+mFG/NZWdgYF3CmIxAFiQCI=; b=kkjBXSutQc9Tbs+m+72v+0LxjuTPaNiZWMP6whoaKJs4k0cqGU6GgkOql6UkjaLolu hkmnXCxTsizBRJ6Z3z5DukAhCFUl+Leubg2iJrAdusuYIfr1kk10cszhAST/+6vtcaQd Jt5QTl+VFfdZoouCimqjkKUAiRHbE/jMnYor0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=cZuLG2tRG5VxG2/mnEjYcm5eMWPCf27GHnlFvJ37SchSQEtOtCAXU6G9bUfdnAOcwk ChcOUqlUwhsrY0GGgry88N/1XvK0gWBd0azm3xFO8owJoiEDziv3kdHplP+zghlYNyzO esm2WWWgPWDKEVJ+P60/iD+F/WXdfpjjZq548= Received: by 10.223.29.4 with SMTP id o4mr5270750fac.27.1301368836017; Mon, 28 Mar 2011 20:20:36 -0700 (PDT) Received: from bicker ([212.49.88.34]) by mx.google.com with ESMTPS id j12sm1753362fax.9.2011.03.28.20.20.31 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 28 Mar 2011 20:20:35 -0700 (PDT) Date: Tue, 29 Mar 2011 06:20:20 +0300 From: Dan Carpenter To: Richard Purdie , lars@metafoo.de Cc: Paul Mundt , linux-fbdev@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] backlight/pcf50633: check for NULL consistently in pcf50633_bl_probe() Message-ID: <20110329032020.GD9856@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 29 Mar 2011 03:20:38 +0000 (UTC) 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 */