From patchwork Wed Mar 8 09:12:57 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: 66123 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp229032wrd; Wed, 8 Mar 2023 01:28:55 -0800 (PST) X-Google-Smtp-Source: AK7set+kWBBbplPLurYUDpoWlpKuWfN/ICweas/Jtn5C9estI3FYwQh+z+xbJxd5srag+lAcCJRV X-Received: by 2002:a05:6402:384:b0:4af:6aa6:12d3 with SMTP id o4-20020a056402038400b004af6aa612d3mr14088662edv.40.1678267734876; Wed, 08 Mar 2023 01:28:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678267734; cv=none; d=google.com; s=arc-20160816; b=i91/6bvL8e3ppZYFzyK6a8FD186/6q629siHo8DgDmiAYs6+oEzl+S25GUAupvAyOM UF+W9p0plrr2uO3CpsakiINUUXpKkH4HPhgVW8IGVhAYsOHZdkaH2eja+BEbipwNJn7n F3lRrvYdu6r8wFaarUdXN8X7uwpAAc4Fup4jqxxWwMt5vsN/cmvC7aMYoxm2jB2uN/wX L0OA/dSumIfY0QVG0Li8BoLdMThhO9jZYDFQcbqjFbIEum0fYfjwihbWeZT/bPveYFHj tHylI69dO4QU+5rITnQfdnvxaWo9Ax8R+wSPDsa1Q6UD7iVY9o5p64O6An8yo+Mnk89v NB1w== 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 :message-id:date:subject:cc:to:from; bh=l/weU+jMYDuhqxBqx9iAmlx8W1FJem/9KzeummzPgRY=; b=l4PfVO23cn7kPX21oNflAny1DYg247tU9Tb6342Zvd6akHONrZ7D9WFmKe8UKuP8SM zrMx/kihnjWjXwDFfLEGhZp53qAoXdhG3jgU50a+7jBxHwfcRu911gKwY2HXNvgjrSnF 0yNSL5hwLmfhu5sdqFrFmeyxqvmj93vkCIxq/XHywm61M4EcMst22XrM0fHOyMi2pVAv G9x562Oc0JarWeXrU06shMBbFqixuKuxj85czI+AyoQ42/SsNbEJprohbQNxghjqMTYe 2fcuFjY7qImzoz1Wg66l2v4WYZA20LwwXpiPFZTRRqQZh5+pumXIowo7YKd3dD+8bTCQ Bf2A== 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 i23-20020aa7c717000000b004bd4b029f4fsi13991697edq.297.2023.03.08.01.28.31; Wed, 08 Mar 2023 01:28:54 -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 S230430AbjCHJNY (ORCPT + 99 others); Wed, 8 Mar 2023 04:13:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230389AbjCHJNK (ORCPT ); Wed, 8 Mar 2023 04:13:10 -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 290B432514 for ; Wed, 8 Mar 2023 01:13:04 -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 1pZpr4-0005oM-Cg; Wed, 08 Mar 2023 10:13:02 +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 1pZpr3-002gNp-8N; Wed, 08 Mar 2023 10:13:01 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pZpr2-003FWt-A4; Wed, 08 Mar 2023 10:13:00 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Lee Jones Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de, Arnd Bergmann Subject: [PATCH RESEND] mfd: Remove .enable() and .disable() callbacks Date: Wed, 8 Mar 2023 10:12:57 +0100 Message-Id: <20230308091257.2404932-1-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3138; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=GUzxnTWsIXWW7Ki2l9BW5VirY/a2SUtcfWPyToSsUOY=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkCFGV95AaBgJK4+4UaRi0abquVBWD1AJMlE/yO IfuAsdqC4qJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAhRlQAKCRDB/BR4rcrs CRwXB/9RqaAnWZo58atUMOIvJjM/L3vGJyxS01W/W8Q48QEY5YJO3SegE9Ht9HMKuEvS26NPpWY LTnrUzrwiOc98JXQguObVhIC6LNNC0qRUJ9R/Rpn1JrgWBGi/eK6bHW7IUoEm5fBgnOmBpCxWBZ D2nJEkBGx50WOpXOilMaN17DFPPKv2LPJ97l7EMTCffXnGnYCWyYlcjrX6vEfD3vwak1+mysiXg ttikg1RSbV6K0XW0/4iBMMt91eTgD/KruNs9NdbZyqrK3nQpOg6ijiJ5xs3B2mzZSq/1pbTZv18 i4Qs+cidrMK+IT9yKg64gkEARtI2b4oAgS3GpZ4tEeLe3pmh 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=ham 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?1759791268434906952?= X-GMAIL-MSGID: =?utf-8?q?1759791268434906952?= With commit dd77f5fa97d3 ("mfd: Remove toshiba tmio drivers") the last mfd driver that implements these callbacks is gone and since commit 652719b1003a ("w1: remove ds1wm driver") the last user is gone. The corresponding functions mfd_cell_enable() and mfd_cell_disable() are also unused (since commit 0ca222c81977 ("leds: Remove asic3 driver")). Acked-by: Arnd Bergmann Signed-off-by: Uwe Kleine-König --- drivers/mfd/mfd-core.c | 26 -------------------------- include/linux/mfd/core.h | 12 ------------ 2 files changed, 38 deletions(-) Hello, this patch was already sent in January. Back then however there were still a few drivers making use of the enable and disable calls. In v6.3-rc1 these are gone now and so it should be safe to apply this patch. The comment "Refcounting happens automatically, with the cell's enable/disable callbacks being called only when a device is first being enabled or no other clients are making use of it." is wrong. Should we consider this patch a fix then? :-) Best regards Uwe base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6 diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index 16d1861e9682..695d50b3bac6 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c @@ -33,32 +33,6 @@ static struct device_type mfd_dev_type = { .name = "mfd_device", }; -int mfd_cell_enable(struct platform_device *pdev) -{ - const struct mfd_cell *cell = mfd_get_cell(pdev); - - if (!cell->enable) { - dev_dbg(&pdev->dev, "No .enable() call-back registered\n"); - return 0; - } - - return cell->enable(pdev); -} -EXPORT_SYMBOL(mfd_cell_enable); - -int mfd_cell_disable(struct platform_device *pdev) -{ - const struct mfd_cell *cell = mfd_get_cell(pdev); - - if (!cell->disable) { - dev_dbg(&pdev->dev, "No .disable() call-back registered\n"); - return 0; - } - - return cell->disable(pdev); -} -EXPORT_SYMBOL(mfd_cell_disable); - #if IS_ENABLED(CONFIG_ACPI) struct match_ids_walk_data { struct acpi_device_id *ids; diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index 14ca7b471576..dac04793e194 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h @@ -68,9 +68,6 @@ struct mfd_cell { int id; int level; - int (*enable)(struct platform_device *dev); - int (*disable)(struct platform_device *dev); - int (*suspend)(struct platform_device *dev); int (*resume)(struct platform_device *dev); @@ -123,15 +120,6 @@ struct mfd_cell { int num_parent_supplies; }; -/* - * Convenience functions for clients using shared cells. Refcounting - * happens automatically, with the cell's enable/disable callbacks - * being called only when a device is first being enabled or no other - * clients are making use of it. - */ -extern int mfd_cell_enable(struct platform_device *pdev); -extern int mfd_cell_disable(struct platform_device *pdev); - /* * Given a platform device that's been created by mfd_add_devices(), fetch * the mfd_cell that created it.