All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev <netdev@vger.kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Zoltan HERPAI <wigyori@uid0.hu>,
	Raylynn Knight <rayknight@me.com>
Subject: Re: [PATCH 3/3] net: ethernet: ixp4xx: Use OF MDIO bus registration
Date: Tue, 20 Apr 2021 10:44:16 +0200	[thread overview]
Message-ID: <CACRpkdb8L=V+=5XVSV_viC5dLcLPWH5s9ztuESXjyRBWJOu9iA@mail.gmail.com> (raw)
In-Reply-To: <YH4yqLn6llQdLVax@lunn.ch>

On Tue, Apr 20, 2021 at 3:47 AM Andrew Lunn <andrew@lunn.ch> wrote:

> > @@ -1381,25 +1382,12 @@ static struct eth_plat_info *ixp4xx_of_get_platdata(struct device *dev)
> >       /* NPE ID 0x00, 0x10, 0x20... */
> >       plat->npe = (val << 4);
> >
> > -     phy_np = of_parse_phandle(np, "phy-handle", 0);
> > -     if (phy_np) {
> > -             ret = of_property_read_u32(phy_np, "reg", &val);
> > -             if (ret) {
> > -                     dev_err(dev, "cannot find phy reg\n");
> > -                     return NULL;
> > -             }
> > -             of_node_put(phy_np);
> > -     } else {
> > -             dev_err(dev, "cannot find phy instance\n");
> > -             val = 0;
> > -     }
> > -     plat->phy = val;
> > -
>
> Isn't this code you just added in the previous patch?

Yep. It's by the token of "one technical step per patch" but I
suggested that maybe you prefer to take two technical
steps in one big patch, then we can just squash
patches 2 & 3. I'll fix it as you want it just tell me how :)

> > -     snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT,
> > -              mdio_bus->id, plat->phy);
> > -     phydev = phy_connect(ndev, phy_id, &ixp4xx_adjust_link,
> > -                          PHY_INTERFACE_MODE_MII);
> > +     if (np) {
> > +             phydev = of_phy_get_and_connect(ndev, np, ixp4xx_adjust_link);
> > +     } else {
> > +             snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT,
> > +                      mdio_bus->id, plat->phy);
>
> mdiobus_get_phy() and phy_connect_direct() might be better.

Do you mean for the legacy code path (else clause), or the
new code path with of_phy_get_and_connect() or both?

I tried not to change the legacy code in order to not introduce
regressions, so if I change that I suppose it should be a
separate patch.

On the other hand this driver has not been much maintained
the recent years so we might need to be a bit rough when
bringing it into shape. (After migrating all of IXP4xx to
device tree a lot of the legacy code will eventually be deleted.)

Yours,
Linus Walleij

  reply	other threads:[~2021-04-20  8:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19 22:51 [PATCH 1/3] net: ethernet: ixp4xx: Add DT bindings Linus Walleij
2021-04-19 22:51 ` [PATCH 2/3] net: ethernet: ixp4xx: Support device tree probing Linus Walleij
2021-04-20  1:35   ` Andrew Lunn
2021-04-20  8:38     ` Linus Walleij
2021-04-19 22:51 ` [PATCH 3/3] net: ethernet: ixp4xx: Use OF MDIO bus registration Linus Walleij
2021-04-19 22:54   ` Linus Walleij
2021-04-20  1:47   ` Andrew Lunn
2021-04-20  8:44     ` Linus Walleij [this message]
2021-04-20 12:53       ` Andrew Lunn
2021-04-20  1:26 ` [PATCH 1/3] net: ethernet: ixp4xx: Add DT bindings Andrew Lunn
2021-04-22 15:39   ` Linus Walleij
2021-04-22 15:56     ` Andrew Lunn
2021-04-22 17:33       ` Linus Walleij
2021-04-22 20:13         ` 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='CACRpkdb8L=V+=5XVSV_viC5dLcLPWH5s9ztuESXjyRBWJOu9iA@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rayknight@me.com \
    --cc=wigyori@uid0.hu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.