base-files: define yes/no as valid boolean options
[openwrt/staging/wigyori.git] / target / linux / mvebu / patches-3.10 / 0081-net-phy-call-mdiobus_scan-after-adding-a-fixed-PHY.patch
1 From dce33dc5a6ba5f7fcbab4d7e92cc68c756a1f714 Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Mon, 15 Jul 2013 17:34:09 +0200
4 Subject: [PATCH 081/203] net: phy: call mdiobus_scan() after adding a fixed
5 PHY
6
7 The fixed_phy_add() function allows to register a fixed PHY. However,
8 when this function gets called *after* fixed_mdio_bus_init() (which
9 gets called at the module_init stage), then the fixed PHY is not
10 registered into the phylib.
11
12 In order to address this, we add a call to mdiobus_scan() in
13 fixed_phy_add() to ensure that the PHY indeed gets registered into the
14 phylib, even if the fixed_phy_add() is called after
15 fixed_mdio_bus_init().
16
17 This is needed because until now, the only code that was calling the
18 fixed_add_phy() function was PowerPC-specific platform code, which
19 could ensure that such fixed PHYs get registered before
20 fixed_mdio_bus_init() is called.
21
22 However, with the new of_phy_register_fixed_link() function, device
23 drivers can parse their 'fixed-link' property and register a fixed PHY
24 at ->probe() time, which may happen after fixed_mdio_bus_init() is
25 called.
26
27 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
28 ---
29 drivers/net/phy/fixed.c | 2 ++
30 1 file changed, 2 insertions(+)
31
32 --- a/drivers/net/phy/fixed.c
33 +++ b/drivers/net/phy/fixed.c
34 @@ -195,6 +195,8 @@ int fixed_phy_add(unsigned int irq, int
35
36 list_add_tail(&fp->node, &fmb->phys);
37
38 + mdiobus_scan(fmb->mii_bus, phy_id);
39 +
40 return 0;
41
42 err_regs: