From 717f805865f551974d82c2877beb1538a94697fb Mon Sep 17 00:00:00 2001 From: Jubeom Kim Date: Wed, 22 Jun 2011 23:19:19 +0900 Subject: 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 Reviewed-by: Bharat Nihalani Rebase-Id: R7d8f5628cde155fe54d31f37eeacb4b5bb4962d1 --- drivers/rtc/rtc-tps6586x.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/rtc') 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"); -- cgit v1.2.3