public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] phylib: reset mii bus only if reset handler is registered
Date: Thu, 22 Sep 2011 18:13:08 -0400	[thread overview]
Message-ID: <201109221813.10636.vapier@gentoo.org> (raw)
In-Reply-To: <CAKWjMd6-vNeBVQpSzOPpjwv4GrYAvBTczc9Z6FTcxrvmPd1dGA@mail.gmail.com>

On Thursday, September 22, 2011 17:44:11 Andy Fleming wrote:
> On Mon, Sep 5, 2011 at 12:24 PM, Vladimir Zapolskiy <vz@mleia.com> wrote:
> > This change allows to cope with a mii bus device registered using
> > miiphy_register(), which doesn't assign a default reset handler.
> > 
> > --- a/drivers/net/phy/phy.c
> > +++ b/drivers/net/phy/phy.c
> > @@ -692,7 +692,8 @@ struct phy_device *phy_connect(struct mii_dev *bus,
> > int addr, struct phy_device *phydev;
> > 
> >        /* Reset the bus */
> > -       bus->reset(bus);
> > +       if (bus->reset)
> > +               bus->reset(bus);
> 
> The change is a good idea, but I find the motivation for it strange.
> If you register a bus with miiphy_register, you are declaring your
> intent to use the legacy PHY interface. But phy_connect() is part of
> the new phylib API. It was not intended that combining the two work at
> all. Looking at the code, I see no reason it wouldn't work, but I
> question why you would do that, instead of creating a proper MDIO
> driver?

hmm, is there an #ifdef check we could add that would cause an #error if 
people mix the old and the new ?  i think it makes sense to just force 
everyone to migrate to the new ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110922/7f609d17/attachment.pgp 

  reply	other threads:[~2011-09-22 22:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-05 17:24 [U-Boot] [PATCH 0/2] phylib: a couple of minor fixes in generic phy library Vladimir Zapolskiy
2011-09-05 17:24 ` [U-Boot] [PATCH 1/2] phylib: reset mii bus only if reset handler is registered Vladimir Zapolskiy
2011-09-09 13:27   ` Detlev Zundel
2011-09-09 22:08   ` Wolfgang Denk
2011-09-22 21:44   ` Andy Fleming
2011-09-22 22:13     ` Mike Frysinger [this message]
2011-09-22 22:19       ` Andy Fleming
2011-09-05 17:24 ` [U-Boot] [PATCH 2/2] phylib: remove a couple of redundant code lines Vladimir Zapolskiy
2011-09-09 12:18   ` Detlev Zundel
2011-09-09 22:08   ` Wolfgang Denk
2011-09-22 21:25   ` Andy Fleming
2011-09-23  6:06     ` Wolfgang Denk
2011-09-26 19:24       ` Vladimir Zapolskiy
2011-09-28 19:05   ` Wolfgang Denk

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=201109221813.10636.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=u-boot@lists.denx.de \
    /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