Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1564635

RE: [PATCH v3 4/4] PM / devfreq: Modify the device name as devfreq[X] for sysfs

From MyungJoo Ham <myungjoo.ham@samsung.com>
Newsgroups linux.kernel
Subject RE: [PATCH v3 4/4] PM / devfreq: Modify the device name as devfreq[X] for sysfs
Date 2017-01-23 03:20 +0100
Message-ID <t2CoF-pF-1@gated-at.bofh.it> (permalink)
References <t0eA9-jO-3@gated-at.bofh.it> <t0eA9-jO-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

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

csiph-web