]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
rtc: pxa: fix probe function
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 7 Jun 2018 08:29:09 +0000 (11:29 +0300)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 7 Jun 2018 18:11:08 +0000 (20:11 +0200)
This patch is from static analysis and I don't have the hardware to
to test it.  I think the test is reversed so now the probe function
will return success early and the last part of the function is dead
code.

Fixes: 3cdf4ad9633e ("rtc: pxa: convert to use shared sa1100 functions")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-pxa.c

index 47304f5664d83fc10afec302aa47aac47523f462..e1887b86fdc743ecd7a66edbb5d4b90b7a96625e 100644 (file)
@@ -363,7 +363,7 @@ static int __init pxa_rtc_probe(struct platform_device *pdev)
        sa1100_rtc->rtar = pxa_rtc->base + 0x4;
        sa1100_rtc->rttr = pxa_rtc->base + 0xc;
        ret = sa1100_rtc_init(pdev, sa1100_rtc);
-       if (!ret) {
+       if (ret) {
                dev_err(dev, "Unable to init SA1100 RTC sub-device\n");
                return ret;
        }