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: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20230318233311.265186-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
Uwe Kleine-König 2023-03-19 00:33:07 +01:00 committed by Alexandre Belloni
parent 1dae3f1df7
commit 0f74f8b667
6 changed files with 8 additions and 19 deletions

View File

@ -2695,17 +2695,13 @@ EXPORT_SYMBOL_GPL(i3c_master_register);
* @master: master used to send frames on the bus
*
* 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_unregister_i3c_devs(master);
i3c_master_bus_cleanup(master);
device_unregister(&master->dev);
return 0;
}
EXPORT_SYMBOL_GPL(i3c_master_unregister);

View File

@ -1185,11 +1185,8 @@ static int dw_i3c_probe(struct platform_device *pdev)
static int dw_i3c_remove(struct platform_device *pdev)
{
struct dw_i3c_master *master = platform_get_drvdata(pdev);
int ret;
ret = i3c_master_unregister(&master->base);
if (ret)
return ret;
i3c_master_unregister(&master->base);
reset_control_assert(master->core_rst);

View File

@ -1665,11 +1665,8 @@ static int cdns_i3c_master_probe(struct platform_device *pdev)
static int cdns_i3c_master_remove(struct platform_device *pdev)
{
struct cdns_i3c_master *master = platform_get_drvdata(pdev);
int ret;
ret = i3c_master_unregister(&master->base);
if (ret)
return ret;
i3c_master_unregister(&master->base);
clk_disable_unprepare(master->sysclk);
clk_disable_unprepare(master->pclk);

View File

@ -769,7 +769,9 @@ static int i3c_hci_remove(struct platform_device *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[] = {

View File

@ -1572,11 +1572,8 @@ static int svc_i3c_master_probe(struct platform_device *pdev)
static int svc_i3c_master_remove(struct platform_device *pdev)
{
struct svc_i3c_master *master = platform_get_drvdata(pdev);
int ret;
ret = i3c_master_unregister(&master->base);
if (ret)
return ret;
i3c_master_unregister(&master->base);
pm_runtime_dont_use_autosuspend(&pdev->dev);
pm_runtime_disable(&pdev->dev);

View File

@ -542,7 +542,7 @@ int i3c_master_register(struct i3c_master_controller *master,
struct device *parent,
const struct i3c_master_controller_ops *ops,
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