diff mbox series

[2/2] mfd: Make mfd_cell_disable() return void

Message ID 20230113182427.257484-3-u.kleine-koenig@pengutronix.de
State New
Headers show
Series mfd: Make .disable() callback and mfd_cell_disable() return void | expand

Commit Message

Uwe Kleine-König Jan. 13, 2023, 6:24 p.m. UTC
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 <u.kleine-koenig@pengutronix.de>
---
 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 mbox series

Patch

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