Message ID | 20201023102632.740-1-cw00.choi@samsung.com |
---|---|
Headers | show |
Series | PM / devfreq: Add governor feature and attribute flag | expand |
23.10.2020 13:26, Chanwoo Choi пишет: > @@ -909,6 +915,8 @@ struct devfreq *devfreq_add_device(struct device *dev, > goto err_init; > } > > + create_sysfs_files(devfreq, governor); > + > devfreq->governor = governor; > err = devfreq->governor->event_handler(devfreq, DEVFREQ_GOV_START, > NULL); Shouldn't sysfs be created *after* GOV_START? This is inconsistent with governor_store().
23.10.2020 13:26, Chanwoo Choi пишет: > @@ -1401,8 +1423,13 @@ static ssize_t governor_store(struct device *dev, struct device_attribute *attr, > "%s: reverting to Governor %s failed (%d)\n", > __func__, df->governor_name, ret); > df->governor = NULL; > + goto out; > } ... > + create_sysfs_files(df, df->governor); > + goto out; These two lines could be removed. > } > + create_sysfs_files(df, df->governor); > + > out: > mutex_unlock(&devfreq_list_lock); Otherwise looks good to me. Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Tested-by: Dmitry Osipenko <digetx@gmail.com>
On 10/26/20 1:30 AM, Dmitry Osipenko wrote: > 23.10.2020 13:26, Chanwoo Choi пишет: >> @@ -909,6 +915,8 @@ struct devfreq *devfreq_add_device(struct device *dev, >> goto err_init; >> } >> >> + create_sysfs_files(devfreq, governor); >> + >> devfreq->governor = governor; >> err = devfreq->governor->event_handler(devfreq, DEVFREQ_GOV_START, >> NULL); > > Shouldn't sysfs be created *after* GOV_START? This is inconsistent with > governor_store(). > > Good point. Thanks for the review. I'll edit it.
On 10/26/20 1:31 AM, Dmitry Osipenko wrote: > 23.10.2020 13:26, Chanwoo Choi пишет: >> @@ -1401,8 +1423,13 @@ static ssize_t governor_store(struct device *dev, struct device_attribute *attr, >> "%s: reverting to Governor %s failed (%d)\n", >> __func__, df->governor_name, ret); >> df->governor = NULL; >> + goto out; >> } > ... >> + create_sysfs_files(df, df->governor); >> + goto out; > > These two lines could be removed. Right. These are redundant code. It is possible to support with just fallback style. > >> } >> + create_sysfs_files(df, df->governor); >> + >> out: >> mutex_unlock(&devfreq_list_lock); > > Otherwise looks good to me. > > Reviewed-by: Dmitry Osipenko <digetx@gmail.com> > Tested-by: Dmitry Osipenko <digetx@gmail.com> > > -- Best Regards, Chanwoo Choi Samsung Electronics