Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Signed-off-by: YueHaibing <yuehaib...@huawei.com>
---
 drivers/rtc/rtc-lpc24xx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-lpc24xx.c b/drivers/rtc/rtc-lpc24xx.c
index a8bb156..00ef16b 100644
--- a/drivers/rtc/rtc-lpc24xx.c
+++ b/drivers/rtc/rtc-lpc24xx.c
@@ -194,15 +194,13 @@ static const struct rtc_class_ops lpc24xx_rtc_ops = {
 static int lpc24xx_rtc_probe(struct platform_device *pdev)
 {
        struct lpc24xx_rtc *rtc;
-       struct resource *res;
        int irq, ret;
 
        rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL);
        if (!rtc)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       rtc->rtc_base = devm_ioremap_resource(&pdev->dev, res);
+       rtc->rtc_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(rtc->rtc_base))
                return PTR_ERR(rtc->rtc_base);
 
-- 
2.7.4


Reply via email to