Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 c866b7eac073 ("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 <kiryushin@ancud.ru>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240401191418.361747-1-kiryushin@ancud.ru
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Nikita Kiryushin and committed by
Paolo Abeni
d72b7357 57a03d83

+4 -26
+4 -26
drivers/net/ethernet/broadcom/tg3.c
··· 4019 4019 4020 4020 static int tg3_setup_phy(struct tg3 *, bool); 4021 4021 4022 - static int tg3_power_down_prepare(struct tg3 *tp) 4022 + static void tg3_power_down_prepare(struct tg3 *tp) 4023 4023 { 4024 4024 u32 misc_host_ctrl; 4025 4025 bool device_should_wake, do_low_power; ··· 4263 4263 4264 4264 tg3_ape_driver_state_change(tp, RESET_KIND_SHUTDOWN); 4265 4265 4266 - return 0; 4266 + return; 4267 4267 } 4268 4268 4269 4269 static void tg3_power_down(struct tg3 *tp) ··· 18084 18084 { 18085 18085 struct net_device *dev = dev_get_drvdata(device); 18086 18086 struct tg3 *tp = netdev_priv(dev); 18087 - int err = 0; 18088 18087 18089 18088 rtnl_lock(); 18090 18089 ··· 18107 18108 tg3_flag_clear(tp, INIT_COMPLETE); 18108 18109 tg3_full_unlock(tp); 18109 18110 18110 - err = tg3_power_down_prepare(tp); 18111 - if (err) { 18112 - int err2; 18113 - 18114 - tg3_full_lock(tp, 0); 18115 - 18116 - tg3_flag_set(tp, INIT_COMPLETE); 18117 - err2 = tg3_restart_hw(tp, true); 18118 - if (err2) 18119 - goto out; 18120 - 18121 - tg3_timer_start(tp); 18122 - 18123 - netif_device_attach(dev); 18124 - tg3_netif_start(tp); 18125 - 18126 - out: 18127 - tg3_full_unlock(tp); 18128 - 18129 - if (!err2) 18130 - tg3_phy_start(tp); 18131 - } 18111 + tg3_power_down_prepare(tp); 18132 18112 18133 18113 unlock: 18134 18114 rtnl_unlock(); 18135 - return err; 18115 + return 0; 18136 18116 } 18137 18117 18138 18118 static int tg3_resume(struct device *device)