Skip to content

Commit 9496fff

Browse files
Uwe Kleine-Königwsakernel
authored andcommitted
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: Uwe Kleine-König <[email protected]> Reviewed-by: Tony Lindgren <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 0cbc9a2 commit 9496fff

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/i2c/busses/i2c-omap.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,14 +1525,17 @@ static int omap_i2c_remove(struct platform_device *pdev)
15251525
int ret;
15261526

15271527
i2c_del_adapter(&omap->adapter);
1528-
ret = pm_runtime_resume_and_get(&pdev->dev);
1528+
1529+
ret = pm_runtime_get_sync(&pdev->dev);
15291530
if (ret < 0)
1530-
return ret;
1531+
dev_err(omap->dev, "Failed to resume hardware, skip disable\n");
1532+
else
1533+
omap_i2c_write_reg(omap, OMAP_I2C_CON_REG, 0);
15311534

1532-
omap_i2c_write_reg(omap, OMAP_I2C_CON_REG, 0);
15331535
pm_runtime_dont_use_autosuspend(&pdev->dev);
15341536
pm_runtime_put_sync(&pdev->dev);
15351537
pm_runtime_disable(&pdev->dev);
1538+
15361539
return 0;
15371540
}
15381541

0 commit comments

Comments
 (0)