diff options
author | Marek BehĂșn <marek.behun@nic.cz> | 2022-04-27 12:41:52 +0200 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2022-05-04 07:05:51 +0200 |
commit | 7ec50404ae65b081554ac5cceb1e60524413177f (patch) | |
tree | 13e5cfb64a9a2aaf193b32ec4f731ab1ec6e2dbc /drivers/net | |
parent | 1d87904c159bd2773c47e72befa18af8720f3177 (diff) | |
download | u-boot-7ec50404ae65b081554ac5cceb1e60524413177f.tar.gz u-boot-7ec50404ae65b081554ac5cceb1e60524413177f.tar.bz2 u-boot-7ec50404ae65b081554ac5cceb1e60524413177f.zip |
net: mvneta: Fix unused variable warning if DM_GPIO is disabled
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/mvneta.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 19f8145fc0..72789fc5c6 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -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); |