diff options
author | Jubeom Kim <jubeomk@nvidia.com> | 2011-06-22 23:19:19 +0900 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:47:35 -0800 |
commit | 717f805865f551974d82c2877beb1538a94697fb (patch) | |
tree | db401f2d502c09d74888f1b5ebddff40c962d62d /drivers/rtc | |
parent | 0513cd659ec7d50e41d11d627871df5c52d1053d (diff) |
rtc : tps6586x: move NULL checking to the front.
Reviewed-on: http://git-master/r/37866
(cherry picked from commit 4299db4686321fb3017f9118a36610898f172639)
Original-Change-Id: Icbfef4dc5604506d30592317c94a7d4fc1bcf16c
Reviewed-on: http://git-master/r/39582
Tested-by: Jubeom Kim <jubeomk@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Rebase-Id: R7d8f5628cde155fe54d31f37eeacb4b5bb4962d1
Diffstat (limited to 'drivers/rtc')
-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 fccf13845022..8415993e98f7 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"); |