Re: [PATCH v3 2/2] PM / devfreq: Add governor attribute flag for specifc sysfs nodes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/19/20 1:11 PM, Chanwoo Choi wrote:
> On 10/19/20 9:39 AM, Dmitry Osipenko wrote:
>> ...
>>> @@ -1361,6 +1373,9 @@ static ssize_t governor_store(struct device *dev, struct device_attribute *attr,
>>>  		goto out;
>>>  	}
>>>  
>>> +	remove_sysfs_files(df, df->governor);
>>> +	create_sysfs_files(df, governor);
>>> +
>>>  	prev_governor = df->governor;
>>>  	df->governor = governor;
>>>  	strncpy(df->governor_name, governor->name, DEVFREQ_NAME_LEN);
>>> @@ -1460,39 +1475,6 @@ static ssize_t target_freq_show(struct device *dev,
>>>  }
>>
>> The further code may revert df->governor to the prev_governor or set it
> 
> prev_governor is better. I'll change it.
> 
>> to NULL. The create_sysfs_files(df->governor) should be invoked at the

Also, when creating and removing the sysfs files, devfreq instance is needed
because of df->dev.kobj. So, *_sysfs_files need the two parameters.

>> very end of the governor_store() and only in a case of success.
> 
> OK. I'll add more exception handling code.
> 
> 


-- 
Best Regards,
Chanwoo Choi
Samsung Electronics



[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux