Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1564635 > unrolled thread
| Started by | MyungJoo Ham <myungjoo.ham@samsung.com> |
|---|---|
| First post | 2017-01-23 03:20 +0100 |
| Last post | 2017-01-23 04:40 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
RE: [PATCH v3 4/4] PM / devfreq: Modify the device name as devfreq[X] for sysfs MyungJoo Ham <myungjoo.ham@samsung.com> - 2017-01-23 03:20 +0100
Re: [PATCH v3 4/4] PM / devfreq: Modify the device name as devfreq[X] for sysfs Chanwoo Choi <cw00.choi@samsung.com> - 2017-01-23 04:40 +0100
| From | MyungJoo Ham <myungjoo.ham@samsung.com> |
|---|---|
| Date | 2017-01-23 03:20 +0100 |
| Subject | RE: [PATCH v3 4/4] PM / devfreq: Modify the device name as devfreq[X] for sysfs |
| Message-ID | <t2CoF-pF-1@gated-at.bofh.it> |
[Multipart message — attachments visible in raw view] — view raw
> 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
[toc] | [next] | [standalone]
| From | Chanwoo Choi <cw00.choi@samsung.com> |
|---|---|
| Date | 2017-01-23 04:40 +0100 |
| Message-ID | <t2DE7-1bF-39@gated-at.bofh.it> |
| In reply to | #1564635 |
On 2017년 01월 23일 11:19, MyungJoo Ham wrote:
>> 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).
There is no any reason. I'll change to use the integer value as following:
dev_set_name(&devfreq->dev, "devfreq%d", atomic_inc_return(&devfreq_no));
>
>> err = device_register(&devfreq->dev);
>> if (err) {
>> mutex_unlock(&devfreq->lock);
>> --
>> 1.9.1
--
Best Regards,
Chanwoo Choi
S/W R&D Center
Samsung Electronics
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web