]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
pinctrl: exynos: fix type of count integer
authorHenrik Grimler <henrik@grimler.se>
Tue, 10 Sep 2024 18:37:18 +0000 (20:37 +0200)
committerMinkyu Kang <mk7.kang@samsung.com>
Tue, 5 Nov 2024 05:26:13 +0000 (14:26 +0900)
unsigned int count is used to capture return of dev_read_string_count.
When an error occurs dev_read_string_count returns -ve, which can
hence not be handled correctly. Use int instead of unsigned int so
that errors are detected.

Fixes: 16ca80adc551 ("pinctrl: Add pinctrl driver support for Exynos7420 SoC")
Signed-off-by: Henrik Grimler <henrik@grimler.se>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
drivers/pinctrl/exynos/pinctrl-exynos.c

index b393127c642c063116f753808b51219f4e091596..b37282fa9d6734b7c5b547930d05b5b65d5aa4e3 100644 (file)
@@ -114,8 +114,8 @@ static void exynos_pinctrl_set_pincfg(unsigned long reg_base, u32 pin_num,
 int exynos_pinctrl_set_state(struct udevice *dev, struct udevice *config)
 {
        struct exynos_pinctrl_priv *priv = dev_get_priv(dev);
-       unsigned int count, idx;
-       unsigned int pinvals[PINCFG_TYPE_NUM];
+       int count;
+       unsigned int idx, pinvals[PINCFG_TYPE_NUM];
 
        /*
         * refer to the following document for the pinctrl bindings