power: qcom_smbb: test the correct variable
"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>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
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 @@
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;
}