[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200625194211.GA535869@lunn.ch>
Date: Thu, 25 Jun 2020 21:42:11 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Calvin Johnson <calvin.johnson@....nxp.com>
Cc: Jeremy Linton <jeremy.linton@....com>,
Russell King - ARM Linux admin <linux@...linux.org.uk>,
Jon <jon@...id-run.com>,
Cristi Sovaiala <cristian.sovaiala@....com>,
Ioana Ciornei <ioana.ciornei@....com>,
Andy Shevchenko <andy.shevchenko@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Madalin Bucur <madalin.bucur@....nxp.com>,
linux-acpi@...r.kernel.org, linux.cj@...il.com,
netdev@...r.kernel.org
Subject: Re: [net-next PATCH v1] net: dpaa2-mac: Add ACPI support for DPAA2
MAC driver
On Thu, Jun 25, 2020 at 10:05:38AM +0530, Calvin Johnson wrote:
> +static struct phy_device *dpaa2_find_phy_device(struct fwnode_handle *fwnode)
> +{
> + struct fwnode_reference_args args;
> + struct platform_device *pdev;
> + struct mii_bus *mdio;
> + struct device *dev;
> + acpi_status status;
> + int addr;
> + int err;
> +
> + status = acpi_node_get_property_reference(fwnode, "mdio-handle",
> + 0, &args);
> +
> + if (ACPI_FAILURE(status) || !is_acpi_device_node(args.fwnode))
> + return NULL;
> +
> + dev = bus_find_device_by_fwnode(&platform_bus_type, args.fwnode);
> + if (IS_ERR_OR_NULL(dev))
> + return NULL;
> + pdev = to_platform_device(dev);
> + mdio = platform_get_drvdata(pdev);
> +
> + err = fwnode_property_read_u32(fwnode, "phy-channel", &addr);
> + if (err < 0 || addr < 0 || addr >= PHY_MAX_ADDR)
> + return NULL;
> +
> + return mdiobus_get_phy(mdio, addr);
> +}
Hi Calvin
I think this needs putting somewhere global, since you are effectively
defines how all ACPI MACs will find their PHY. This becomes the
defacto standard until the ACPI standards committee comes along and
tells you, you are doing it wrong, it should be like....
Does Linux have a location to document all its defacto standard ACPI
stuff? It would be good to document this somewhere.
Andrew
Powered by blists - more mailing lists