From: Andrew Lunn <andrew@lunn.ch>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Varun Sethi <V.Sethi@nxp.com>,
Florian Fainelli <f.fainelli@gmail.com>,
"Rajesh V . Bikkina" <rajesh.bikkina@nxp.com>,
Madalin Bucur <madalin.bucur@oss.nxp.com>,
netdev@vger.kernel.org, Pankaj Bansal <pankaj.bansal@nxp.com>,
linux-kernel@vger.kernel.org,
Calvin Johnson <calvin.johnson@oss.nxp.com>,
Marcin Wojtas <mw@semihalf.com>,
Diana Madalina Craciun <diana.craciun@nxp.com>,
linux-acpi@vger.kernel.org,
Andy Shevchenko <andy.shevchenko@gmail.com>,
Cristi Sovaiala <cristian.sovaiala@nxp.com>,
Jeremy Linton <jeremy.linton@arm.com>,
linux.cj@gmail.com, Ioana Ciornei <ioana.ciornei@nxp.com>,
Laurentiu Tudor <laurentiu.tudor@nxp.com>,
Makarand Pawagi <makarand.pawagi@nxp.com>,
"David S. Miller" <davem@davemloft.net>,
linux-arm-kernel@lists.infradead.org,
Florin Laurentiu Chiculita <florinlaurentiu.chiculita@nxp.com>
Subject: Re: [RFC net-next PATCH v2 1/2] net/fsl: add ACPI support for mdio bus
Date: Sat, 18 Apr 2020 16:39:03 +0200 [thread overview]
Message-ID: <20200418143903.GF804711@lunn.ch> (raw)
In-Reply-To: <20200418114116.GU25745@shell.armlinux.org.uk>
> > +static int xgmac_mdiobus_register_phy(struct mii_bus *bus,
> > + struct fwnode_handle *child, u32 addr)
> > +{
> > + struct phy_device *phy;
> > + bool is_c45 = false;
> > + int rc;
> > + const char *cp;
> > + u32 phy_id;
> > +
> > + fwnode_property_read_string(child, "compatible", &cp);
> > + if (!strcmp(cp, "ethernet-phy-ieee802.3-c45"))
> > + is_c45 = true;
> > +
> > + if (!is_c45 && !xgmac_get_phy_id(child, &phy_id))
> > + phy = phy_device_create(bus, addr, phy_id, 0, NULL);
> > + else
> > + phy = get_phy_device(bus, addr, is_c45);
> > + if (IS_ERR(phy))
> > + return PTR_ERR(phy);
> > +
> > + phy->irq = bus->irq[addr];
> > +
> > + /* Associate the fwnode with the device structure so it
> > + * can be looked up later.
> > + */
> > + phy->mdio.dev.fwnode = child;
> > +
> > + /* All data is now stored in the phy struct, so register it */
> > + rc = phy_device_register(phy);
> > + if (rc) {
> > + phy_device_free(phy);
> > + fwnode_handle_put(child);
> > + return rc;
> > + }
> > +
> > + dev_dbg(&bus->dev, "registered phy at address %i\n", addr);
> > +
> > + return 0;
>
> You seem to be duplicating the OF implementation in a private driver,
> converting it to fwnode. This is not how we develop the Linux kernel.
> We fix subsystem problems by fixing the subsystems, not by throwing
> what should be subsystem code into private drivers.
And i think a similar comment was given for v1, but i could be
remembering wrongly.
Andrew
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-04-18 14:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-18 10:54 [RFC net-next PATCH v2 0/2] ACPI support for xgmac_mdio and dpaa2-mac drivers Calvin Johnson
2020-04-18 10:54 ` [RFC net-next PATCH v2 1/2] net/fsl: add ACPI support for mdio bus Calvin Johnson
2020-04-18 11:41 ` Russell King - ARM Linux admin
2020-04-18 11:50 ` Andy Shevchenko
2020-04-18 14:39 ` Andrew Lunn [this message]
2020-04-20 15:42 ` Calvin Johnson
2020-04-18 14:46 ` Andrew Lunn
2020-04-20 15:44 ` Calvin Johnson
2020-04-18 10:54 ` [RFC net-next PATCH v2 2/2] net: dpaa2-mac: Add ACPI support for DPAA2 MAC driver Calvin Johnson
2020-04-18 11:38 ` Russell King - ARM Linux admin
2020-04-20 13:53 ` Calvin Johnson
2020-04-18 15:00 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200418143903.GF804711@lunn.ch \
--to=andrew@lunn.ch \
--cc=V.Sethi@nxp.com \
--cc=andy.shevchenko@gmail.com \
--cc=calvin.johnson@oss.nxp.com \
--cc=cristian.sovaiala@nxp.com \
--cc=davem@davemloft.net \
--cc=diana.craciun@nxp.com \
--cc=f.fainelli@gmail.com \
--cc=florinlaurentiu.chiculita@nxp.com \
--cc=ioana.ciornei@nxp.com \
--cc=jeremy.linton@arm.com \
--cc=laurentiu.tudor@nxp.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux.cj@gmail.com \
--cc=linux@armlinux.org.uk \
--cc=madalin.bucur@oss.nxp.com \
--cc=makarand.pawagi@nxp.com \
--cc=mw@semihalf.com \
--cc=netdev@vger.kernel.org \
--cc=pankaj.bansal@nxp.com \
--cc=rajesh.bikkina@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).