From patchwork Fri Jan 13 18:24:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 43545 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp420851wrt; Fri, 13 Jan 2023 10:30:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXv2iJk5/vLpkbyvl8UKRoqXkK2GEGjAXudoiyIK7P9KhphLJZaGqOzNVSqjkDn12PXCqj5J X-Received: by 2002:a05:6a20:d817:b0:ad:58d4:2a7a with SMTP id iv23-20020a056a20d81700b000ad58d42a7amr101243091pzb.22.1673634635234; Fri, 13 Jan 2023 10:30:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673634635; cv=none; d=google.com; s=arc-20160816; b=tAAzXluXmbFDv9evzN+HRqKCjjoCECRvMNt/Ds9szh60wX99nJhiXiZRFcaMqYeqQo Nr8MgWgZi5o95VuZABeD1T3si1Ia7B70N7lbFMWqbmYpeMqjnK3NsQsYeUUzvUM9pNaD OVrEtm04b9YiaXtKs+IhsWjrr8Ccp4QBIVRwtnW6TkTxX8DOSSxhRtJr9iMw/xMIg89u 0ByM4i5KWGd7Twm4pgDqW1mJzz1W1wYoAtm33u2PFt2Y+GewsXFrSAxcq6yJGo8cl8Tb 26IUV6zh3gggemvksi11aP2j0fG24pUHfwDBI90zw7J8y+UfF9X344gfm+8609j+kxGb Tadg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=EXg8PxwBjit6BPmkrzj3ESUQZ7ygA3E50N0q7w7q950=; b=GKhIcCCXqWvGjUC6MqWpUfiYmjR22STjVx8Ft7jI2NkeBkh4ozuTNmylgwgTJvRRti n6fAjDKA5TYfUDjLUP8F3WoqPD0rLxegEJ7YUafpAGFaifeRqtzWHtOTLFVlDFhtaYjg UFMIXFWq+2QKY9dKX5W14eCM16AZl6AQBK9JK+XytumeB1kNZI+gw52ubjj5O/XO1tRG gb4EXmNpQ/+L67DcIq4Dk6KfMZyknykPUUxlW/FkoHCOalZS2HhKzE7Fl4NkGDvZKcVy ub1C0bnOwx68pWlQgeVBBMBstc8TsW3HeSpOhYS2qnyfNHB7hJNMNvUhCWPWhQKzcntC CDBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c6-20020a63da06000000b004a6549b92afsi21379644pgh.699.2023.01.13.10.30.22; Fri, 13 Jan 2023 10:30:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231261AbjAMS2u (ORCPT + 99 others); Fri, 13 Jan 2023 13:28:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231154AbjAMS2D (ORCPT ); Fri, 13 Jan 2023 13:28:03 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB00944C56 for ; Fri, 13 Jan 2023 10:24:38 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pGOjA-0001QR-Bg; Fri, 13 Jan 2023 19:24:32 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pGOj9-005pIj-NP; Fri, 13 Jan 2023 19:24:31 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pGOj9-00Cahx-3n; Fri, 13 Jan 2023 19:24:31 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Pavel Machek , Lee Jones Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 2/2] mfd: Make mfd_cell_disable() return void Date: Fri, 13 Jan 2023 19:24:27 +0100 Message-Id: <20230113182427.257484-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113182427.257484-1-u.kleine-koenig@pengutronix.de> References: <20230113182427.257484-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2184; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=8+15TycfBn34R8uzROOfHpm0iFSqK9jUoxnISNz6QIM=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBjwaHXNn0ZTy0wkcPo4ksjjtHKP/GzwrPUyIJSATeu 5EPmEw+JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCY8Gh1wAKCRDB/BR4rcrsCTS8CA CIze4jRxOlIqrijYc5uV9ZoVtvzrXDa+ZfF3/18nKOWNyeYAEd/9vw0hoYDO/EdHXUa3ilx4Ihknqj kPmV/HgQRFTfVnXyxlXce8FpNuVuYJaQMTK0psQq7qjlAkWhaXSOPkeWXkGcI49k4WCqRuF6I56VuJ 4lt3i6Z8D7cOY4PH7ajpuO19M+OaiwgldQqggcuuKAMIrcFFq8BU33szE+pwlXdSMEgL7N7Pfg18xp W+IOg7KpfYpBKqZyuU5Ls0q8E9QyFGtPg4T5oCl1l3Sw8HSoZaOhXbg985H9o3whqG7AaD3l2tsem3 4ZnaOKzrPna8s+x4iG/MZhxukMhSOh X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754933111035972164?= X-GMAIL-MSGID: =?utf-8?q?1754933111035972164?= mfd_cell_disable() returns 0 unconditionally. Change it to return void instead to make its usage a bit more obvious. Signed-off-by: Uwe Kleine-König --- drivers/leds/leds-asic3.c | 6 ++++-- drivers/mfd/mfd-core.c | 12 ++++-------- include/linux/mfd/core.h | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/leds/leds-asic3.c b/drivers/leds/leds-asic3.c index 8cbc1b8bafa5..8256990394eb 100644 --- a/drivers/leds/leds-asic3.c +++ b/drivers/leds/leds-asic3.c @@ -117,7 +117,7 @@ static int asic3_led_probe(struct platform_device *pdev) return 0; out: - (void) mfd_cell_disable(pdev); + mfd_cell_disable(pdev); return ret; } @@ -127,7 +127,9 @@ static int asic3_led_remove(struct platform_device *pdev) led_classdev_unregister(led->cdev); - return mfd_cell_disable(pdev); + mfd_cell_disable(pdev); + + return 0; } #ifdef CONFIG_PM_SLEEP diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index b854c4adb527..33720f116b8c 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c @@ -46,18 +46,14 @@ int mfd_cell_enable(struct platform_device *pdev) } EXPORT_SYMBOL(mfd_cell_enable); -int mfd_cell_disable(struct platform_device *pdev) +void mfd_cell_disable(struct platform_device *pdev) { const struct mfd_cell *cell = mfd_get_cell(pdev); - if (!cell->disable) { + if (cell->disable) + cell->disable(pdev); + else dev_dbg(&pdev->dev, "No .disable() call-back registered\n"); - return 0; - } - - cell->disable(pdev); - - return 0; } EXPORT_SYMBOL(mfd_cell_disable); diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index 9833d0501d42..e43dc9ae2d71 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h @@ -130,7 +130,7 @@ struct mfd_cell { * clients are making use of it. */ extern int mfd_cell_enable(struct platform_device *pdev); -extern int mfd_cell_disable(struct platform_device *pdev); +extern void mfd_cell_disable(struct platform_device *pdev); /* * Given a platform device that's been created by mfd_add_devices(), fetch