lkml.org 
[lkml]   [2013]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/9] hwmon: Introduce hwmon_device_register_with_groups
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?

thanks,

greg k-h


\
 
 \ /
  Last update: 2013-09-01 18:41    [W:0.174 / U:1.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site