mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lars Poeschel <poeschel@lemonage.de>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Lars Poeschel <larsi@wh2.tu-dresden.de>,
	thierry.reding@avionic-design.de, rob@landley.net,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH RFC] pwm: add sysfs interface
Date: Tue, 5 Mar 2013 15:46:13 +0100	[thread overview]
Message-ID: <201303051546.13636.poeschel@lemonage.de> (raw)
In-Reply-To: <20130225040025.GB7911@kroah.com>

At first: Thanks for your review!

On Monday 25 February 2013 at 05:00:25, Greg KH wrote:
> On Tue, Feb 19, 2013 at 03:27:41PM +0100, Lars Poeschel wrote:
> > +static int pwmchip_export(struct pwm_chip *chip)
> > +{
> > +	int status;
> > +	struct device *dev;
> > +
> > +	mutex_lock(&sysfs_lock);
> > +	dev = device_create(&pwm_class, chip->dev, MKDEV(0, 0), chip,
> > +				"pwmchip%d", chip->base);
> > +	if (!IS_ERR(dev))
> > +		status = sysfs_create_group(&dev->kobj, &pwmchip_attr_group);
> > +	else
> > +		status = PTR_ERR(dev);
> 
> You can't create sysfs files after the device has been exposed to
> userspace.  Please use the default group functionality for the class,
> which fixes this problem.

I don't understand, what is wrong here. This is the same that gpio sysfs 
does. Could you please be a bit more specific ?
I create a new device using device_create and create a new group with it with 
some attributes. Isn't it exposed to userspace after that ?
Or am I not allowed to use pwm_class on device creation ? What to use then ?
What do you mean by default group functionality for the class ? I want to use 
my own "pwm" class ? Don't I ?

Regards,
Lars

  reply	other threads:[~2013-03-05 14:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-19 14:27 Lars Poeschel
2013-02-24  0:14 ` Rob Landley
2013-03-04 17:38   ` Lars Poeschel
2013-02-25  3:58 ` Greg KH
2013-02-25  4:00 ` Greg KH
2013-03-05 14:46   ` Lars Poeschel [this message]
2013-03-05 21:34     ` Greg KH

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=201303051546.13636.poeschel@lemonage.de \
    --to=poeschel@lemonage.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=larsi@wh2.tu-dresden.de \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob@landley.net \
    --cc=thierry.reding@avionic-design.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

Powered by JetHome