lkml.org 
[lkml]   [2017]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRE: [PATCH v3 4/4] PM / devfreq: Modify the device name as devfreq[X] for sysfs
From
Date
>  	if (!dev || !profile || !governor_name) {
> @@ -568,7 +569,8 @@ struct devfreq *devfreq_add_device(struct device *dev,
> mutex_lock(&devfreq->lock);
> }
>
> - dev_set_name(&devfreq->dev, "%s", dev_name(dev));
> + dev_set_name(&devfreq->dev, "devfreq%lu",
> + (unsigned long)atomic_inc_return(&devfreq_no));

Do you have any specific reason to use "unsigned long" here?
(atomic_t has 32bit int).

> err = device_register(&devfreq->dev);
> if (err) {
> mutex_unlock(&devfreq->lock);
> --
> 1.9.1
\
 
 \ /
  Last update: 2017-01-23 03:19    [W:0.065 / U:0.892 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site