Commit 0f74f8b6 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Alexandre Belloni

i3c: Make i3c_master_unregister() return void

The function returned zero unconditionally. Switch the return type to void
and simplify the callers accordingly.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20230318233311.265186-2-u.kleine-koenig@pengutronix.deSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 1dae3f1d
...@@ -2695,17 +2695,13 @@ EXPORT_SYMBOL_GPL(i3c_master_register); ...@@ -2695,17 +2695,13 @@ EXPORT_SYMBOL_GPL(i3c_master_register);
* @master: master used to send frames on the bus * @master: master used to send frames on the bus
* *
* Basically undo everything done in i3c_master_register(). * Basically undo everything done in i3c_master_register().
*
* Return: 0 in case of success, a negative error code otherwise.
*/ */
int i3c_master_unregister(struct i3c_master_controller *master) void i3c_master_unregister(struct i3c_master_controller *master)
{ {
i3c_master_i2c_adapter_cleanup(master); i3c_master_i2c_adapter_cleanup(master);
i3c_master_unregister_i3c_devs(master); i3c_master_unregister_i3c_devs(master);
i3c_master_bus_cleanup(master); i3c_master_bus_cleanup(master);
device_unregister(&master->dev); device_unregister(&master->dev);
return 0;
} }
EXPORT_SYMBOL_GPL(i3c_master_unregister); EXPORT_SYMBOL_GPL(i3c_master_unregister);
......
...@@ -1185,11 +1185,8 @@ static int dw_i3c_probe(struct platform_device *pdev) ...@@ -1185,11 +1185,8 @@ static int dw_i3c_probe(struct platform_device *pdev)
static int dw_i3c_remove(struct platform_device *pdev) static int dw_i3c_remove(struct platform_device *pdev)
{ {
struct dw_i3c_master *master = platform_get_drvdata(pdev); struct dw_i3c_master *master = platform_get_drvdata(pdev);
int ret;
ret = i3c_master_unregister(&master->base); i3c_master_unregister(&master->base);
if (ret)
return ret;
reset_control_assert(master->core_rst); reset_control_assert(master->core_rst);
......
...@@ -1665,11 +1665,8 @@ static int cdns_i3c_master_probe(struct platform_device *pdev) ...@@ -1665,11 +1665,8 @@ static int cdns_i3c_master_probe(struct platform_device *pdev)
static int cdns_i3c_master_remove(struct platform_device *pdev) static int cdns_i3c_master_remove(struct platform_device *pdev)
{ {
struct cdns_i3c_master *master = platform_get_drvdata(pdev); struct cdns_i3c_master *master = platform_get_drvdata(pdev);
int ret;
ret = i3c_master_unregister(&master->base); i3c_master_unregister(&master->base);
if (ret)
return ret;
clk_disable_unprepare(master->sysclk); clk_disable_unprepare(master->sysclk);
clk_disable_unprepare(master->pclk); clk_disable_unprepare(master->pclk);
......
...@@ -769,7 +769,9 @@ static int i3c_hci_remove(struct platform_device *pdev) ...@@ -769,7 +769,9 @@ static int i3c_hci_remove(struct platform_device *pdev)
{ {
struct i3c_hci *hci = platform_get_drvdata(pdev); struct i3c_hci *hci = platform_get_drvdata(pdev);
return i3c_master_unregister(&hci->master); i3c_master_unregister(&hci->master);
return 0;
} }
static const __maybe_unused struct of_device_id i3c_hci_of_match[] = { static const __maybe_unused struct of_device_id i3c_hci_of_match[] = {
......
...@@ -1572,11 +1572,8 @@ static int svc_i3c_master_probe(struct platform_device *pdev) ...@@ -1572,11 +1572,8 @@ static int svc_i3c_master_probe(struct platform_device *pdev)
static int svc_i3c_master_remove(struct platform_device *pdev) static int svc_i3c_master_remove(struct platform_device *pdev)
{ {
struct svc_i3c_master *master = platform_get_drvdata(pdev); struct svc_i3c_master *master = platform_get_drvdata(pdev);
int ret;
ret = i3c_master_unregister(&master->base); i3c_master_unregister(&master->base);
if (ret)
return ret;
pm_runtime_dont_use_autosuspend(&pdev->dev); pm_runtime_dont_use_autosuspend(&pdev->dev);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
......
...@@ -542,7 +542,7 @@ int i3c_master_register(struct i3c_master_controller *master, ...@@ -542,7 +542,7 @@ int i3c_master_register(struct i3c_master_controller *master,
struct device *parent, struct device *parent,
const struct i3c_master_controller_ops *ops, const struct i3c_master_controller_ops *ops,
bool secondary); bool secondary);
int i3c_master_unregister(struct i3c_master_controller *master); void i3c_master_unregister(struct i3c_master_controller *master);
/** /**
* i3c_dev_get_master_data() - get master private data attached to an I3C * i3c_dev_get_master_data() - get master private data attached to an I3C
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment