From patchwork Mon Jun 12 21:24:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enric Balletbo i Serra X-Patchwork-Id: 9782833 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 480D260382 for ; Mon, 12 Jun 2017 21:25:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A9C927FB7 for ; Mon, 12 Jun 2017 21:25:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F3C72864F; Mon, 12 Jun 2017 21:25:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3B5C27FB7 for ; Mon, 12 Jun 2017 21:25:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752413AbdFLVZV (ORCPT ); Mon, 12 Jun 2017 17:25:21 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:60692 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752491AbdFLVYY (ORCPT ); Mon, 12 Jun 2017 17:24:24 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 4C1F926B9F3 From: Enric Balletbo i Serra To: linux-omap@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: Tony Lindgren , Rob Herring , Mark Rutland , Russell King , Lee Jones , Sebastian Reichel , grygorii.strashko@ti.com, javier@dowhile0.org Subject: [PATCH 3/4] mfd: tps65217: remove duplicated interrupt resources. Date: Mon, 12 Jun 2017 23:24:11 +0200 Message-Id: <20170612212412.22719-3-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170612212412.22719-1-enric.balletbo@collabora.com> References: <20170612212412.22719-1-enric.balletbo@collabora.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP I don't think it makes sense to have the interrupt resources for charger and power button in two different places, the driver and the DT binding. That's confusing so remove the ones from the mfd driver in favour of having the interrupt resources only described in the DT. Having the resources in DT may help if there is or will be a similar pmic with different resource allocation. Signed-off-by: Enric Balletbo i Serra --- drivers/mfd/tps65217.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c index f769c7d..fd83bae 100644 --- a/drivers/mfd/tps65217.c +++ b/drivers/mfd/tps65217.c @@ -33,15 +33,6 @@ #include #include -static struct resource charger_resources[] = { - DEFINE_RES_IRQ_NAMED(TPS65217_IRQ_AC, "AC"), - DEFINE_RES_IRQ_NAMED(TPS65217_IRQ_USB, "USB"), -}; - -static struct resource pb_resources[] = { - DEFINE_RES_IRQ_NAMED(TPS65217_IRQ_PB, "PB"), -}; - static void tps65217_irq_lock(struct irq_data *data) { struct tps65217 *tps = irq_data_get_irq_chip_data(data); @@ -97,14 +88,10 @@ static struct mfd_cell tps65217s[] = { }, { .name = "tps65217-charger", - .num_resources = ARRAY_SIZE(charger_resources), - .resources = charger_resources, .of_compatible = "ti,tps65217-charger", }, { .name = "tps65217-pwrbutton", - .num_resources = ARRAY_SIZE(pb_resources), - .resources = pb_resources, .of_compatible = "ti,tps65217-pwrbutton", }, }; @@ -359,15 +346,8 @@ static int tps65217_probe(struct i2c_client *client, return ret; } - if (client->irq) { + if (client->irq) tps65217_irq_init(tps, client->irq); - } else { - int i; - - /* Don't tell children about IRQ resources which won't fire */ - for (i = 0; i < ARRAY_SIZE(tps65217s); i++) - tps65217s[i].num_resources = 0; - } ret = devm_mfd_add_devices(tps->dev, -1, tps65217s, ARRAY_SIZE(tps65217s), NULL, 0,