[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <425FFC3E-EAE1-4BE3-89CD-9A6363BBAFA7@freescale.com>
Date: Mon, 29 Sep 2008 17:45:01 -0500
From: Andy Fleming <afleming@...escale.com>
To: Lennert Buytenhek <buytenh@...tstofly.org>
Cc: netdev@...r.kernel.org, Byron Bradley <byron.bbradley@...il.com>,
Tim Ellis <tim.ellis@....com>, Imre Kaloz <kaloz@...nwrt.org>,
Nicolas Pitre <nico@....org>, Dirk Teurlings <dirk@...xia.nl>,
Peter van Valderen <p.v.valderen@...il.com>
Subject: Re: [PATCH 3/3] phylib: give mdio buses a device tree presence
On Sep 28, 2008, at 21:14, Lennert Buytenhek wrote:
> Introduce the mdio_bus class, and give each 'struct mii_bus' its own
> 'struct device', so that mii_bus objects are represented in the device
> tree and can be found by querying the device tree.
>
> Signed-off-by: Lennert Buytenhek <buytenh@...vell.com>
> ---
> drivers/net/phy/mdio_bus.c | 74 +++++++++++++++++++++++++++++++++++
> ++++++--
> include/linux/phy.h | 8 +++++
> 2 files changed, 78 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
> index d206691..f9c27ac 100644
> --- a/drivers/net/phy/mdio_bus.c
> +++ b/drivers/net/phy/mdio_bus.c
> @@ -43,11 +43,35 @@
> */
> struct mii_bus *mdiobus_alloc(void)
> {
> - return kzalloc(sizeof(struct mii_bus), GFP_KERNEL);
> + struct mii_bus *bus;
> +
> + bus = kzalloc(sizeof(*bus), GFP_KERNEL);
> + if (bus != NULL)
> + bus->state = MDIOBUS_ALLOCATED;
> +
> + return bus;
> }
> EXPORT_SYMBOL(mdiobus_alloc);
Do we really need all this state tracking? Doesn't the device layer
do this for us? I looked through other driver subsystems, and I
didn't see anything like this. Can we rearchitect this so that we're
not having to track allocation/registration state?
Andy
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists