From: Alan Jenkins <sourcejedi.lkml@googlemail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>, linux-acpi@vger.kernel.org
Subject: Re: assumptions in acpi drivers
Date: Fri, 16 Oct 2009 10:13:10 +0100 [thread overview]
Message-ID: <9b2b86520910160213o2cdbed8j8f4ef9f3ba47ad6f@mail.gmail.com> (raw)
In-Reply-To: <20091016043609.GA11582@core.coreip.homeip.net>
On 10/16/09, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> On Sun, Oct 11, 2009 at 10:07:32PM -0600, Bjorn Helgaas wrote:
>> Ooh, you're right, using atomic_inc_return() is much better. I don't
>> know whether it needs to be thread-safe or not, but it doesn't hurt, and
>> it's nicer in the sense that it doesn't leave the singleton pointer
>> lying around where people would be tempted to use it instead of using
>> acpi_driver_data(device).
>
> A small note: while it might not be an issue for ACPI in general drivers
> can be detached from devices via sysfs bind/unbind attributes and so if
> using this singleton model xxx_remove() should take care of decrementing
> the counter and xxx_add() should do the same in error path.
I'm sure it does apply to ACPI drivers. I'll make sure I do that, thanks!
Alan
prev parent reply other threads:[~2009-10-16 9:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-10 13:16 assumptions in acpi drivers Alan Jenkins
2009-10-10 14:39 ` Bjorn Helgaas
2009-10-11 13:39 ` Alan Jenkins
2009-10-12 4:07 ` Bjorn Helgaas
2009-10-16 4:36 ` Dmitry Torokhov
2009-10-16 9:13 ` Alan Jenkins [this message]
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=9b2b86520910160213o2cdbed8j8f4ef9f3ba47ad6f@mail.gmail.com \
--to=sourcejedi.lkml@googlemail.com \
--cc=bjorn.helgaas@hp.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-acpi@vger.kernel.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