Message ID | 20201215164315.3666-10-calvin.johnson@oss.nxp.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | ACPI support for dpaa2 driver | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net-next |
netdev/subject_prefix | success | Link |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 1 this patch: 1 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 43 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 1 this patch: 1 |
netdev/header_inline | success | Link |
netdev/stable | success | Stable not CCed |
On Tue, Dec 15, 2020 at 6:44 PM Calvin Johnson <calvin.johnson@oss.nxp.com> wrote: > > fwnode_mdiobus_register() internally takes care of both DT > and ACPI cases to register mdiobus. Replace existing > of_mdiobus_register() with fwnode_mdiobus_register(). > > Note: For both ACPI and DT cases, endianness of MDIO controller > need to be specified using "little-endian" property. ... > @@ -2,6 +2,7 @@ > * QorIQ 10G MDIO Controller > * > * Copyright 2012 Freescale Semiconductor, Inc. > + * Copyright 2020 NXP > * > * Authors: Andy Fleming <afleming@freescale.com> > * Timur Tabi <timur@freescale.com> > @@ -11,6 +12,7 @@ I guess this... > priv->is_little_endian = device_property_read_bool(&pdev->dev, > "little-endian"); > - > priv->has_a011043 = device_property_read_bool(&pdev->dev, > "fsl,erratum-a011043"); ...this... > - ...and this changes can go to a separate patch.
On Tue, Dec 15, 2020 at 07:55:01PM +0200, Andy Shevchenko wrote: > On Tue, Dec 15, 2020 at 6:44 PM Calvin Johnson > <calvin.johnson@oss.nxp.com> wrote: > > > > fwnode_mdiobus_register() internally takes care of both DT > > and ACPI cases to register mdiobus. Replace existing > > of_mdiobus_register() with fwnode_mdiobus_register(). > > > > Note: For both ACPI and DT cases, endianness of MDIO controller > > need to be specified using "little-endian" property. > > ... > > > @@ -2,6 +2,7 @@ > > * QorIQ 10G MDIO Controller > > * > > * Copyright 2012 Freescale Semiconductor, Inc. > > + * Copyright 2020 NXP > > * > > * Authors: Andy Fleming <afleming@freescale.com> > > * Timur Tabi <timur@freescale.com> > > @@ -11,6 +12,7 @@ > > I guess this... > > > priv->is_little_endian = device_property_read_bool(&pdev->dev, > > "little-endian"); > > - > > priv->has_a011043 = device_property_read_bool(&pdev->dev, > > "fsl,erratum-a011043"); > > ...this... > > > - > > ...and this changes can go to a separate patch. I think I'll remove the unnecessary cleanup. Regards Calvin
diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c index bfa2826c5545..ae2593abac96 100644 --- a/drivers/net/ethernet/freescale/xgmac_mdio.c +++ b/drivers/net/ethernet/freescale/xgmac_mdio.c @@ -2,6 +2,7 @@ * QorIQ 10G MDIO Controller * * Copyright 2012 Freescale Semiconductor, Inc. + * Copyright 2020 NXP * * Authors: Andy Fleming <afleming@freescale.com> * Timur Tabi <timur@freescale.com> @@ -11,6 +12,7 @@ * kind, whether express or implied. */ +#include <linux/acpi.h> #include <linux/kernel.h> #include <linux/slab.h> #include <linux/interrupt.h> @@ -243,10 +245,9 @@ static int xgmac_mdio_read(struct mii_bus *bus, int phy_id, int regnum) static int xgmac_mdio_probe(struct platform_device *pdev) { - struct device_node *np = pdev->dev.of_node; - struct mii_bus *bus; - struct resource *res; struct mdio_fsl_priv *priv; + struct resource *res; + struct mii_bus *bus; int ret; /* In DPAA-1, MDIO is one of the many FMan sub-devices. The FMan @@ -279,13 +280,14 @@ static int xgmac_mdio_probe(struct platform_device *pdev) goto err_ioremap; } + /* For both ACPI and DT cases, endianness of MDIO controller + * need to be specified using "little-endian" property. + */ priv->is_little_endian = device_property_read_bool(&pdev->dev, "little-endian"); - priv->has_a011043 = device_property_read_bool(&pdev->dev, "fsl,erratum-a011043"); - - ret = of_mdiobus_register(bus, np); + ret = fwnode_mdiobus_register(bus, pdev->dev.fwnode); if (ret) { dev_err(&pdev->dev, "cannot register MDIO bus\n"); goto err_registration;
fwnode_mdiobus_register() internally takes care of both DT and ACPI cases to register mdiobus. Replace existing of_mdiobus_register() with fwnode_mdiobus_register(). Note: For both ACPI and DT cases, endianness of MDIO controller need to be specified using "little-endian" property. Signed-off-by: Calvin Johnson <calvin.johnson@oss.nxp.com> --- Changes in v2: None drivers/net/ethernet/freescale/xgmac_mdio.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)