Skip to content

Commit 4b6c606

Browse files
claudiajkangPaolo Abeni
authored andcommitted
r8169: use tp_to_dev instead of open code
The open code is defined as a helper function(tp_to_dev) on r8169_main.c, which the open code is &tp->pci_dev->dev. The helper function was added in commit 1e1205b ("r8169: add helper tp_to_dev"). And then later, commit f1e911d ("r8169: add basic phylib support") added r8169_phylink_handler function but it didn't use the helper function. Thus, tp_to_dev() replaces the open code. This patch doesn't change logic. Signed-off-by: Juhee Kang <[email protected]> Reviewed-by: Heiner Kallweit <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 9e855b1 commit 4b6c606

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4559,12 +4559,13 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)
45594559
static void r8169_phylink_handler(struct net_device *ndev)
45604560
{
45614561
struct rtl8169_private *tp = netdev_priv(ndev);
4562+
struct device *d = tp_to_dev(tp);
45624563

45634564
if (netif_carrier_ok(ndev)) {
45644565
rtl_link_chg_patch(tp);
4565-
pm_request_resume(&tp->pci_dev->dev);
4566+
pm_request_resume(d);
45664567
} else {
4567-
pm_runtime_idle(&tp->pci_dev->dev);
4568+
pm_runtime_idle(d);
45684569
}
45694570

45704571
phy_print_status(tp->phydev);

0 commit comments

Comments
 (0)