mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-16 13:34:30 +00:00
staging: spmi: hisi-spmi-controller: fix it to probe successfully
Add a MODULE_DEVICE_TABLE() to the driver. Also, the current logic calls platform_set_drvdata(pdev, NULL) if the driver succeeds loading. While here, remove the .owner, as it is not needed upstream anymore. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Link: https://lore.kernel.org/r/122bd1c02f325094f4830ac79a86430fbe01e3d5.1597647359.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2ea3f6a03b
commit
85eb5344f2
@ -324,11 +324,14 @@ static int spmi_controller_probe(struct platform_device *pdev)
|
||||
ctrl->write_cmd = spmi_write_cmd;
|
||||
|
||||
ret = spmi_controller_add(ctrl);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "spmi_add_controller failed!\n");
|
||||
if (ret)
|
||||
goto err_add_controller;
|
||||
}
|
||||
|
||||
dev_info(&pdev->dev, "spmi_add_controller initialized\n");
|
||||
return 0;
|
||||
|
||||
err_add_controller:
|
||||
dev_err(&pdev->dev, "spmi_add_controller failed!\n");
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
return ret;
|
||||
}
|
||||
@ -347,13 +350,13 @@ static const struct of_device_id spmi_controller_match_table[] = {
|
||||
},
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, spmi_controller_match_table);
|
||||
|
||||
static struct platform_driver spmi_controller_driver = {
|
||||
.probe = spmi_controller_probe,
|
||||
.remove = spmi_del_controller,
|
||||
.driver = {
|
||||
.name = SPMI_CONTROLLER_NAME,
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = spmi_controller_match_table,
|
||||
},
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user