mfd: Remove .enable() and .disable() callbacks

Message ID 20230126152429.580539-1-u.kleine-koenig@pengutronix.de
State New
Headers
Series mfd: Remove .enable() and .disable() callbacks |

Commit Message

Uwe Kleine-König Jan. 26, 2023, 3:24 p.m. UTC
  With commit dd77f5fa97d3 ("mfd: Remove toshiba tmio drivers") the last
mfd driver that makes use of these callbacks is gone. The corresponding
functions mfd_cell_enable() and mfd_cell_disable() are also unused
(apart from the leds-asic3 driver that cannot be enabled any more after
the above mentioned remove and will/should be deleted, too).

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/mfd/mfd-core.c   | 26 --------------------------
 include/linux/mfd/core.h | 12 ------------
 2 files changed, 38 deletions(-)


base-commit: dd77f5fa97d3b2b066743647aad080314c476d74
  

Comments

Arnd Bergmann Jan. 26, 2023, 3:31 p.m. UTC | #1
On Thu, Jan 26, 2023, at 16:24, Uwe Kleine-König wrote:
> With commit dd77f5fa97d3 ("mfd: Remove toshiba tmio drivers") the last
> mfd driver that makes use of these callbacks is gone. The corresponding
> functions mfd_cell_enable() and mfd_cell_disable() are also unused
> (apart from the leds-asic3 driver that cannot be enabled any more after
> the above mentioned remove and will/should be deleted, too).
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/mfd/mfd-core.c   | 26 --------------------------
>  include/linux/mfd/core.h | 12 ------------
>  2 files changed, 38 deletions(-)

Acked-by: Arnd Bergmann <arnd@arndb.de>
  
Lee Jones Jan. 27, 2023, 2:41 p.m. UTC | #2
On Thu, 26 Jan 2023, Uwe Kleine-König wrote:

> With commit dd77f5fa97d3 ("mfd: Remove toshiba tmio drivers") the last
> mfd driver that makes use of these callbacks is gone. The corresponding
> functions mfd_cell_enable() and mfd_cell_disable() are also unused
> (apart from the leds-asic3 driver that cannot be enabled any more after
> the above mentioned remove and will/should be deleted, too).
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/mfd/mfd-core.c   | 26 --------------------------
>  include/linux/mfd/core.h | 12 ------------
>  2 files changed, 38 deletions(-)

Applied, thanks
  

Patch

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.