Re: [PATCH net-next v2 0/2] of: mdio: Fall back to mdiobus_register() with NULL device_node
From: Florian FainelliDate: Tue, 15 May 2018 16:56:17 -0700 > This patch series updates of_mdiobus_register() such that when the device_node > argument is NULL, it calls mdiobus_register() directly. This is consistent > with > the behavior of of_mdiobus_register() when CONFIG_OF=n. > > I only converted the most obvious drivers, there are others that have a much > less obvious behavior and specifically attempt to deal with CONFIG_ACPI. > > Changes in v2: > > - fixed build error in davincin_mdio.c (Grygorii) > - reworked first patch a bit: commit message, subject and removed useless > code comment Based upon Andrew's response to Geert's feedback, I'm applying this series. Thanks.
Re: [PATCH net-next v2 0/2] of: mdio: Fall back to mdiobus_register() with NULL device_node
On Wed, May 16, 2018 at 10:54:12AM +0200, Geert Uytterhoeven wrote: > Hi Florian, > > Thanks for your series! > I like the effect on simplifying drivers. > > On Wed, May 16, 2018 at 1:56 AM, Florian Fainelli> wrote: > > This patch series updates of_mdiobus_register() such that when the > > device_node > > argument is NULL, it calls mdiobus_register() directly. This is consistent > > with > > the behavior of of_mdiobus_register() when CONFIG_OF=n. > > IMHO the CONFIG_OF=n behavior of of_mdiobus_register() (which I wasn't > aware of) is inconsistent with the behavior of other of_*() functions, > which are just empty stubs. > > So I'm wondering if you should do it the other way around, and let > mdiobus_register() call of_mdiobus_register() if dev->of_node exists? Hi Geert dev->of_node is often not the correct OF node. The mdio properties are often embedded inside a MAC driver, and use an 'mdio' container node. This container node is needed, not the device node. > I haven't looked at the ACPI handling, but perhaps this can be moved > inside mdiobus_register() as well? The ACPI binding for MDIO and PHYs has not been defined yet. Andrew
Re: [PATCH net-next v2 0/2] of: mdio: Fall back to mdiobus_register() with NULL device_node
Hi Florian, Thanks for your series! I like the effect on simplifying drivers. On Wed, May 16, 2018 at 1:56 AM, Florian Fainelliwrote: > This patch series updates of_mdiobus_register() such that when the device_node > argument is NULL, it calls mdiobus_register() directly. This is consistent > with > the behavior of of_mdiobus_register() when CONFIG_OF=n. IMHO the CONFIG_OF=n behavior of of_mdiobus_register() (which I wasn't aware of) is inconsistent with the behavior of other of_*() functions, which are just empty stubs. So I'm wondering if you should do it the other way around, and let mdiobus_register() call of_mdiobus_register() if dev->of_node exists? This does mean mdiobus_register() should gain a struct device * parameter, and thus changes to many more drivers are needed. > I only converted the most obvious drivers, there are others that have a much > less obvious behavior and specifically attempt to deal with CONFIG_ACPI. I haven't looked at the ACPI handling, but perhaps this can be moved inside mdiobus_register() as well? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
[PATCH net-next v2 0/2] of: mdio: Fall back to mdiobus_register() with NULL device_node
Hi all, This patch series updates of_mdiobus_register() such that when the device_node argument is NULL, it calls mdiobus_register() directly. This is consistent with the behavior of of_mdiobus_register() when CONFIG_OF=n. I only converted the most obvious drivers, there are others that have a much less obvious behavior and specifically attempt to deal with CONFIG_ACPI. Changes in v2: - fixed build error in davincin_mdio.c (Grygorii) - reworked first patch a bit: commit message, subject and removed useless code comment Florian Fainelli (2): of: mdio: Fall back to mdiobus_register() with NULL device_node drivers: net: Remove device_node checks with of_mdiobus_register() drivers/net/dsa/bcm_sf2.c | 8 ++-- drivers/net/dsa/mv88e6xxx/chip.c | 5 + drivers/net/ethernet/cadence/macb_main.c | 12 +++- drivers/net/ethernet/freescale/fec_main.c | 8 ++-- drivers/net/ethernet/marvell/mvmdio.c | 5 + drivers/net/ethernet/renesas/sh_eth.c | 11 +++ drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 5 + drivers/net/ethernet/ti/davinci_mdio.c| 8 +++- drivers/net/phy/mdio-gpio.c | 6 +- drivers/net/phy/mdio-mscc-miim.c | 6 +- drivers/net/usb/lan78xx.c | 7 ++- drivers/of/of_mdio.c | 3 +++ 12 files changed, 23 insertions(+), 61 deletions(-) -- 2.14.1