i2c: xiic: Correct return value check for xiic_reinit()
Subsystems (2)
PATCH 1/1 i2c: xiic: Correct return value check for xiic_reinit()
The error paths for xiic_reinit() return negative values on failure and 0 on success - this error message therefore is triggered on _success_ rather than failure. Correct the condition so it's only shown on failure as intended.
--- drivers/i2c/busses/i2c-xiic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-xiic.c +1 -1
@@ -710,7 +710,7 @@ static irqreturn_t xiic_process(int irq, void *dev_id)* reset the IP instead of just flush fifos */ ret =xiic_reinit (i2c); -if (!ret) +if (ret <0 )dev_dbg (i2c->adap.dev.parent,"reinit failed\n" );if (i2c->rx_msg) {
Signature · 1 line
2.34.1
Quoted 16 lines · Daniel Scally
The error paths for
xiic_reinit()return negative values on failure and 0 on success - this error message therefore is triggered on _success_ rather than failure. Correct the condition so it's only shown on failure as intended.Fixes 8fa9c9388053 ("i2c: xiic: return value of xiic_reinit")Signed-off-by Daniel Scally <[email protected]>--- drivers/i2c/busses/i2c-xiic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/i2c/busses/i2c-xiic.c +0
-0
drivers/i2c/busses/i2c-xiic.c static irqreturn_t xiic_process(int irq, void *dev_id) · line 716
Quoted 8 lines
drivers/i2c/busses/i2c-xiic.c +1
-1@@ -710,7 +710,7 @@ static irqreturn_t xiic_process(int irq, void *dev_id)* reset the IP instead of just flush fifos */ ret =xiic_reinit (i2c); -if (!ret) +if (ret <0 )dev_dbg (i2c->adap.dev.parent,"reinit failed\n" );if (i2c->rx_msg) {
It would be interesting to know how origin patch was tested. Anyway
Thanks,
Michal
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi Daniel,
[...]
drivers/i2c/busses/i2c-xiic.c static irqreturn_t xiic_process(int irq, void *dev_id) · line 714
Quoted 7 lines
drivers/i2c/busses/i2c-xiic.c +1
-1@@ -710,7 +710,7 @@ static irqreturn_t xiic_process(int irq, void *dev_id)* reset the IP instead of just flush fifos */ ret =xiic_reinit (i2c); -if (!ret) +if (ret <0 )dev_dbg (i2c->adap.dev.parent,"reinit failed\n" );
this should be a dev_warn(), but it's anyway out of the scope of this patch.
Andi
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Wolfram Sang
AppliedQuoted 7 lines · Daniel Scally
The error paths for
xiic_reinit()return negative values on failure and 0 on success - this error message therefore is triggered on _success_ rather than failure. Correct the condition so it's only shown on failure as intended.Fixes 8fa9c9388053 ("i2c: xiic: return value of xiic_reinit")Signed-off-by Daniel Scally <[email protected]>
Applied to for-current, thanks!