Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5468e82f authored by Linus Walleij's avatar Linus Walleij Committed by David S. Miller
Browse files

net: phy: fixed-phy: Drop GPIO from fixed_phy_add()



All users of the fixed_phy_add() pass -1 as GPIO number
to the fixed phy driver, and all users of fixed_phy_register()
pass -1 as GPIO number as well, except for the device
tree MDIO bus.

Any new users should create a proper device and pass the
GPIO as a descriptor associated with the device so delete
the GPIO argument from the calls and drop the code looking
requesting a GPIO in fixed_phy_add().

In fixed phy_register(), investigate the "fixed-link"
node and pick the GPIO descriptor from "link-gpios" if
this property exists. Move the corresponding code out
of of_mdio.c as the fixed phy code anyways requires
OF to be in use.

Tested-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fc9c5a4a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@ static struct fixed_phy_status stmmac0_fixed_phy_status = {

During the board's device_init we can configure the first
MAC for fixed_link by calling:
  fixed_phy_add(PHY_POLL, 1, &stmmac0_fixed_phy_status, -1);
  fixed_phy_add(PHY_POLL, 1, &stmmac0_fixed_phy_status);
and the second one, with a real PHY device attached to the bus,
by using the stmmac_mdio_bus_data structure (to provide the id, the
reset procedure etc).
+1 −1
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ static struct fixed_phy_status nettel_fixed_phy_status __initdata = {
static int __init init_BSP(void)
{
	m5272_uarts_init();
	fixed_phy_add(PHY_POLL, 0, &nettel_fixed_phy_status, -1);
	fixed_phy_add(PHY_POLL, 0, &nettel_fixed_phy_status);
	return 0;
}

+2 −2
Original line number Diff line number Diff line
@@ -683,7 +683,7 @@ static int __init ar7_register_devices(void)

	if (ar7_has_high_cpmac()) {
		res = fixed_phy_add(PHY_POLL, cpmac_high.id,
				    &fixed_phy_status, -1);
				    &fixed_phy_status);
		if (!res) {
			cpmac_get_mac(1, cpmac_high_data.dev_addr);

@@ -696,7 +696,7 @@ static int __init ar7_register_devices(void)
	} else
		cpmac_low_data.phy_mask = 0xffffffff;

	res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status, -1);
	res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status);
	if (!res) {
		cpmac_get_mac(0, cpmac_low_data.dev_addr);
		res = platform_device_register(&cpmac_low);
+1 −1
Original line number Diff line number Diff line
@@ -274,7 +274,7 @@ static int __init bcm47xx_register_bus_complete(void)
	bcm47xx_leds_register();
	bcm47xx_workarounds();

	fixed_phy_add(PHY_POLL, 0, &bcm47xx_fixed_phy_status, -1);
	fixed_phy_add(PHY_POLL, 0, &bcm47xx_fixed_phy_status);
	return 0;
}
device_initcall(bcm47xx_register_bus_complete);
+1 −1
Original line number Diff line number Diff line
@@ -343,7 +343,7 @@ static int __init dsa_loop_init(void)
	unsigned int i;

	for (i = 0; i < NUM_FIXED_PHYS; i++)
		phydevs[i] = fixed_phy_register(PHY_POLL, &status, -1, NULL);
		phydevs[i] = fixed_phy_register(PHY_POLL, &status, NULL);

	return mdio_driver_register(&dsa_loop_drv);
}
Loading