summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJubeom Kim <jubeomk@nvidia.com>2011-06-22 23:19:19 +0900
committerRohan Somvanshi <rsomvanshi@nvidia.com>2011-06-26 19:17:32 -0700
commit4299db4686321fb3017f9118a36610898f172639 (patch)
tree9f27c63899f6806c9238801b1d82758916e1ab9d
parentbdc441e9bebeb893b7e9ec383fd77869dbcefc09 (diff)
rtc : tps6586x: move NULL checking to the front.
Change-Id: Ic46e7f16fdd90db6dc8d7c1e723f10c5d928f382 Reviewed-on: http://git-master/r/37866 Tested-by: Jubeom Kim <jubeomk@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--drivers/rtc/rtc-tps6586x.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-tps6586x.c b/drivers/rtc/rtc-tps6586x.c
index f3e5508ad13b..e058f6a423be 100644
--- a/drivers/rtc/rtc-tps6586x.c
+++ b/drivers/rtc/rtc-tps6586x.c
@@ -263,6 +263,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)
@@ -270,11 +275,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");