Skip to content

Commit 04ff99f

Browse files
committed
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/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 4c2bd79 + 4ba1c5b commit 04ff99f

File tree

10 files changed

+21
-25
lines changed

10 files changed

+21
-25
lines changed

arch/m68k/coldfire/m5272.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static struct fixed_phy_status nettel_fixed_phy_status __initdata = {
119119
static int __init init_BSP(void)
120120
{
121121
m5272_uarts_init();
122-
fixed_phy_add(PHY_POLL, 0, &nettel_fixed_phy_status);
122+
fixed_phy_add(0, &nettel_fixed_phy_status);
123123
clkdev_add_table(m5272_clk_lookup, ARRAY_SIZE(m5272_clk_lookup));
124124
return 0;
125125
}

arch/mips/bcm47xx/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ static int __init bcm47xx_register_bus_complete(void)
282282
bcm47xx_leds_register();
283283
bcm47xx_workarounds();
284284

285-
fixed_phy_add(PHY_POLL, 0, &bcm47xx_fixed_phy_status);
285+
fixed_phy_add(0, &bcm47xx_fixed_phy_status);
286286
return 0;
287287
}
288288
device_initcall(bcm47xx_register_bus_complete);

drivers/net/dsa/dsa_loop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ static int __init dsa_loop_init(void)
405405
unsigned int i, ret;
406406

407407
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);
409409

410410
ret = mdio_driver_register(&dsa_loop_drv);
411411
if (ret)

drivers/net/ethernet/broadcom/bgmac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1446,7 +1446,7 @@ int bgmac_phy_connect_direct(struct bgmac *bgmac)
14461446
struct phy_device *phy_dev;
14471447
int err;
14481448

1449-
phy_dev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
1449+
phy_dev = fixed_phy_register(&fphy_status, NULL);
14501450
if (IS_ERR(phy_dev)) {
14511451
dev_err(bgmac->dev, "Failed to register fixed PHY device\n");
14521452
return PTR_ERR(phy_dev);

drivers/net/ethernet/broadcom/genet/bcmmii.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ static int bcmgenet_mii_pd_init(struct bcmgenet_priv *priv)
625625
.asym_pause = 0,
626626
};
627627

628-
phydev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
628+
phydev = fixed_phy_register(&fphy_status, NULL);
629629
if (IS_ERR(phydev)) {
630630
dev_err(kdev, "failed to register fixed PHY device\n");
631631
return PTR_ERR(phydev);

drivers/net/ethernet/faraday/ftgmac100.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1906,7 +1906,7 @@ static int ftgmac100_probe(struct platform_device *pdev)
19061906
goto err_phy_connect;
19071907
}
19081908

1909-
phydev = fixed_phy_register(PHY_POLL, &ncsi_phy_status, np);
1909+
phydev = fixed_phy_register(&ncsi_phy_status, np);
19101910
if (IS_ERR(phydev)) {
19111911
dev_err(&pdev->dev, "failed to register fixed PHY device\n");
19121912
err = PTR_ERR(phydev);

drivers/net/mdio/of_mdio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ int of_phy_register_fixed_link(struct device_node *np)
458458
return -ENODEV;
459459

460460
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));
462462
}
463463
EXPORT_SYMBOL(of_phy_register_fixed_link);
464464

drivers/net/phy/fixed_phy.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ int fixed_phy_set_link_update(struct phy_device *phydev,
131131
EXPORT_SYMBOL_GPL(fixed_phy_set_link_update);
132132

133133
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,
135135
struct gpio_desc *gpiod)
136136
{
137137
int ret;
@@ -160,10 +160,9 @@ static int fixed_phy_add_gpiod(unsigned int irq, int phy_addr,
160160
return 0;
161161
}
162162

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)
165164
{
166-
return fixed_phy_add_gpiod(irq, phy_addr, status, NULL);
165+
return fixed_phy_add_gpiod(PHY_POLL, phy_addr, status, NULL);
167166
}
168167
EXPORT_SYMBOL_GPL(fixed_phy_add);
169168

@@ -223,8 +222,7 @@ static struct gpio_desc *fixed_phy_get_gpiod(struct device_node *np)
223222
}
224223
#endif
225224

226-
struct phy_device *fixed_phy_register(unsigned int irq,
227-
struct fixed_phy_status *status,
225+
struct phy_device *fixed_phy_register(const struct fixed_phy_status *status,
228226
struct device_node *np)
229227
{
230228
struct fixed_mdio_bus *fmb = &platform_fmb;
@@ -246,7 +244,7 @@ struct phy_device *fixed_phy_register(unsigned int irq,
246244
if (phy_addr < 0)
247245
return ERR_PTR(phy_addr);
248246

249-
ret = fixed_phy_add_gpiod(irq, phy_addr, status, gpiod);
247+
ret = fixed_phy_add_gpiod(PHY_POLL, phy_addr, status, gpiod);
250248
if (ret < 0) {
251249
ida_free(&phy_fixed_ida, phy_addr);
252250
return ERR_PTR(ret);

drivers/net/usb/lan78xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2640,7 +2640,7 @@ static struct phy_device *lan78xx_register_fixed_phy(struct lan78xx_net *dev)
26402640
netdev_info(dev->net,
26412641
"No PHY found on LAN7801 – registering fixed PHY (e.g. EVB-KSZ9897-1)\n");
26422642

2643-
return fixed_phy_register(PHY_POLL, &fphy_status, NULL);
2643+
return fixed_phy_register(&fphy_status, NULL);
26442644
}
26452645

26462646
/**

include/linux/phy_fixed.h

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,23 @@ struct net_device;
1717

1818
#if IS_ENABLED(CONFIG_FIXED_PHY)
1919
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);
2523

2624
extern void fixed_phy_unregister(struct phy_device *phydev);
2725
extern int fixed_phy_set_link_update(struct phy_device *phydev,
2826
int (*link_update)(struct net_device *,
2927
struct fixed_phy_status *));
3028
#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)
3331
{
3432
return -ENODEV;
3533
}
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)
3937
{
4038
return ERR_PTR(-ENODEV);
4139
}

0 commit comments

Comments
 (0)