]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
pinctrl: exynos: Reduce variables scope
authorSam Protsenko <semen.protsenko@linaro.org>
Thu, 30 Nov 2023 20:13:51 +0000 (14:13 -0600)
committerTom Rini <trini@konsulko.com>
Tue, 9 Jan 2024 15:59:28 +0000 (10:59 -0500)
Pull some variables declared in exynos_pinctrl_set_state() into its
loop, to reduce their scope. Style commit, no functional change.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
drivers/pinctrl/exynos/pinctrl-exynos.c

index e79ce5113d848702738fc2a3e2f06010287aa3a7..b6af3befbf9b1712a4b7eeea15a948d1b03dfdf1 100644 (file)
@@ -120,10 +120,8 @@ int exynos_pinctrl_set_state(struct udevice *dev, struct udevice *config)
        struct exynos_pinctrl_priv *priv = dev_get_priv(dev);
        const void *fdt = gd->fdt_blob;
        int node = dev_of_offset(config);
-       unsigned int count, idx, pin_num;
+       unsigned int count, idx;
        unsigned int pinvals[PINCFG_TYPE_NUM];
-       unsigned long reg;
-       const char *name;
 
        /*
         * refer to the following document for the pinctrl bindings
@@ -141,7 +139,10 @@ int exynos_pinctrl_set_state(struct udevice *dev, struct udevice *config)
 
        for (idx = 0; idx < count; idx++) {
                const struct samsung_pin_bank_data *bank;
+               unsigned int pin_num;
                char bank_name[10];
+               unsigned long reg;
+               const char *name;
                int pincfg;
 
                name = fdt_stringlist_get(fdt, node, "samsung,pins", idx, NULL);