Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752120AbdHHJKF (ORCPT ); Tue, 8 Aug 2017 05:10:05 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:30993 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751868AbdHHJKC (ORCPT ); Tue, 8 Aug 2017 05:10:02 -0400 Message-ID: <1502183395.28466.5.camel@mhfsdcap03> Subject: Re: [PATCH v2 1/5] mfd: mt6397: create irq mappings in mfd core driver From: Chen Zhong To: Dmitry Torokhov CC: Alexandre Belloni , Rob Herring , Mark Rutland , Matthias Brugger , Lee Jones , Eddie Huang , Alessandro Zummo , Jaechul Lee , Jonathan Cameron , Javier Martinez Canillas , Linus Walleij , Beomho Seo , , , , , , Date: Tue, 8 Aug 2017 17:09:55 +0800 In-Reply-To: <20170808025328.GB12328@dtor-ws> References: <1502071065-6745-1-git-send-email-chen.zhong@mediatek.com> <1502071065-6745-2-git-send-email-chen.zhong@mediatek.com> <20170807213244.7hrd3isq5jj44dgd@piout.net> <20170808025328.GB12328@dtor-ws> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2335 Lines: 69 On Mon, 2017-08-07 at 19:53 -0700, Dmitry Torokhov wrote: > On Mon, Aug 07, 2017 at 11:32:44PM +0200, Alexandre Belloni wrote: > > On 07/08/2017 at 09:57:41 +0800, Chen Zhong wrote: > > > 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 > > > > For the RTC part: > > Acked-by: Alexandre Belloni > > > > > --- > > > drivers/mfd/mt6397-core.c | 4 ++-- > > > drivers/rtc/rtc-mt6397.c | 2 +- > > > 2 files changed, 3 insertions(+), 3 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..22c52f7 100644 > > > --- a/drivers/rtc/rtc-mt6397.c > > > +++ b/drivers/rtc/rtc-mt6397.c > > > @@ -323,7 +323,7 @@ static int mtk_rtc_probe(struct platform_device *pdev) > > > rtc->addr_base = res->start; > > > > > > res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); > > > - rtc->irq = irq_create_mapping(mt6397_chip->irq_domain, res->start); > > > + rtc->irq = res->start; > > Why not > > rtc->irq = platform_get_irq(pdev, 0); > if (rtc->irq < 0) > return rtc->irq; > ? > > This way you propagate error properly. > > Thanks. > Hi Dmitry, I'll modify it to get irq number via this way. Thank you.