Re: [PATCH 4/4] cpuidle - support multiple drivers

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

 



On 09/29/2012 11:41 AM, Francesco Lavra wrote:
> Hi,

Hi Francesco,

thanks for reviewing the patch.

>>  static ssize_t show_current_driver(struct device *dev,
>>  				   struct device_attribute *attr,
>>  				   char *buf)
>>  {
>> -	ssize_t ret;
>> -	struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver();
>> +	struct cbarg cbarg = { .buf = buf };
> 
> cbarg.count should be initialized to 0.

Actually, with this initialization, all the fields will be initialized
to 0, except 'buf'.

Thanks
  -- Daniel

>> +	int ret;
>>  
>> -	spin_lock(&cpuidle_driver_lock);
>> -	if (cpuidle_driver)
>> -		ret = sprintf(buf, "%s\n", cpuidle_driver->name);
>> -	else
>> -		ret = sprintf(buf, "none\n");
>> -	spin_unlock(&cpuidle_driver_lock);
>> +	ret = cpuidle_for_each_driver(each_driver_cb, &cbarg);
>> +	if (ret < 0)
>> +		return ret;
>>  
>> -	return ret;
>> +	return cbarg.count;
>>  }
> 
> --
> Francesco


-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux