public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Fei Shao <fshao@chromium.org>,
	linux-kernel@vger.kernel.org, patches@lists.linux.dev
Subject: [PATCH 6/8] spmi: hisi-spmi-controller: Use devm_spmi_controller_add()
Date: Wed,  6 Dec 2023 15:17:29 -0800	[thread overview]
Message-ID: <20231206231733.4031901-7-sboyd@kernel.org> (raw)
In-Reply-To: <20231206231733.4031901-1-sboyd@kernel.org>

From: Fei Shao <fshao@chromium.org>

Convert to the device-managed version of spmi_controller_add() and
delete the unnecessary driver remove callback.

Signed-off-by: Fei Shao <fshao@chromium.org>
Link: https://lore.kernel.org/r/20230824104101.4083400-5-fshao@chromium.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
---
 drivers/spmi/hisi-spmi-controller.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/spmi/hisi-spmi-controller.c b/drivers/spmi/hisi-spmi-controller.c
index a5525902656a..674a350cc676 100644
--- a/drivers/spmi/hisi-spmi-controller.c
+++ b/drivers/spmi/hisi-spmi-controller.c
@@ -308,7 +308,7 @@ static int spmi_controller_probe(struct platform_device *pdev)
 	ctrl->read_cmd = spmi_read_cmd;
 	ctrl->write_cmd = spmi_write_cmd;
 
-	ret = spmi_controller_add(ctrl);
+	ret = devm_spmi_controller_add(&pdev->dev, ctrl);
 	if (ret) {
 		dev_err(&pdev->dev, "spmi_controller_add failed with error %d!\n", ret);
 		return ret;
@@ -317,13 +317,6 @@ static int spmi_controller_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static void spmi_del_controller(struct platform_device *pdev)
-{
-	struct spmi_controller *ctrl = platform_get_drvdata(pdev);
-
-	spmi_controller_remove(ctrl);
-}
-
 static const struct of_device_id spmi_controller_match_table[] = {
 	{
 		.compatible = "hisilicon,kirin970-spmi-controller",
@@ -334,7 +327,6 @@ MODULE_DEVICE_TABLE(of, spmi_controller_match_table);
 
 static struct platform_driver spmi_controller_driver = {
 	.probe		= spmi_controller_probe,
-	.remove_new	= spmi_del_controller,
 	.driver		= {
 		.name	= "hisi_spmi_controller",
 		.of_match_table = spmi_controller_match_table,
-- 
https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/
https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git


  parent reply	other threads:[~2023-12-06 23:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-06 23:17 [PATCH 0/8] SPMI patches for the merge window Stephen Boyd
2023-12-06 23:17 ` [PATCH 1/8] spmi: mtk-pmif: Serialize PMIF status check and command submission Stephen Boyd
2023-12-15 16:12   ` Greg Kroah-Hartman
2023-12-06 23:17 ` [PATCH 2/8] spmi: mediatek: Fix UAF on device remove Stephen Boyd
2023-12-06 23:17 ` [PATCH 3/8] spmi: Introduce device-managed functions Stephen Boyd
2023-12-06 23:17 ` [PATCH 4/8] spmi: Use devm_spmi_controller_alloc() Stephen Boyd
2023-12-06 23:17 ` [PATCH 5/8] spmi: mtk-pmif: Reorder driver remove sequence Stephen Boyd
2023-12-06 23:17 ` Stephen Boyd [this message]
2023-12-06 23:17 ` [PATCH 7/8] spmi: Return meaningful errors in spmi_controller_alloc() Stephen Boyd
2023-12-06 23:17 ` [PATCH 8/8] spmi: mediatek: add device id check Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231206231733.4031901-7-sboyd@kernel.org \
    --to=sboyd@kernel.org \
    --cc=fshao@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox