Skip to content

Commit 66d0e79

Browse files
Orson Zhaichanwoochoi
authored andcommitted
Revert "PM / devfreq: Modify the device name as devfreq(X) for sysfs"
This reverts commit 4585fbc. The name changing as devfreq(X) breaks some user space applications, such as Android HAL from Unisoc and Hikey [1]. The device name will be changed unexpectly after every boot depending on module init sequence. It will make trouble to setup some system configuration like selinux for Android. So we'd like to revert it back to old naming rule before any better way being found. [1] https://lkml.org/lkml/2018/5/8/1042 Cc: John Stultz <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: [email protected] Signed-off-by: Orson Zhai <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
1 parent f8788d8 commit 66d0e79

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/devfreq/devfreq.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,6 @@ struct devfreq *devfreq_add_device(struct device *dev,
738738
{
739739
struct devfreq *devfreq;
740740
struct devfreq_governor *governor;
741-
static atomic_t devfreq_no = ATOMIC_INIT(-1);
742741
int err = 0;
743742

744743
if (!dev || !profile || !governor_name) {
@@ -800,8 +799,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
800799
devfreq->suspend_freq = dev_pm_opp_get_suspend_opp_freq(dev);
801800
atomic_set(&devfreq->suspend_count, 0);
802801

803-
dev_set_name(&devfreq->dev, "devfreq%d",
804-
atomic_inc_return(&devfreq_no));
802+
dev_set_name(&devfreq->dev, "%s", dev_name(dev));
805803
err = device_register(&devfreq->dev);
806804
if (err) {
807805
mutex_unlock(&devfreq->lock);

0 commit comments

Comments
 (0)