linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] power: qcom_smbb: test the correct variable
@ 2015-09-24 18:41 Dan Carpenter
  2015-09-24 19:50 ` Courtney Cavin
  2015-09-24 20:36 ` Sebastian Reichel
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2015-09-24 18:41 UTC (permalink / raw)
  To: Sebastian Reichel, Courtney Cavin
  Cc: Dmitry Eremin-Solenikov, David Woodhouse, linux-pm,
	kernel-janitors

"state" is a bool so it's never less than zero.  The intent was to test
"ret" instead.

Fixes: 56d7df8716b2 ('power: Add Qualcomm SMBB driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/power/qcom_smbb.c b/drivers/power/qcom_smbb.c
index 0dabfe8..5eb1e9e 100644
--- a/drivers/power/qcom_smbb.c
+++ b/drivers/power/qcom_smbb.c
@@ -351,7 +351,7 @@ static void smbb_set_line_flag(struct smbb_charger *chg, int irq, int flag)
 	int ret;
 
 	ret = irq_get_irqchip_state(irq, IRQCHIP_STATE_LINE_LEVEL, &state);
-	if (state < 0) {
+	if (ret < 0) {
 		dev_err(chg->dev, "failed to read irq line\n");
 		return;
 	}

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-09-24 20:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-24 18:41 [patch] power: qcom_smbb: test the correct variable Dan Carpenter
2015-09-24 19:50 ` Courtney Cavin
2015-09-24 20:36 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).