From patchwork Thu Jun 11 09:03:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 242121 List-Id: U-Boot discussion From: ovidiu.panait at windriver.com (Ovidiu Panait) Date: Thu, 11 Jun 2020 12:03:32 +0300 Subject: [PATCH 3/3] pinctrl: bcm283x: Store the return value of dev_read_u32_default to int In-Reply-To: <20200611090332.39137-1-ovidiu.panait@windriver.com> References: <20200611090332.39137-1-ovidiu.panait@windriver.com> Message-ID: <20200611090332.39137-3-ovidiu.panait@windriver.com> Currently, the return value of dev_read_u32_default is stored in an u32, causing the subsequent "if (function < 0)" to always be false: u32 function ... function = dev_read_u32_default(config, "brcm,function", -1); if (function < 0) { debug("Failed reading function for pinconfig %s (%d)\n", config->name, function); return -EINVAL; } Make "function" variable an int to fix this. Signed-off-by: Ovidiu Panait --- drivers/pinctrl/broadcom/pinctrl-bcm283x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/broadcom/pinctrl-bcm283x.c b/drivers/pinctrl/broadcom/pinctrl-bcm283x.c index 9ab0baee33..52aab4045c 100644 --- a/drivers/pinctrl/broadcom/pinctrl-bcm283x.c +++ b/drivers/pinctrl/broadcom/pinctrl-bcm283x.c @@ -63,7 +63,7 @@ static int bcm2835_gpio_get_func_id(struct udevice *dev, unsigned int gpio) int bcm283x_pinctrl_set_state(struct udevice *dev, struct udevice *config) { u32 pin_arr[MAX_PINS_PER_BANK]; - u32 function; + int function; int i, len, pin_count = 0; if (!dev_read_prop(config, "brcm,pins", &len) || !len ||