* [PATCH, net-next] r8169: use tp_to_dev instead of open code
@ 2022-11-29 16:12 Juhee Kang
2022-11-29 22:33 ` Heiner Kallweit
2022-12-01 14:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Juhee Kang @ 2022-11-29 16:12 UTC (permalink / raw)
To: hkallweit1, nic_swsd, davem, edumazet, kuba, pabeni, netdev; +Cc: Juhee Kang
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 1e1205b7d3e9 ("r8169: add helper tp_to_dev"). And then later,
commit f1e911d5d0df ("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 <claudiajkang@gmail.com>
---
drivers/net/ethernet/realtek/r8169_main.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 5bc1181f829b..ec157885da13 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4559,12 +4559,13 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)
static void r8169_phylink_handler(struct net_device *ndev)
{
struct rtl8169_private *tp = netdev_priv(ndev);
+ struct device *d = tp_to_dev(tp);
if (netif_carrier_ok(ndev)) {
rtl_link_chg_patch(tp);
- pm_request_resume(&tp->pci_dev->dev);
+ pm_request_resume(d);
} else {
- pm_runtime_idle(&tp->pci_dev->dev);
+ pm_runtime_idle(d);
}
phy_print_status(tp->phydev);
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH, net-next] r8169: use tp_to_dev instead of open code
2022-11-29 16:12 [PATCH, net-next] r8169: use tp_to_dev instead of open code Juhee Kang
@ 2022-11-29 22:33 ` Heiner Kallweit
2022-12-01 14:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Heiner Kallweit @ 2022-11-29 22:33 UTC (permalink / raw)
To: Juhee Kang, nic_swsd, davem, edumazet, kuba, pabeni, netdev
On 29.11.2022 17:12, Juhee Kang wrote:
> 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 1e1205b7d3e9 ("r8169: add helper tp_to_dev"). And then later,
> commit f1e911d5d0df ("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 <claudiajkang@gmail.com>
Doesn't hurt and helper is used more than once in this function.
Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH, net-next] r8169: use tp_to_dev instead of open code
2022-11-29 16:12 [PATCH, net-next] r8169: use tp_to_dev instead of open code Juhee Kang
2022-11-29 22:33 ` Heiner Kallweit
@ 2022-12-01 14:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-12-01 14:50 UTC (permalink / raw)
To: Juhee Kang; +Cc: hkallweit1, nic_swsd, davem, edumazet, kuba, pabeni, netdev
Hello:
This patch was applied to netdev/net-next.git (master)
by Paolo Abeni <pabeni@redhat.com>:
On Wed, 30 Nov 2022 01:12:44 +0900 you wrote:
> 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 1e1205b7d3e9 ("r8169: add helper tp_to_dev"). And then later,
> commit f1e911d5d0df ("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.
>
> [...]
Here is the summary with links:
- [net-next] r8169: use tp_to_dev instead of open code
https://git.kernel.org/netdev/net-next/c/4b6c6065fca1
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-12-01 14:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-29 16:12 [PATCH, net-next] r8169: use tp_to_dev instead of open code Juhee Kang
2022-11-29 22:33 ` Heiner Kallweit
2022-12-01 14:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).