diff mbox series

soc: qcom: ramp_controller: Improve error message for failure in .remove()

Message ID 20230415201848.3779001-1-u.kleine-koenig@pengutronix.de (mailing list archive)
State Accepted
Headers show
Series soc: qcom: ramp_controller: Improve error message for failure in .remove() | expand

Commit Message

Uwe Kleine-König April 15, 2023, 8:18 p.m. UTC
When a platform_driver's .remove() callback returns an error, the driver
core emits

	remove callback returned a non-zero value. This will be ignored.

. Replace this by a more specific error message. Then convert to
.remove_new() which is equivalent to returning zero unconditionally in
.remove(). See commit 5c5a7680e67b ("platform: Provide a remove callback
that returns no value") for its rationale.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/soc/qcom/ramp_controller.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)


base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6

Comments

Uwe Kleine-König May 9, 2023, 6:14 a.m. UTC | #1
Hello,

On Sat, Apr 15, 2023 at 10:18:48PM +0200, Uwe Kleine-König wrote:
> When a platform_driver's .remove() callback returns an error, the driver
> core emits
> 
> 	remove callback returned a non-zero value. This will be ignored.
> 
> . Replace this by a more specific error message. Then convert to
> .remove_new() which is equivalent to returning zero unconditionally in
> .remove(). See commit 5c5a7680e67b ("platform: Provide a remove callback
> that returns no value") for its rationale.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/soc/qcom/ramp_controller.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)

This patch didn't make it into mainline as of v6.4-rc1 and isn't in next
either. Any volunteer to pick it up? The previous patches to this driver
went in via Bjorn Andersson?!

Best regards
Uwe
Bjorn Andersson May 25, 2023, 4:54 a.m. UTC | #2
On Sat, 15 Apr 2023 22:18:48 +0200, Uwe Kleine-König wrote:
> When a platform_driver's .remove() callback returns an error, the driver
> core emits
> 
> 	remove callback returned a non-zero value. This will be ignored.
> 
> . Replace this by a more specific error message. Then convert to
> .remove_new() which is equivalent to returning zero unconditionally in
> .remove(). See commit 5c5a7680e67b ("platform: Provide a remove callback
> that returns no value") for its rationale.
> 
> [...]

Applied, thanks!

[1/1] soc: qcom: ramp_controller: Improve error message for failure in .remove()
      commit: c72e31718a8fb9bc070ee99f273446e05caa687d

Best regards,
diff mbox series

Patch

diff --git a/drivers/soc/qcom/ramp_controller.c b/drivers/soc/qcom/ramp_controller.c
index dc74d2a19de2..1ff13661bcce 100644
--- a/drivers/soc/qcom/ramp_controller.c
+++ b/drivers/soc/qcom/ramp_controller.c
@@ -308,12 +308,15 @@  static int qcom_ramp_controller_probe(struct platform_device *pdev)
 	return qcom_ramp_controller_start(qrc);
 }
 
-static int qcom_ramp_controller_remove(struct platform_device *pdev)
+static void qcom_ramp_controller_remove(struct platform_device *pdev)
 {
 	struct qcom_ramp_controller *qrc = platform_get_drvdata(pdev);
+	int ret;
 
-	return rc_write_cfg(qrc, qrc->desc->cfg_ramp_dis,
-			    RC_DCVS_CFG_SID, qrc->desc->num_ramp_dis);
+	ret = rc_write_cfg(qrc, qrc->desc->cfg_ramp_dis,
+			   RC_DCVS_CFG_SID, qrc->desc->num_ramp_dis);
+	if (ret)
+		dev_err(&pdev->dev, "Failed to send disable sequence\n");
 }
 
 static const struct of_device_id qcom_ramp_controller_match_table[] = {
@@ -329,7 +332,7 @@  static struct platform_driver qcom_ramp_controller_driver = {
 		.suppress_bind_attrs = true,
 	},
 	.probe  = qcom_ramp_controller_probe,
-	.remove = qcom_ramp_controller_remove,
+	.remove_new = qcom_ramp_controller_remove,
 };
 
 static int __init qcom_ramp_controller_init(void)