diff mbox series

pinctrl: exynos: fix type of count integer

Message ID 20240910-exynos-pinctrl-v1-1-f220454470ef@grimler.se
State New
Delegated to: Minkyu Kang
Headers show
Series pinctrl: exynos: fix type of count integer | expand

Commit Message

Henrik Grimler Sept. 10, 2024, 6:37 p.m. UTC
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>
---
 drivers/pinctrl/exynos/pinctrl-exynos.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


---
base-commit: ce1a2630827a1f9ddadb2598ab7936732e6cb723
change-id: 20240910-exynos-pinctrl-c70d952d7f9b

Best regards,
diff mbox series

Patch

diff --git a/drivers/pinctrl/exynos/pinctrl-exynos.c b/drivers/pinctrl/exynos/pinctrl-exynos.c
index b393127c64..b37282fa9d 100644
--- a/drivers/pinctrl/exynos/pinctrl-exynos.c
+++ b/drivers/pinctrl/exynos/pinctrl-exynos.c
@@ -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