i2c: return probe deferred status on dev_pm_domain_attach
Subsystems (2)
PATCH v3 1/1 i2c: return probe deferred status on dev_pm_domain_attach
A change of return status was introduced in commit 3fffd1283927 ("i2c: allow specifying separate wakeup interrupt in device tree")
The commit prevents the defer status being passed up the call stack appropriately when dev_pm_domain_attach returns -EPROBE_DEFER.
Catch the PROBE_DEFER and clear up the IRQ wakeup status
interrupt in device tree")
---
V2:
Fall through the error path before returning -EPROBE_DEFER
V3:
Drop the if/else for cleaner code path
drivers/i2c/i2c-core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/i2c/i2c-core.c +6 -6
@@ -694,12 +694,12 @@ static int i2c_device_probe(struct device *dev) goto err_clear_wakeup_irq; status =dev_pm_domain_attach (&client->dev, true); -if (status != -EPROBE_DEFER ) { - status = driver->probe (client,i2c_match_id (driver->id_table, - client)); -if (status) - goto err_detach_pm_domain; - } +if (status == -EPROBE_DEFER ) + goto err_clear_wakeup_irq; + + status = driver->probe (client,i2c_match_id (driver->id_table, client)); +if (status) + goto err_detach_pm_domain;return 0 ;
Signature · 1 line
2.1.4
Quoted 11 lines · Kieran Bingham
A change of return status was introduced in commit
3fffd1283927("i2c: allow specifying separate wakeup interrupt in device tree")The commit prevents the defer status being passed up the call stack appropriately when
dev_pm_domain_attachreturns -EPROBE_DEFER.Catch the
PROBE_DEFERand clear up the IRQ wakeup statusSigned-off-by Kieran Bingham <[email protected]>Fixes 3fffd1283927 ("i2c: allow specifying separate wakeupinterrupt in device tree")
Quoted 37 lines
---
V2:
Fall through the error path before returning -EPROBE_DEFERV3:
Drop the if/else for cleaner code pathdrivers/i2c/i2c-core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)drivers/i2c/i2c-core.c +6
-6@@ -694,12 +694,12 @@ static int i2c_device_probe(struct device *dev) goto err_clear_wakeup_irq; status =dev_pm_domain_attach (&client->dev, true); -if (status != -EPROBE_DEFER ) { - status = driver->probe (client,i2c_match_id (driver->id_table, - client)); -if (status) - goto err_detach_pm_domain; - } +if (status == -EPROBE_DEFER ) + goto err_clear_wakeup_irq; + + status = driver->probe (client,i2c_match_id (driver->id_table, client)); +if (status) + goto err_detach_pm_domain;return 0 ;Signature · 1 line
2.1.4
Signature · 1 line
Dmitry
Wolfram Sang
AppliedQuoted 12 lines · Kieran Bingham
A change of return status was introduced in commit
3fffd1283927("i2c: allow specifying separate wakeup interrupt in device tree")The commit prevents the defer status being passed up the call stack appropriately when
dev_pm_domain_attachreturns -EPROBE_DEFER.Catch the
PROBE_DEFERand clear up the IRQ wakeup statusSigned-off-by Kieran Bingham <[email protected]>Fixes 3fffd1283927 ("i2c: allow specifying separate wakeupinterrupt in device tree")
Applied to for-current, thanks!