Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Fei Shao and committed by
Greg Kroah-Hartman
490d88ef f3e67fc4

+1 -9
+1 -9
drivers/spmi/hisi-spmi-controller.c
··· 308 308 ctrl->read_cmd = spmi_read_cmd; 309 309 ctrl->write_cmd = spmi_write_cmd; 310 310 311 - ret = spmi_controller_add(ctrl); 311 + ret = devm_spmi_controller_add(&pdev->dev, ctrl); 312 312 if (ret) { 313 313 dev_err(&pdev->dev, "spmi_controller_add failed with error %d!\n", ret); 314 314 return ret; 315 315 } 316 316 317 317 return 0; 318 - } 319 - 320 - static void spmi_del_controller(struct platform_device *pdev) 321 - { 322 - struct spmi_controller *ctrl = platform_get_drvdata(pdev); 323 - 324 - spmi_controller_remove(ctrl); 325 318 } 326 319 327 320 static const struct of_device_id spmi_controller_match_table[] = { ··· 327 334 328 335 static struct platform_driver spmi_controller_driver = { 329 336 .probe = spmi_controller_probe, 330 - .remove_new = spmi_del_controller, 331 337 .driver = { 332 338 .name = "hisi_spmi_controller", 333 339 .of_match_table = spmi_controller_match_table,