mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 06:31:58 +02:00
i2c: designware-platdrv: fix cleanup on probe failure
Simplify the error handling in dw_i2c_plat_probe() by consolidating cleanup operations directly in the error path instead of using a goto label. This eliminates the goto statement, makes the error handling more transparent, and reduces code indirection while maintaining identical cleanup behavior on probe failure. Signed-off-by: Artem Shimko <a.shimko.dev@gmail.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20260130111039.874548-3-a.shimko.dev@gmail.com
This commit is contained in:
parent
78821a753f
commit
9eb9f7c304
|
|
@ -225,15 +225,12 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
|
|||
pm_runtime_enable(device);
|
||||
|
||||
ret = i2c_dw_probe(dev);
|
||||
if (ret)
|
||||
goto exit_probe;
|
||||
if (ret) {
|
||||
dw_i2c_plat_pm_cleanup(dev);
|
||||
i2c_dw_prepare_clk(dev, false);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
exit_probe:
|
||||
dw_i2c_plat_pm_cleanup(dev);
|
||||
i2c_dw_prepare_clk(dev, false);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void dw_i2c_plat_remove(struct platform_device *pdev)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user