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.

net: phy: fixed_phy: simplify fixed_mdio_read

swphy_read_reg() doesn't change the passed struct fixed_phy_status,
so we can pass &fp->status directly.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Link: https://patch.msgid.link/c49195c7-a3a1-485c-baed-9b33740752de@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Heiner Kallweit and committed by
Jakub Kicinski
6aff3699 a6bac182

+1 -4
+1 -4
drivers/net/phy/fixed_phy.c
··· 75 75 76 76 list_for_each_entry(fp, &fmb->phys, node) { 77 77 if (fp->addr == phy_addr) { 78 - struct fixed_phy_status state; 79 - 80 78 fp->status.link = !fp->no_carrier; 81 79 82 80 /* Issue callback if user registered it. */ ··· 84 86 85 87 /* Check the GPIO for change in status */ 86 88 fixed_phy_update(fp); 87 - state = fp->status; 88 89 89 - return swphy_read_reg(reg_num, &state); 90 + return swphy_read_reg(reg_num, &fp->status); 90 91 } 91 92 } 92 93