From: Dan Carpenter Date: Thu, 24 Sep 2015 18:41:37 +0000 (+0300) Subject: power: qcom_smbb: test the correct variable X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0bc58e93819d542475cd9390921db509a283fe72;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Sebastian Reichel --- diff --git a/drivers/power/qcom_smbb.c b/drivers/power/qcom_smbb.c index 0dabfe8cceb2..5eb1e9e543e2 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; }