From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/2] net phy: Add support for finding a mdio bus by its name
Date: Thu, 7 Feb 2013 19:29:51 +0100 [thread overview]
Message-ID: <20130207182951.GZ1906@pengutronix.de> (raw)
In-Reply-To: <20130207182347.GO19322@game.jcrosoft.org>
On Thu, Feb 07, 2013 at 07:23:47PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 18:43 Thu 07 Feb , Sascha Hauer wrote:
> > On Thu, Feb 07, 2013 at 05:05:35PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > On 13:46 Thu 07 Feb , Sascha Hauer wrote:
> > > > On Thu, Feb 07, 2013 at 01:26:13PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > > > On 13:20 Thu 07 Feb , Sascha Hauer wrote:
> > > > > > On Thu, Feb 07, 2013 at 01:02:06PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > > > > > On 12:09 Thu 07 Feb , Sascha Hauer wrote:
> > > > > > > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > > > > > > > ---
> > > > > > > > drivers/net/phy/mdio_bus.c | 19 +++++++++++++++++++
> > > > > > > > include/linux/phy.h | 3 +++
> > > > > > > > 2 files changed, 22 insertions(+)
> > > > > > > >
> > > > > > > > diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
> > > > > > > > index d1d802b..3c4be1c 100644
> > > > > > > > --- a/drivers/net/phy/mdio_bus.c
> > > > > > > > +++ b/drivers/net/phy/mdio_bus.c
> > > > > > > > @@ -25,6 +25,8 @@
> > > > > > > > #include <linux/phy.h>
> > > > > > > > #include <linux/err.h>
> > > > > > > >
> > > > > > > > +static LIST_HEAD(mii_bus_list);
> > > > > > > > +
> > > > > > > > /**
> > > > > > > > * mdiobus_register - bring up all the PHYs on a given bus and attach them to bus
> > > > > > > > * @bus: target mii_bus
> > > > > > > > @@ -57,6 +59,8 @@ int mdiobus_register(struct mii_bus *bus)
> > > > > > > > if (bus->reset)
> > > > > > > > bus->reset(bus);
> > > > > > > >
> > > > > > > > + list_add_tail(&bus->list, &mii_bus_list);
> > > > > > > > +
> > > > > > > > pr_info("%s: probed\n", dev_name(&bus->dev));
> > > > > > > > return 0;
> > > > > > > > }
> > > > > > > > @@ -71,9 +75,24 @@ void mdiobus_unregister(struct mii_bus *bus)
> > > > > > > > unregister_device(&bus->phy_map[i]->dev);
> > > > > > > > bus->phy_map[i] = NULL;
> > > > > > > > }
> > > > > > > > +
> > > > > > > > + list_del(&bus->list);
> > > > > > > > }
> > > > > > > > EXPORT_SYMBOL(mdiobus_unregister);
> > > > > > > >
> > > > > > > > +struct mii_bus *mdiobus_find(const char *name)
> > > > > > > > +{
> > > > > > > > + struct mii_bus *bus;
> > > > > > > > +
> > > > > > > > + list_for_each_entry(bus, &mii_bus_list, list) {
> > > > > > > no use bus_for_each
> > > > > >
> > > > > > That was my first try until I realized that not the mdio buses are
> > > > > > registered on the mdio_bus_type, but instead the phy devices.
> > > > > so add bus_type the list is already in the device_d so we jsut hav to populate
> > > > > it
> > > >
> > > > You want to put both the phys and the buses on mdio_bus_type? Or you
> > > > want to introduce a mdio_bus_bus_type?
> > > different
> >
> > different what?
> >
> > >
> > > I want to be able to use bus_for_each on each of them seperatly
> >
> > I have no idea what you are talking about.
>
> create a new bus_type for mdio
>
> so you can use bus_for_each
So a mdio_bus_bus_type. I already asked whether this is what you meant.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2013-02-07 18:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-07 11:09 [PATCH 1/2] net phy: Add support for finding a mdio bus by its name Sascha Hauer
2013-02-07 11:09 ` [PATCH 2/2] miitool: Add support for examing mdio bus Sascha Hauer
2013-02-07 12:02 ` [PATCH 1/2] net phy: Add support for finding a mdio bus by its name Jean-Christophe PLAGNIOL-VILLARD
2013-02-07 12:20 ` Sascha Hauer
2013-02-07 12:26 ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-07 12:46 ` Sascha Hauer
2013-02-07 16:05 ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-07 17:43 ` Sascha Hauer
2013-02-07 18:23 ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-07 18:29 ` Sascha Hauer [this message]
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=20130207182951.GZ1906@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=plagnioj@jcrosoft.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 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.