]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: mvneta: Fix unused variable warning if DM_GPIO is disabled
authorMarek Behún <marek.behun@nic.cz>
Wed, 27 Apr 2022 10:41:52 +0000 (12:41 +0200)
committerStefan Roese <sr@denx.de>
Wed, 4 May 2022 05:05:51 +0000 (07:05 +0200)
The `ret` variable in mvneta_probe() is unused if DM_GPIO is disabled.

Since the variable is used only once after assigning value, we can
inline the usage and drop the variable.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
drivers/net/mvneta.c

index 19f8145fc04b6b98532122fb1edc150071ad2c7a..72789fc5c6c74d656a777253044e61ecd5ac0e73 100644 (file)
@@ -1570,7 +1570,6 @@ static int mvneta_probe(struct udevice *dev)
        int node = dev_of_offset(dev);
        void *bd_space;
        int fl_node;
-       int ret;
 
        /*
         * Allocate buffer area for descs and rx_buffers. This is only
@@ -1617,8 +1616,8 @@ static int mvneta_probe(struct udevice *dev)
        }
 
 #if CONFIG_IS_ENABLED(DM_GPIO)
-       ret = dev_read_phandle_with_args(dev, "sfp", NULL, 0, 0, &sfp_args);
-       if (!ret && ofnode_is_enabled(sfp_args.node))
+       if (!dev_read_phandle_with_args(dev, "sfp", NULL, 0, 0, &sfp_args) &&
+           ofnode_is_enabled(sfp_args.node))
                gpio_request_by_name_nodev(sfp_args.node, "tx-disable-gpio", 0,
                                           &pp->sfp_tx_disable_gpio, GPIOD_IS_OUT);