From: NeilBrown <neilb@suse.de>
To: shuahkhan@gmail.com
Cc: rpurdie@rpsys.net, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] LEDS-One-Shot-Timer-Trigger-implementation
Date: Thu, 29 Mar 2012 08:11:09 +1100 [thread overview]
Message-ID: <20120329081109.5e8bbd59@notabene.brown> (raw)
In-Reply-To: <1332950949.2305.10.camel@lorien2>
[-- Attachment #1: Type: text/plain, Size: 2358 bytes --]
On Wed, 28 Mar 2012 10:09:09 -0600 Shuah Khan <shuahkhan@gmail.com> wrote:
> Neil,
>
> >
> > In general I approve of this - thanks for your efforts.
> >
> > However there are some details that need attention.
>
> Thanks.
> >
> > >
> > > This patch implements the one-shot-timer trigger support by enhancing the
> > > current led-class and ledtrig-timer drivers to support the following
> > > use-cases:
> > >
> > > use-case 1:
> > > echo one-shot-timer > /sys/class/leds/SOMELED/trigger
> >
> > I don't like the name "one-shot-timer". This name describes how you expect
> > the functionality to be used, but not what the actual difference between
> > "timer" and "one-shot-timer" is.
> > That difference is simply that one-shot-timer does not start an initial
> > default blink, while "timer" does.
> > So a name like "timer-no-default" would be a more accurate description and so
> > should be preferred.
>
> Yes, timer-no-default describes the enhancement I am making, better than
> one-shot-timer does. I will generate patch v2 to address your concerns
> and will change the name to timer-no-default and update the relevant
> code and documentation that goes with the patch to reflect the change.
Thanks.
>
> >
> > kstrtoul is currently preferred. It ensures uniform error codes.
> >
>
> Yes. I noticed the checkpatch.pl warnings. This change is better made as
> a separate patch. Do you mind if I deferred it and volunteer to fix it
> in a separate patch shortly. :)
A separate patch is certainly a good idea.
I would do the clean-up patches first, and then have the big change at the
end of the series. That way checkpatch won't complain about anything in your
change.
But you should do what you are most comfortable with.
>
> >
> > > +
> >
> > Do you need to led_trigger_unregister(&timer_led_trigger) if the registration
> > of one_shot_timer_led_trigger fails?
>
> Yes, considered that while I was changing this routine, and thought
> might be better to leave the registered timer alone when the second
> registration fails. I can go either way.
The important point is that if timer_trig_init fails, then timer_trig_exit
will never be called.
So when timer_trig_init fails, it must ensure that it has un-done any bits
that it successfully did.
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2012-03-28 21:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-27 15:21 [PATCH] LEDS-One-Shot-Timer-Trigger-implementation Shuah Khan
2012-03-27 23:45 ` NeilBrown
2012-03-28 16:09 ` Shuah Khan
2012-03-28 21:11 ` NeilBrown [this message]
2012-03-28 23:28 ` [PATCHv2] LEDS-One-Shot-Timer-Trigger-implementation Shuah Khan
2012-03-30 15:00 ` Shuah Khan
2012-03-30 20:07 ` NeilBrown
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=20120329081109.5e8bbd59@notabene.brown \
--to=neilb@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=rpurdie@rpsys.net \
--cc=shuahkhan@gmail.com \
/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