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

Merge branch 'net-phy-fixed_phy-simplifications-and-improvements'

Heiner Kallweit says:

====================
net: phy: fixed_phy: simplifications and improvements

This series includes two types of changes:
- All callers pass PHY_POLL, therefore remove irq argument
- constify the passed struct fixed_phy_status *status
====================

Link: https://patch.msgid.link/4d4c468e-300d-42c7-92a1-eabbdb6be748@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+21 -25
+1 -1
arch/m68k/coldfire/m5272.c
··· 119 119 static int __init init_BSP(void) 120 120 { 121 121 m5272_uarts_init(); 122 - fixed_phy_add(PHY_POLL, 0, &nettel_fixed_phy_status); 122 + fixed_phy_add(0, &nettel_fixed_phy_status); 123 123 clkdev_add_table(m5272_clk_lookup, ARRAY_SIZE(m5272_clk_lookup)); 124 124 return 0; 125 125 }
+1 -1
arch/mips/bcm47xx/setup.c
··· 282 282 bcm47xx_leds_register(); 283 283 bcm47xx_workarounds(); 284 284 285 - fixed_phy_add(PHY_POLL, 0, &bcm47xx_fixed_phy_status); 285 + fixed_phy_add(0, &bcm47xx_fixed_phy_status); 286 286 return 0; 287 287 } 288 288 device_initcall(bcm47xx_register_bus_complete);
+1 -1
drivers/net/dsa/dsa_loop.c
··· 405 405 unsigned int i, ret; 406 406 407 407 for (i = 0; i < NUM_FIXED_PHYS; i++) 408 - phydevs[i] = fixed_phy_register(PHY_POLL, &status, NULL); 408 + phydevs[i] = fixed_phy_register(&status, NULL); 409 409 410 410 ret = mdio_driver_register(&dsa_loop_drv); 411 411 if (ret)
+1 -1
drivers/net/ethernet/broadcom/bgmac.c
··· 1446 1446 struct phy_device *phy_dev; 1447 1447 int err; 1448 1448 1449 - phy_dev = fixed_phy_register(PHY_POLL, &fphy_status, NULL); 1449 + phy_dev = fixed_phy_register(&fphy_status, NULL); 1450 1450 if (IS_ERR(phy_dev)) { 1451 1451 dev_err(bgmac->dev, "Failed to register fixed PHY device\n"); 1452 1452 return PTR_ERR(phy_dev);
+1 -1
drivers/net/ethernet/broadcom/genet/bcmmii.c
··· 625 625 .asym_pause = 0, 626 626 }; 627 627 628 - phydev = fixed_phy_register(PHY_POLL, &fphy_status, NULL); 628 + phydev = fixed_phy_register(&fphy_status, NULL); 629 629 if (IS_ERR(phydev)) { 630 630 dev_err(kdev, "failed to register fixed PHY device\n"); 631 631 return PTR_ERR(phydev);
+1 -1
drivers/net/ethernet/faraday/ftgmac100.c
··· 1906 1906 goto err_phy_connect; 1907 1907 } 1908 1908 1909 - phydev = fixed_phy_register(PHY_POLL, &ncsi_phy_status, np); 1909 + phydev = fixed_phy_register(&ncsi_phy_status, np); 1910 1910 if (IS_ERR(phydev)) { 1911 1911 dev_err(&pdev->dev, "failed to register fixed PHY device\n"); 1912 1912 err = PTR_ERR(phydev);
+1 -1
drivers/net/mdio/of_mdio.c
··· 458 458 return -ENODEV; 459 459 460 460 register_phy: 461 - return PTR_ERR_OR_ZERO(fixed_phy_register(PHY_POLL, &status, np)); 461 + return PTR_ERR_OR_ZERO(fixed_phy_register(&status, np)); 462 462 } 463 463 EXPORT_SYMBOL(of_phy_register_fixed_link); 464 464
+5 -7
drivers/net/phy/fixed_phy.c
··· 131 131 EXPORT_SYMBOL_GPL(fixed_phy_set_link_update); 132 132 133 133 static int fixed_phy_add_gpiod(unsigned int irq, int phy_addr, 134 - struct fixed_phy_status *status, 134 + const struct fixed_phy_status *status, 135 135 struct gpio_desc *gpiod) 136 136 { 137 137 int ret; ··· 160 160 return 0; 161 161 } 162 162 163 - int fixed_phy_add(unsigned int irq, int phy_addr, 164 - struct fixed_phy_status *status) 163 + int fixed_phy_add(int phy_addr, const struct fixed_phy_status *status) 165 164 { 166 - return fixed_phy_add_gpiod(irq, phy_addr, status, NULL); 165 + return fixed_phy_add_gpiod(PHY_POLL, phy_addr, status, NULL); 167 166 } 168 167 EXPORT_SYMBOL_GPL(fixed_phy_add); 169 168 ··· 222 223 } 223 224 #endif 224 225 225 - struct phy_device *fixed_phy_register(unsigned int irq, 226 - struct fixed_phy_status *status, 226 + struct phy_device *fixed_phy_register(const struct fixed_phy_status *status, 227 227 struct device_node *np) 228 228 { 229 229 struct fixed_mdio_bus *fmb = &platform_fmb; ··· 244 246 if (phy_addr < 0) 245 247 return ERR_PTR(phy_addr); 246 248 247 - ret = fixed_phy_add_gpiod(irq, phy_addr, status, gpiod); 249 + ret = fixed_phy_add_gpiod(PHY_POLL, phy_addr, status, gpiod); 248 250 if (ret < 0) { 249 251 ida_free(&phy_fixed_ida, phy_addr); 250 252 return ERR_PTR(ret);
+1 -1
drivers/net/usb/lan78xx.c
··· 2640 2640 netdev_info(dev->net, 2641 2641 "No PHY found on LAN7801 – registering fixed PHY (e.g. EVB-KSZ9897-1)\n"); 2642 2642 2643 - return fixed_phy_register(PHY_POLL, &fphy_status, NULL); 2643 + return fixed_phy_register(&fphy_status, NULL); 2644 2644 } 2645 2645 2646 2646 /**
+8 -10
include/linux/phy_fixed.h
··· 17 17 18 18 #if IS_ENABLED(CONFIG_FIXED_PHY) 19 19 extern int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier); 20 - extern int fixed_phy_add(unsigned int irq, int phy_id, 21 - struct fixed_phy_status *status); 22 - extern struct phy_device *fixed_phy_register(unsigned int irq, 23 - struct fixed_phy_status *status, 24 - struct device_node *np); 20 + int fixed_phy_add(int phy_id, const struct fixed_phy_status *status); 21 + struct phy_device *fixed_phy_register(const struct fixed_phy_status *status, 22 + struct device_node *np); 25 23 26 24 extern void fixed_phy_unregister(struct phy_device *phydev); 27 25 extern int fixed_phy_set_link_update(struct phy_device *phydev, 28 26 int (*link_update)(struct net_device *, 29 27 struct fixed_phy_status *)); 30 28 #else 31 - static inline int fixed_phy_add(unsigned int irq, int phy_id, 32 - struct fixed_phy_status *status) 29 + static inline int fixed_phy_add(int phy_id, 30 + const struct fixed_phy_status *status) 33 31 { 34 32 return -ENODEV; 35 33 } 36 - static inline struct phy_device *fixed_phy_register(unsigned int irq, 37 - struct fixed_phy_status *status, 38 - struct device_node *np) 34 + static inline struct phy_device * 35 + fixed_phy_register(const struct fixed_phy_status *status, 36 + struct device_node *np) 39 37 { 40 38 return ERR_PTR(-ENODEV); 41 39 }