diff options
author | Jubeom Kim <jubeomk@nvidia.com> | 2011-06-22 23:19:19 +0900 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-07-12 18:45:01 -0700 |
commit | 7cb9175239fc2c68dfad318860287c73b6a5bb1f (patch) | |
tree | 0e12de1bf037ebf017c076345887b9f58cc2d3e5 /drivers | |
parent | 4a3b49f1ba365a4b5acfbac67bb295667ba6a9a5 (diff) |
rtc : tps6586x: move NULL checking to the front.
Reviewed-on: http://git-master/r/37866
(cherry picked from commit 4299db4686321fb3017f9118a36610898f172639)
Change-Id: Icbfef4dc5604506d30592317c94a7d4fc1bcf16c
Reviewed-on: http://git-master/r/39582
Tested-by: Jubeom Kim <jubeomk@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/rtc/rtc-tps6586x.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-tps6586x.c b/drivers/rtc/rtc-tps6586x.c index 546b7bfea5ec..9d0a0c47aefc 100644 --- a/drivers/rtc/rtc-tps6586x.c +++ b/drivers/rtc/rtc-tps6586x.c @@ -284,6 +284,11 @@ static int __devinit tps6586x_rtc_probe(struct platform_device *pdev) int err; struct tps6586x_epoch_start *epoch; + if (!pdata) { + dev_err(&pdev->dev, "no platform_data specified\n"); + return -EINVAL; + } + rtc = kzalloc(sizeof(*rtc), GFP_KERNEL); if (!rtc) @@ -291,11 +296,6 @@ static int __devinit tps6586x_rtc_probe(struct platform_device *pdev) rtc->irq = -1; - if (!pdata) { - dev_err(&pdev->dev, "no platform_data specified\n"); - return -EINVAL; - } - if (pdata->irq < 0) dev_warn(&pdev->dev, "no IRQ specified, wakeup is disabled\n"); |