[RESEND] mfd: Remove .enable() and .disable() callbacks
Commit Message
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 <arnd@arndb.de>
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(-)
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
Comments
On Wed, 08 Mar 2023, Uwe Kleine-König wrote:
> 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 <arnd@arndb.de>
> 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
--
Lee Jones [李琼斯]
@@ -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;
@@ -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.