Skip to content

Commit 9ab4ad2

Browse files
nkiryushinPaolo Abeni
authored andcommitted
tg3: Remove residual error handling in tg3_suspend
As of now, tg3_power_down_prepare always ends with success, but the error handling code from former tg3_set_power_state call is still here. This code became unreachable in commit c866b7e ("tg3: Do not use legacy PCI power management"). Remove (now unreachable) error handling code for simplification and change tg3_power_down_prepare to a void function as its result is no more checked. Signed-off-by: Nikita Kiryushin <[email protected]> Reviewed-by: Michael Chan <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent c0de6ab commit 9ab4ad2

File tree

1 file changed

+4
-26
lines changed
  • drivers/net/ethernet/broadcom

1 file changed

+4
-26
lines changed

drivers/net/ethernet/broadcom/tg3.c

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4019,7 +4019,7 @@ static int tg3_power_up(struct tg3 *tp)
40194019

40204020
static int tg3_setup_phy(struct tg3 *, bool);
40214021

4022-
static int tg3_power_down_prepare(struct tg3 *tp)
4022+
static void tg3_power_down_prepare(struct tg3 *tp)
40234023
{
40244024
u32 misc_host_ctrl;
40254025
bool device_should_wake, do_low_power;
@@ -4263,7 +4263,7 @@ static int tg3_power_down_prepare(struct tg3 *tp)
42634263

42644264
tg3_ape_driver_state_change(tp, RESET_KIND_SHUTDOWN);
42654265

4266-
return 0;
4266+
return;
42674267
}
42684268

42694269
static void tg3_power_down(struct tg3 *tp)
@@ -18084,7 +18084,6 @@ static int tg3_suspend(struct device *device)
1808418084
{
1808518085
struct net_device *dev = dev_get_drvdata(device);
1808618086
struct tg3 *tp = netdev_priv(dev);
18087-
int err = 0;
1808818087

1808918088
rtnl_lock();
1809018089

@@ -18108,32 +18107,11 @@ static int tg3_suspend(struct device *device)
1810818107
tg3_flag_clear(tp, INIT_COMPLETE);
1810918108
tg3_full_unlock(tp);
1811018109

18111-
err = tg3_power_down_prepare(tp);
18112-
if (err) {
18113-
int err2;
18114-
18115-
tg3_full_lock(tp, 0);
18116-
18117-
tg3_flag_set(tp, INIT_COMPLETE);
18118-
err2 = tg3_restart_hw(tp, true);
18119-
if (err2)
18120-
goto out;
18121-
18122-
tg3_timer_start(tp);
18123-
18124-
netif_device_attach(dev);
18125-
tg3_netif_start(tp);
18126-
18127-
out:
18128-
tg3_full_unlock(tp);
18129-
18130-
if (!err2)
18131-
tg3_phy_start(tp);
18132-
}
18110+
tg3_power_down_prepare(tp);
1813318111

1813418112
unlock:
1813518113
rtnl_unlock();
18136-
return err;
18114+
return 0;
1813718115
}
1813818116

1813918117
static int tg3_resume(struct device *device)

0 commit comments

Comments
 (0)