Skip to content

Commit 085aaca

Browse files
Uwe Kleine-Königwsakernel
Uwe Kleine-König
authored andcommitted
i2c: imx: If pm_runtime_get_sync() returned 1 device access is possible
pm_runtime_get_sync() returning 1 also means the device is powered. So resetting the chip registers in .remove() is possible and should be done. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Fixes: d98bdd3 ("i2c: imx: Make sure to unregister adapter on remove()") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent 80e78fc commit 085aaca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/i2c/busses/i2c-imx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1583,7 +1583,7 @@ static int i2c_imx_remove(struct platform_device *pdev)
15831583
if (i2c_imx->dma)
15841584
i2c_imx_dma_free(i2c_imx);
15851585

1586-
if (ret == 0) {
1586+
if (ret >= 0) {
15871587
/* setup chip registers to defaults */
15881588
imx_i2c_write_reg(0, i2c_imx, IMX_I2C_IADR);
15891589
imx_i2c_write_reg(0, i2c_imx, IMX_I2C_IFDR);

0 commit comments

Comments
 (0)