mfd: mt6397: Create irq mappings in mfd core driver
authorChen Zhong <chen.zhong@mediatek.com>
Wed, 25 Oct 2017 13:15:59 +0000 (21:15 +0800)
committerLee Jones <lee.jones@linaro.org>
Mon, 16 Apr 2018 14:16:04 +0000 (15:16 +0100)
The core driver should create and manage irq mappings instead of
leaf drivers. This patch change to pass irq domain to
devm_mfd_add_devices() and it will create mapping for irq resources
automatically. And remove irq mapping in rtc driver since this has
been done in core driver.

Signed-off-by: Chen Zhong <chen.zhong@mediatek.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/mt6397-core.c
drivers/rtc/rtc-mt6397.c

index 04a601f6aebe500d5491acfbbb4c68d7b56b9a73..6546d7f88b5e5c96a2dc0caeacad818ed9cd4be9 100644 (file)
@@ -289,7 +289,7 @@ static int mt6397_probe(struct platform_device *pdev)
 
                ret = devm_mfd_add_devices(&pdev->dev, -1, mt6323_devs,
                                           ARRAY_SIZE(mt6323_devs), NULL,
-                                          0, NULL);
+                                          0, pmic->irq_domain);
                break;
 
        case MT6397_CID_CODE:
@@ -304,7 +304,7 @@ static int mt6397_probe(struct platform_device *pdev)
 
                ret = devm_mfd_add_devices(&pdev->dev, -1, mt6397_devs,
                                           ARRAY_SIZE(mt6397_devs), NULL,
-                                          0, NULL);
+                                          0, pmic->irq_domain);
                break;
 
        default:
index 1a61fa56f3ad77bad999d234778e8d953fc1ad5a..385f8303bb412becfbe497ff24d2ebbe8ccfe09a 100644 (file)
@@ -322,10 +322,9 @@ static int mtk_rtc_probe(struct platform_device *pdev)
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        rtc->addr_base = res->start;
 
-       res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-       rtc->irq = irq_create_mapping(mt6397_chip->irq_domain, res->start);
-       if (rtc->irq <= 0)
-               return -EINVAL;
+       rtc->irq = platform_get_irq(pdev, 0);
+       if (rtc->irq < 0)
+               return rtc->irq;
 
        rtc->regmap = mt6397_chip->regmap;
        rtc->dev = &pdev->dev;