From patchwork Thu Apr 21 12:25:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laxman Dewangan X-Patchwork-Id: 8900201 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F0B9F9F1C1 for ; Thu, 21 Apr 2016 12:39:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2882D20303 for ; Thu, 21 Apr 2016 12:39:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4373C2024F for ; Thu, 21 Apr 2016 12:39:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752553AbcDUMiM (ORCPT ); Thu, 21 Apr 2016 08:38:12 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:7490 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752020AbcDUMiG (ORCPT ); Thu, 21 Apr 2016 08:38:06 -0400 Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com id ; Thu, 21 Apr 2016 05:38:05 -0700 Received: from HQHUB101.nvidia.com ([172.20.187.24]) by hqnvupgp08.nvidia.com (PGP Universal service); Thu, 21 Apr 2016 05:37:56 -0700 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Thu, 21 Apr 2016 05:37:56 -0700 Received: from BGMAIL102.nvidia.com (10.25.59.11) by HQHUB101.nvidia.com (172.20.187.24) with Microsoft SMTP Server (TLS) id 8.3.406.0; Thu, 21 Apr 2016 05:38:04 -0700 Received: from HQMAIL106.nvidia.com (172.18.146.12) by bgmail102.nvidia.com (10.25.59.11) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Thu, 21 Apr 2016 12:38:01 +0000 Received: from ldewanganubuntu-System-Product-Name.nvidia.com (172.20.13.39) by HQMAIL106.nvidia.com (172.18.146.12) with Microsoft SMTP Server id 15.0.1130.7 via Frontend Transport; Thu, 21 Apr 2016 12:37:57 +0000 From: Laxman Dewangan To: , , , CC: , , , , , Laxman Dewangan Subject: [PATCH 2/7] mfd: lp8788: Use devm_mfd_add_devices and devm_regmap_add_irq_chip Date: Thu, 21 Apr 2016 17:55:53 +0530 Message-ID: <1461241558-26983-3-git-send-email-ldewangan@nvidia.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1461241558-26983-1-git-send-email-ldewangan@nvidia.com> References: <1461241558-26983-1-git-send-email-ldewangan@nvidia.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use devm_mfd_add_devices() for adding MFD child devices and devm_regmap_add_irq_chip() for IRQ chip registration. This reduces the error code path and .remove callback for removing MFD child devices and deleting IRQ chip data. Signed-off-by: Laxman Dewangan CC: Milo Kim --- drivers/mfd/lp8788-irq.c | 12 +++--------- drivers/mfd/lp8788.c | 10 ---------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/drivers/mfd/lp8788-irq.c b/drivers/mfd/lp8788-irq.c index 792d51b..aacd39f 100644 --- a/drivers/mfd/lp8788-irq.c +++ b/drivers/mfd/lp8788-irq.c @@ -175,9 +175,9 @@ int lp8788_irq_init(struct lp8788 *lp, int irq) lp->irqdm = irqd->domain; mutex_init(&irqd->irq_lock); - ret = request_threaded_irq(irq, NULL, lp8788_irq_handler, - IRQF_TRIGGER_FALLING | IRQF_ONESHOT, - "lp8788-irq", irqd); + ret = devm_request_threaded_irq(lp->dev, irq, NULL, lp8788_irq_handler, + IRQF_TRIGGER_FALLING | IRQF_ONESHOT, + "lp8788-irq", irqd); if (ret) { dev_err(lp->dev, "failed to create a thread for IRQ_N\n"); return ret; @@ -187,9 +187,3 @@ int lp8788_irq_init(struct lp8788 *lp, int irq) return 0; } - -void lp8788_irq_exit(struct lp8788 *lp) -{ - if (lp->irq) - free_irq(lp->irq, lp->irqdm); -} diff --git a/drivers/mfd/lp8788.c b/drivers/mfd/lp8788.c index acf6165..37fea46 100644 --- a/drivers/mfd/lp8788.c +++ b/drivers/mfd/lp8788.c @@ -203,15 +203,6 @@ static int lp8788_probe(struct i2c_client *cl, const struct i2c_device_id *id) ARRAY_SIZE(lp8788_devs), NULL, 0, NULL); } -static int lp8788_remove(struct i2c_client *cl) -{ - struct lp8788 *lp = i2c_get_clientdata(cl); - - mfd_remove_devices(lp->dev); - lp8788_irq_exit(lp); - return 0; -} - static const struct i2c_device_id lp8788_ids[] = { {"lp8788", 0}, { } @@ -223,7 +214,6 @@ static struct i2c_driver lp8788_driver = { .name = "lp8788", }, .probe = lp8788_probe, - .remove = lp8788_remove, .id_table = lp8788_ids, };