Also avoid using two variables where one can be used.

Signed-off-by: Vittorio Gambaletta <open...@vittgam.net>

---

Please apply to both trunk and CC.

--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3052.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3052.c
@@ -1373,7 +1373,7 @@ static int esw_probe(struct platform_device *pdev)
 {
        struct device_node *np = pdev->dev.of_node;
        const struct rt305x_esw_platform_data *pdata;
-       const __be32 *port_map, *reg_init;
+       const __be32 *reg_init;
        struct rt305x_esw *esw;
        struct switch_dev *swdev;
        struct resource *res, *irq;
@@ -1416,20 +1416,20 @@ static int esw_probe(struct platform_device *pdev)
                goto free_esw;
        }
 
-       port_map = of_get_property(np, "ralink,portmap", NULL);
-        if (port_map)
-               esw->port_map = be32_to_cpu(*port_map);
+       reg_init = of_get_property(np, "ralink,portmap", NULL);
+       if (reg_init)
+               esw->port_map = be32_to_cpu(*reg_init);
 
        reg_init = of_get_property(np, "ralink,fct2", NULL);
-        if (reg_init)
+       if (reg_init)
                esw->reg_initval_fct2 = be32_to_cpu(*reg_init);
 
        reg_init = of_get_property(np, "ralink,fpa2", NULL);
-        if (reg_init)
+       if (reg_init)
                esw->reg_initval_fpa2 = be32_to_cpu(*reg_init);
 
        reg_init = of_get_property(np, "ralink,led_polarity", NULL);
-        if (reg_init)
+       if (reg_init)
                esw->reg_led_polarity = be32_to_cpu(*reg_init);
 
        swdev = &esw->swdev;
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to