From fdde80878f872dc2e16fbb76e9fd7e2f7c5d3bc8 Mon Sep 17 00:00:00 2001 From: Jianxiong Pan Date: Fri, 9 Nov 2018 17:02:52 +0800 Subject: [PATCH] smartcard: fix defects for coverity [1/1] PD#166793 Problem: conditional statement not is valid. Solution: change type u32 to type int. Verify: module owner confirmed. Change-Id: I9fdfa444b29104c7afc9b7a380748ebe82ed390b Signed-off-by: Jianxiong Pan --- drivers/amlogic/smartcard/smartcard.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/amlogic/smartcard/smartcard.c b/drivers/amlogic/smartcard/smartcard.c index 8330b97a5cbf..789ba650effa 100644 --- a/drivers/amlogic/smartcard/smartcard.c +++ b/drivers/amlogic/smartcard/smartcard.c @@ -339,7 +339,7 @@ struct smc_dev { #define SMC_ENABLE_5V3V_PIN_NAME "smc:5V3V" int enable_5v3v_level; int (*reset)(void*, int); - u32 irq_num; + int irq_num; int reset_level; u32 pin_clk_pinmux_reg; @@ -1847,8 +1847,12 @@ static int smc_dev_init(struct smc_dev *smc, int id) if (IS_ERR(smc->pinctrl)) return -1; - of_property_read_string(smc->pdev->dev.of_node, + ret = of_property_read_string(smc->pdev->dev.of_node, "smc_need_enable_pin", &dts_str); + if (ret < 0) { + pr_error("failed to get smartcard node.\n"); + return -EINVAL; + } if (strcmp(dts_str, "yes") == 0) smc->use_enable_pin = 1; else