linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: khali@linux-fr.org (Jean Delvare)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4] hwmon: Versatile Express hwmon driver
Date: Mon, 24 Sep 2012 14:08:40 +0200	[thread overview]
Message-ID: <20120924140840.70ddbbd7@endymion.delvare> (raw)
In-Reply-To: <1348488182.2530.13.camel@hornet>

On Mon, 24 Sep 2012 13:03:02 +0100, Pawel Moll wrote:
> On Fri, 2012-09-21 at 19:18 +0100, Guenter Roeck wrote:
> > On Fri, Sep 21, 2012 at 05:56:31PM +0100, Pawel Moll wrote:
> > > +
> > > +	err = sysfs_create_group(&pdev->dev.kobj, match->data);
> > > +	if (err)
> > > +		goto error;
> > 
> > You'll need a second label for that. Since the group was not created, you can
> > not delete it.
> 
> Actually I think I can... The sysfs_remove_group() effectively is a
> wrapper for sysfs_hash_and_remove() which acts like "rm -f" - does
> nothing if the file doesn't exist. Even drivers/hwmon/lm83.c (which, by
> pure coincidence, I was looking at when re-working this driver) does
> that in exit_remove_files...

You are right, and many hwmon drivers do exactly that, to limit the
number of labels. This is code which isn't executed when all is fine,
so we don't care about performance. Plus, in many cases the file
removals are unconditional in the remove function anyway.

> Anyway, it's nothing to argue about, so I'll change it and send
> (hopefully ;-) final version in a jiffy.

You can keep the code as is too, if you prefer.

-- 
Jean Delvare

  reply	other threads:[~2012-09-24 12:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21 16:56 [PATCH v4] hwmon: Versatile Express hwmon driver Pawel Moll
2012-09-21 18:18 ` Guenter Roeck
2012-09-24 12:03   ` Pawel Moll
2012-09-24 12:08     ` Jean Delvare [this message]
2012-09-24 12:28       ` Guenter Roeck
2012-09-24 15:59 ` Guenter Roeck
2012-09-24 16:09   ` Pawel Moll
2012-09-24 17:18     ` Guenter Roeck
2012-09-24 17:24       ` Pawel Moll

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=20120924140840.70ddbbd7@endymion.delvare \
    --to=khali@linux-fr.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).