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: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Bu işleme şunda yer alıyor:

işlemeyi yapan:
David S. Miller

ebeveyn
fc9c5a4a5a
işleme
5468e82f70
@@ -16,7 +16,6 @@
|
||||
#include <linux/phy.h>
|
||||
#include <linux/phy_fixed.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_gpio.h>
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/of_mdio.h>
|
||||
#include <linux/of_net.h>
|
||||
@@ -463,7 +462,6 @@ int of_phy_register_fixed_link(struct device_node *np)
|
||||
struct device_node *fixed_link_node;
|
||||
u32 fixed_link_prop[5];
|
||||
const char *managed;
|
||||
int link_gpio = -1;
|
||||
|
||||
if (of_property_read_string(np, "managed", &managed) == 0 &&
|
||||
strcmp(managed, "in-band-status") == 0) {
|
||||
@@ -485,11 +483,7 @@ int of_phy_register_fixed_link(struct device_node *np)
|
||||
status.pause = of_property_read_bool(fixed_link_node, "pause");
|
||||
status.asym_pause = of_property_read_bool(fixed_link_node,
|
||||
"asym-pause");
|
||||
link_gpio = of_get_named_gpio_flags(fixed_link_node,
|
||||
"link-gpios", 0, NULL);
|
||||
of_node_put(fixed_link_node);
|
||||
if (link_gpio == -EPROBE_DEFER)
|
||||
return -EPROBE_DEFER;
|
||||
|
||||
goto register_phy;
|
||||
}
|
||||
@@ -508,8 +502,7 @@ int of_phy_register_fixed_link(struct device_node *np)
|
||||
return -ENODEV;
|
||||
|
||||
register_phy:
|
||||
return PTR_ERR_OR_ZERO(fixed_phy_register(PHY_POLL, &status, link_gpio,
|
||||
np));
|
||||
return PTR_ERR_OR_ZERO(fixed_phy_register(PHY_POLL, &status, np));
|
||||
}
|
||||
EXPORT_SYMBOL(of_phy_register_fixed_link);
|
||||
|
||||
|
Yeni konuda referans
Bir kullanıcı engelle