aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/smartreflex.c
diff options
context:
space:
mode:
authorAnand S Sawant <sawant@ti.com>2011-02-17 10:57:30 -0500
committerKevin Hilman <khilman@ti.com>2011-03-09 19:38:37 -0500
commitb1ace38094c4926255343a81faba8fb4faf59a45 (patch)
tree8756958fac9c5d9361273767aec409fdaa1e6960 /arch/arm/mach-omap2/smartreflex.c
parentdd31394779aa288eb6b9c42672ffcb6d05d6c414 (diff)
OMAP2+: smartreflex: remove SR debug directory in omap_sr_remove()
omap_sr_probe() creates the smartreflex debug directory and its underlying nvalue debug directory. These directories are removed in omap_sr_remove(). Basic smartreflex functionality tested on OMAP3630 Zoom3 & OMAP4430 SDP Signed-off-by: Anand S Sawant <sawant@ti.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/smartreflex.c')
-rw-r--r--arch/arm/mach-omap2/smartreflex.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index b57ae502e0c7..0ab4dd5081ee 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -54,6 +54,7 @@ struct omap_sr {
54 struct list_head node; 54 struct list_head node;
55 struct omap_sr_nvalue_table *nvalue_table; 55 struct omap_sr_nvalue_table *nvalue_table;
56 struct voltagedomain *voltdm; 56 struct voltagedomain *voltdm;
57 struct dentry *dbg_dir;
57}; 58};
58 59
59/* sr_list contains all the instances of smartreflex module */ 60/* sr_list contains all the instances of smartreflex module */
@@ -823,7 +824,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
823 struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL); 824 struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL);
824 struct omap_sr_data *pdata = pdev->dev.platform_data; 825 struct omap_sr_data *pdata = pdev->dev.platform_data;
825 struct resource *mem, *irq; 826 struct resource *mem, *irq;
826 struct dentry *vdd_dbg_dir, *dbg_dir, *nvalue_dir; 827 struct dentry *vdd_dbg_dir, *nvalue_dir;
827 struct omap_volt_data *volt_data; 828 struct omap_volt_data *volt_data;
828 int i, ret = 0; 829 int i, ret = 0;
829 830
@@ -898,24 +899,24 @@ static int __init omap_sr_probe(struct platform_device *pdev)
898 goto err_release_region; 899 goto err_release_region;
899 } 900 }
900 901
901 dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir); 902 sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
902 if (IS_ERR(dbg_dir)) { 903 if (IS_ERR(sr_info->dbg_dir)) {
903 dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n", 904 dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
904 __func__); 905 __func__);
905 ret = PTR_ERR(dbg_dir); 906 ret = PTR_ERR(sr_info->dbg_dir);
906 goto err_release_region; 907 goto err_release_region;
907 } 908 }
908 909
909 (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, dbg_dir, 910 (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR,
910 (void *)sr_info, &pm_sr_fops); 911 sr_info->dbg_dir, (void *)sr_info, &pm_sr_fops);
911 (void) debugfs_create_x32("errweight", S_IRUGO, dbg_dir, 912 (void) debugfs_create_x32("errweight", S_IRUGO, sr_info->dbg_dir,
912 &sr_info->err_weight); 913 &sr_info->err_weight);
913 (void) debugfs_create_x32("errmaxlimit", S_IRUGO, dbg_dir, 914 (void) debugfs_create_x32("errmaxlimit", S_IRUGO, sr_info->dbg_dir,
914 &sr_info->err_maxlimit); 915 &sr_info->err_maxlimit);
915 (void) debugfs_create_x32("errminlimit", S_IRUGO, dbg_dir, 916 (void) debugfs_create_x32("errminlimit", S_IRUGO, sr_info->dbg_dir,
916 &sr_info->err_minlimit); 917 &sr_info->err_minlimit);
917 918
918 nvalue_dir = debugfs_create_dir("nvalue", dbg_dir); 919 nvalue_dir = debugfs_create_dir("nvalue", sr_info->dbg_dir);
919 if (IS_ERR(nvalue_dir)) { 920 if (IS_ERR(nvalue_dir)) {
920 dev_err(&pdev->dev, "%s: Unable to create debugfs directory" 921 dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
921 "for n-values\n", __func__); 922 "for n-values\n", __func__);
@@ -972,6 +973,8 @@ static int __devexit omap_sr_remove(struct platform_device *pdev)
972 973
973 if (sr_info->autocomp_active) 974 if (sr_info->autocomp_active)
974 sr_stop_vddautocomp(sr_info); 975 sr_stop_vddautocomp(sr_info);
976 if (sr_info->dbg_dir)
977 debugfs_remove_recursive(sr_info->dbg_dir);
975 978
976 list_del(&sr_info->node); 979 list_del(&sr_info->node);
977 iounmap(sr_info->base); 980 iounmap(sr_info->base);