From: Guenter Roeck <linux@roeck-us.net>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jean Delvare <khali@linux-fr.org>,
lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/9] hwmon: Introduce hwmon_device_register_with_groups
Date: Sun, 01 Sep 2013 10:55:34 -0700 [thread overview]
Message-ID: <52237F96.2090008@roeck-us.net> (raw)
In-Reply-To: <20130901162441.GB32712@kroah.com>
On 09/01/2013 09:24 AM, Greg Kroah-Hartman wrote:
> This looks good, just one minor question about the
> non-driver-core-related code:
>
>> +struct device *
>> +hwmon_device_register_with_groups(struct device *dev, const char *name,
>> + void *drvdata,
>> + const struct attribute_group **groups)
>> {
>> - struct device *hwdev;
>> - int id;
>> + struct hwmon_device *hwdev;
>> + int err, id;
>>
>> id = ida_simple_get(&hwmon_ida, 0, 0, GFP_KERNEL);
>> if (id < 0)
>> return ERR_PTR(id);
>
> Don't you need a lock around the ida_simple_get call to ensure hwmon_ida
> is not being used at the same time twice? Or does the ida framework
> handle that ok?
>
ida_simple_get handles the locking as far as I can see. Other callers don't use
local locks either, so I guess it must be working.
Guenter
next prev parent reply other threads:[~2013-09-01 17:55 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-01 2:48 [PATCH v2 0/9] Introduce hwmon_device_register_with_groups and Guenter Roeck
2013-09-01 2:48 ` [PATCH v2 1/9] hwmon: Introduce hwmon_device_register_with_groups Guenter Roeck
2013-09-01 16:24 ` Greg Kroah-Hartman
2013-09-01 17:55 ` Guenter Roeck [this message]
2013-09-01 18:01 ` Greg Kroah-Hartman
2013-09-01 2:48 ` [PATCH v2 2/9] hwmon: (ds1621) Convert to use hwmon_device_register_with_groups Guenter Roeck
2013-09-01 2:48 ` [PATCH v2 3/9] hwmon: (gpio-fan) " Guenter Roeck
2013-09-01 2:48 ` [PATCH v2 4/9] hwmon: (ltc4245) " Guenter Roeck
2013-09-01 2:48 ` [PATCH v2 5/9] hwmon: (pmbus) " Guenter Roeck
2013-09-01 2:48 ` [PATCH v2 6/9] hwmon: (nct6775) " Guenter Roeck
2013-09-01 2:49 ` [PATCH v2 7/9] hwmon: Provide managed hwmon registration Guenter Roeck
2013-09-01 2:49 ` [PATCH v2 8/9] hwmon: (nct6775) Convert to use devm_hwmon_device_register_with_groups Guenter Roeck
2013-09-01 2:49 ` [PATCH v2 9/9] hwmon: (ds1621) " Guenter Roeck
2013-09-02 19:25 ` [PATCH v2 0/9] Introduce hwmon_device_register_with_groups and Guenter Roeck
2013-09-03 15:27 ` Guenter Roeck
2013-09-14 18:31 ` Jean Delvare
2013-09-14 19:16 ` Guenter Roeck
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=52237F96.2090008@roeck-us.net \
--to=linux@roeck-us.net \
--cc=gregkh@linuxfoundation.org \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lm-sensors@lm-sensors.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