Skip to content

Commit f701716

Browse files
tititiou36gregkh
authored andcommitted
i2c: omap: Handle omap_i2c_init() errors in omap_i2c_probe()
commit a9503a2 upstream. omap_i2c_init() can fail. Handle this error in omap_i2c_probe(). Fixes: 010d442 ("i2c: New bus driver for TI OMAP boards") Signed-off-by: Christophe JAILLET <[email protected]> Cc: <[email protected]> # v2.6.19+ Signed-off-by: Andi Shyti <[email protected]> Link: https://lore.kernel.org/r/565311abf9bafd7291ca82bcecb48c1fac1e727b.1751701715.git.christophe.jaillet@wanadoo.fr Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ba35cc0 commit f701716

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/i2c/busses/i2c-omap.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,9 @@ omap_i2c_probe(struct platform_device *pdev)
14721472
}
14731473

14741474
/* reset ASAP, clearing any IRQs */
1475-
omap_i2c_init(omap);
1475+
r = omap_i2c_init(omap);
1476+
if (r)
1477+
goto err_mux_state_deselect;
14761478

14771479
if (omap->rev < OMAP_I2C_OMAP1_REV_2)
14781480
r = devm_request_irq(&pdev->dev, omap->irq, omap_i2c_omap1_isr,
@@ -1515,6 +1517,7 @@ omap_i2c_probe(struct platform_device *pdev)
15151517

15161518
err_unuse_clocks:
15171519
omap_i2c_write_reg(omap, OMAP_I2C_CON_REG, 0);
1520+
err_mux_state_deselect:
15181521
if (omap->mux_state)
15191522
mux_state_deselect(omap->mux_state);
15201523
err_put_pm:

0 commit comments

Comments
 (0)