diff options
author | Fei Shao <fshao@chromium.org> | 2023-12-07 02:17:29 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-12-15 19:27:04 +0300 |
commit | 490d88ef548d463c85bd75ef5300b25c92d71e5a (patch) | |
tree | 86574ff7f0c3ddcdf6793bfdb90ffdf25a62fe76 | |
parent | f3e67fc406909fca9429b4283f243e855fab5c59 (diff) | |
download | linux-490d88ef548d463c85bd75ef5300b25c92d71e5a.tar.xz |
spmi: hisi-spmi-controller: Use devm_spmi_controller_add()
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>
Link: https://lore.kernel.org/r/20231206231733.4031901-7-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/spmi/hisi-spmi-controller.c | 10 |
1 files changed, 1 insertions, 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, |