提交 58a7295b 编写于 作者: T Tobias Klauser 提交者: Dave Jones

[CPUFREQ] Fix sysfs_create_file return value handling

Commit 0a4b2ccc in cpufreq.git
eliminates the build warnings but does not pass on the error code of
sysfs_create_file to the function calling cpufreq_add_dev. Instead some
previous value of ret would be returned.
Signed-off-by: NTobias Klauser <tklauser@distanz.ch>
Signed-off-by: NDave Jones <davej@redhat.com>
上级 ea487615
......@@ -826,16 +826,19 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
/* set up files for this cpu device */
drv_attr = cpufreq_driver->attr;
while ((drv_attr) && (*drv_attr)) {
if (sysfs_create_file(&policy->kobj, &((*drv_attr)->attr)))
ret = sysfs_create_file(&policy->kobj, &((*drv_attr)->attr));
if (ret)
goto err_out_driver_exit;
drv_attr++;
}
if (cpufreq_driver->get){
if (sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr))
ret = sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr);
if (ret)
goto err_out_driver_exit;
}
if (cpufreq_driver->target){
if (sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr))
ret = sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr);
if (ret)
goto err_out_driver_exit;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册