On 10/16/09, Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx> 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 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html