From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754427AbdHYGcy (ORCPT ); Fri, 25 Aug 2017 02:32:54 -0400 Received: from mailgw02.mediatek.com ([218.249.47.111]:41173 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754142AbdHYGcs (ORCPT ); Fri, 25 Aug 2017 02:32:48 -0400 From: Chen Zhong To: Dmitry Torokhov CC: Rob Herring , Mark Rutland , Matthias Brugger , Lee Jones , Eddie Huang , Alessandro Zummo , Alexandre Belloni , Andi Shyti , Javier Martinez Canillas , Chen Zhong , Linus Walleij , Jaechul Lee , , , , , , Subject: [PATCH v3 1/5] mfd: mt6397: create irq mappings in mfd core driver Date: Fri, 25 Aug 2017 14:32:29 +0800 Message-ID: <1503642753-12385-2-git-send-email-chen.zhong@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1503642753-12385-1-git-send-email-chen.zhong@mediatek.com> References: <1503642753-12385-1-git-send-email-chen.zhong@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Acked-for-MFD-by: Lee Jones Signed-off-by: Chen Zhong --- drivers/mfd/mt6397-core.c | 4 ++-- drivers/rtc/rtc-mt6397.c | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index 04a601f..6546d7f 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c @@ -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: diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c index 1a61fa5..385f830 100644 --- a/drivers/rtc/rtc-mt6397.c +++ b/drivers/rtc/rtc-mt6397.c @@ -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; -- 1.7.9.5