Commit 9496fffc authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Wolfram Sang

i2c: omap: Improve error reporting for problems during .remove()

If pm_runtime_get() fails in .remove() the driver used to return the
error to the driver core. The only effect of this (compared to returning
zero) is a generic warning that the error value is ignored.

So emit a better warning and return zero to suppress the generic (and
little helpful) message. Also disable runtime PM in the error case.

This prepares changing platform device remove callbacks to return void.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 0cbc9a2c
......@@ -1525,14 +1525,17 @@ static int omap_i2c_remove(struct platform_device *pdev)
int ret;
i2c_del_adapter(&omap->adapter);
ret = pm_runtime_resume_and_get(&pdev->dev);
ret = pm_runtime_get_sync(&pdev->dev);
if (ret < 0)
return ret;
dev_err(omap->dev, "Failed to resume hardware, skip disable\n");
else
omap_i2c_write_reg(omap, OMAP_I2C_CON_REG, 0);
omap_i2c_write_reg(omap, OMAP_I2C_CON_REG, 0);
pm_runtime_dont_use_autosuspend(&pdev->dev);
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
return 0;
}
......
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