Commit 077f8ec8 authored by Tony Lindgren's avatar Tony Lindgren

Merge branch 'for_2.6.38/pm-fixes' of...

Merge branch 'for_2.6.38/pm-fixes' of ssh://master.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into devel-fixes
parents 525a1138 b3329a33
...@@ -282,6 +282,7 @@ static int sr_late_init(struct omap_sr *sr_info) ...@@ -282,6 +282,7 @@ static int sr_late_init(struct omap_sr *sr_info)
dev_err(&sr_info->pdev->dev, "%s: ERROR in registering" dev_err(&sr_info->pdev->dev, "%s: ERROR in registering"
"interrupt handler. Smartreflex will" "interrupt handler. Smartreflex will"
"not function as desired\n", __func__); "not function as desired\n", __func__);
kfree(name);
kfree(sr_info); kfree(sr_info);
return ret; return ret;
} }
...@@ -879,7 +880,7 @@ static int __init omap_sr_probe(struct platform_device *pdev) ...@@ -879,7 +880,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
ret = sr_late_init(sr_info); ret = sr_late_init(sr_info);
if (ret) { if (ret) {
pr_warning("%s: Error in SR late init\n", __func__); pr_warning("%s: Error in SR late init\n", __func__);
return ret; goto err_release_region;
} }
} }
...@@ -890,14 +891,17 @@ static int __init omap_sr_probe(struct platform_device *pdev) ...@@ -890,14 +891,17 @@ static int __init omap_sr_probe(struct platform_device *pdev)
* not try to create rest of the debugfs entries. * not try to create rest of the debugfs entries.
*/ */
vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm); vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm);
if (!vdd_dbg_dir) if (!vdd_dbg_dir) {
return -EINVAL; ret = -EINVAL;
goto err_release_region;
}
dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir); dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
if (IS_ERR(dbg_dir)) { if (IS_ERR(dbg_dir)) {
dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n", dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
__func__); __func__);
return PTR_ERR(dbg_dir); ret = PTR_ERR(dbg_dir);
goto err_release_region;
} }
(void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, dbg_dir, (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, dbg_dir,
...@@ -913,7 +917,8 @@ static int __init omap_sr_probe(struct platform_device *pdev) ...@@ -913,7 +917,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)
if (IS_ERR(nvalue_dir)) { if (IS_ERR(nvalue_dir)) {
dev_err(&pdev->dev, "%s: Unable to create debugfs directory" dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
"for n-values\n", __func__); "for n-values\n", __func__);
return PTR_ERR(nvalue_dir); ret = PTR_ERR(nvalue_dir);
goto err_release_region;
} }
omap_voltage_get_volttable(sr_info->voltdm, &volt_data); omap_voltage_get_volttable(sr_info->voltdm, &volt_data);
...@@ -922,23 +927,15 @@ static int __init omap_sr_probe(struct platform_device *pdev) ...@@ -922,23 +927,15 @@ static int __init omap_sr_probe(struct platform_device *pdev)
" corresponding vdd vdd_%s. Cannot create debugfs" " corresponding vdd vdd_%s. Cannot create debugfs"
"entries for n-values\n", "entries for n-values\n",
__func__, sr_info->voltdm->name); __func__, sr_info->voltdm->name);
return -ENODATA; ret = -ENODATA;
goto err_release_region;
} }
for (i = 0; i < sr_info->nvalue_count; i++) { for (i = 0; i < sr_info->nvalue_count; i++) {
char *name; char name[NVALUE_NAME_LEN + 1];
char volt_name[32];
name = kzalloc(NVALUE_NAME_LEN + 1, GFP_KERNEL);
if (!name) {
dev_err(&pdev->dev, "%s: Unable to allocate memory"
" for n-value directory name\n", __func__);
return -ENOMEM;
}
strcpy(name, "volt_"); snprintf(name, sizeof(name), "volt_%d",
sprintf(volt_name, "%d", volt_data[i].volt_nominal); volt_data[i].volt_nominal);
strcat(name, volt_name);
(void) debugfs_create_x32(name, S_IRUGO | S_IWUSR, nvalue_dir, (void) debugfs_create_x32(name, S_IRUGO | S_IWUSR, nvalue_dir,
&(sr_info->nvalue_table[i].nvalue)); &(sr_info->nvalue_table[i].nvalue));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment