public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Roland Stigge <stigge@antcom.de>,
	grant.likely@secretlab.ca, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, w.sang@pengutronix.de,
	jbe@pengutronix.de, plagnioj@jcrosoft.com, highguy@gmail.com,
	broonie@opensource.wolfsonmicro.com, daniel-gl@gmx.net,
	rmallon@gmail.com
Subject: Re: [PATCH RFC 02/11 v4] gpio: Add sysfs support to block GPIO API
Date: Tue, 16 Oct 2012 10:40:38 -0700	[thread overview]
Message-ID: <20121016174038.GA17982@kroah.com> (raw)
In-Reply-To: <CACRpkdYaaSt9uLN2_=KXYDK2b5D5paopsYxgYKqezKCx8cy=vQ@mail.gmail.com>

On Tue, Oct 16, 2012 at 07:27:15PM +0200, Linus Walleij wrote:
> On Tue, Oct 16, 2012 at 6:43 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Tue, Oct 16, 2012 at 02:53:45PM +0200, Roland Stigge wrote:
> >>
> >> Further, current gpio and gpiochip devices are also doing this way:
> >> creating the device and subsequently their attrs, even though there may
> >> be a better way but I'm still wondering how this would be.
> >
> > Then the existing code is broken and should be fixed to use dev_attrs.
> > I guess it's time to audit the tree and find all places that get this
> > wrong...
> 
> The thing is, as I've tried to explain but maybe didn't get across,
> that these devices don't *have* a parent, and are not part of any
> tree.

You are passing in a parent device to the device_create() call, where
did that pointer come from?

Either way, the attribute creation needs to happen before we announce
the device to userspace, that's a bug that should be fixed now.

> They are parentless mock devices, created on-the-fly just to get
> sysfs entries.

That's fine, well, not the "parentless" part, but that should be trivial
to fix, just pass in the correct pointer and you should be fine.

> What is needed it to get the device model right in the first
> place.

I thought it was in the device model already?

> Fixing it has been drafted by me and Grant:
> https://blueprints.launchpad.net/linux-linaro/+spec/gpiochip-to-dev
> 
> This is not all-encompassing though :-/

That's a good list to work from, good luck :)

greg k-h

  reply	other threads:[~2012-10-16 17:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-15 23:31 [PATCH RFC 00/11 v4] gpio: Add block GPIO Roland Stigge
2012-10-15 23:31 ` [PATCH RFC 01/11 v4] gpio: Add a block GPIO API to gpiolib Roland Stigge
2012-10-16  0:18   ` Ryan Mallon
2012-10-15 23:31 ` [PATCH RFC 02/11 v4] gpio: Add sysfs support to block GPIO API Roland Stigge
2012-10-15 23:57   ` Greg KH
2012-10-16 12:53     ` Roland Stigge
2012-10-16 16:43       ` Greg KH
2012-10-16 17:27         ` Linus Walleij
2012-10-16 17:40           ` Greg KH [this message]
2012-10-16 21:08             ` Linus Walleij
2012-10-16 21:25               ` Greg KH
2012-10-17  8:39         ` Roland Stigge
2012-10-15 23:31 ` [PATCH RFC 03/11 v4] gpio: Add device tree " Roland Stigge
2012-10-15 23:31 ` [PATCH RFC 04/11 v4] gpio-max730x: Add " Roland Stigge
2012-10-15 23:31 ` [PATCH RFC 05/11 v4] gpio-lpc32xx: " Roland Stigge
2012-10-15 23:31 ` [PATCH RFC 06/11 v4] gpio-generic: " Roland Stigge
2012-10-15 23:31 ` [PATCH RFC 07/11 v4] gpio-pca953x: " Roland Stigge
2012-10-15 23:31 ` [PATCH RFC 08/11 v4] gpio-em: " Roland Stigge
2012-10-15 23:31 ` [PATCH RFC 09/11 v4] gpio-pl061: " Roland Stigge
2012-10-15 23:31 ` [PATCH RFC 10/11 v4] gpio-max732x: " Roland Stigge
2012-10-15 23:31 ` [PATCH RFC 11/11 v4] gpio-pcf857x: " Roland Stigge

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=20121016174038.GA17982@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=daniel-gl@gmx.net \
    --cc=grant.likely@secretlab.ca \
    --cc=highguy@gmail.com \
    --cc=jbe@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=plagnioj@jcrosoft.com \
    --cc=rmallon@gmail.com \
    --cc=stigge@antcom.de \
    --cc=w.sang@pengutronix.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