[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20130215225514.8D54B3E15F8@localhost>
Date: Fri, 15 Feb 2013 22:55:14 +0000
From: Grant Likely <grant.likely@...retlab.ca>
To: Roland Stigge <stigge@...com.de>, gregkh@...uxfoundation.org,
linus.walleij@...aro.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, w.sang@...gutronix.de,
jbe@...gutronix.de, plagnioj@...osoft.com, highguy@...il.com,
broonie@...nsource.wolfsonmicro.com, daniel-gl@....net,
rmallon@...il.com, sr@...x.de, wg@...ndegger.com,
tru@...k-microwave.de, mark.rutland@....com
Cc: Roland Stigge <stigge@...com.de>
Subject: Re: [PATCH RESEND 4/6 v13] gpiolib: Fix default attributes for class
On Tue, 15 Jan 2013 12:51:54 +0100, Roland Stigge <stigge@...com.de> wrote:
> There is a race condition between creating a gpio or gpiochip device and adding
> default attributes. This patch fixes this by defining the default attributes as
> dev_attrs of the class. For this, it was necessary to create a separate
> gpiochip_class besides gpio_class.
>
> Signed-off-by: Roland Stigge <stigge@...com.de>
Hi Roland,
Yup, that's a bug. Thanks for looking at this. Unfortunately creating a
new class creates a new problem because it changes the userspace ABI
(the gpiochip simlinks move to a different class directory).
Instead, I think the correct solution here is to use (struct device *)->groups
to add attributes to a device. Unfortunately that means that
create_device() won't work anymore. It does some useful setup work
though that I don't want to have to reproduce. You could create a
variant that also allows groups to be set, or you could factor out the
allocation/setup stuff so we can do an allocate/fixup/register sequence.
g.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists