OSDN Git Service

rtc: mxc_v2: Remove unnecessary platform_get_resource() error check
authorFabio Estevam <fabio.estevam@nxp.com>
Thu, 21 Dec 2017 11:43:24 +0000 (09:43 -0200)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Thu, 11 Jan 2018 23:20:40 +0000 (00:20 +0100)
devm_ioremap_resource() already checks if the resource is NULL, so
remove the unnecessary platform_get_resource() error check.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-mxc_v2.c

index b637095..eecc0cf 100644 (file)
@@ -296,9 +296,6 @@ static int mxc_rtc_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res)
-               return -ENODEV;
-
        pdata->ioaddr = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(pdata->ioaddr))
                return PTR_ERR(pdata->ioaddr);