lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230113182427.257484-3-u.kleine-koenig@pengutronix.de>
Date:   Fri, 13 Jan 2023 19:24:27 +0100
From:   Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>
To:     Pavel Machek <pavel@....cz>, Lee Jones <lee@...nel.org>
Cc:     linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel@...gutronix.de
Subject: [PATCH 2/2] mfd: Make mfd_cell_disable() return void

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@...gutronix.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 --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
-- 
2.39.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ