aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/smartreflex.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/smartreflex.c')
-rw-r--r--arch/arm/mach-omap2/smartreflex.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index 13e24f913dd4..fb7dc52394a8 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -847,6 +847,14 @@ static int __init omap_sr_probe(struct platform_device *pdev)
847 goto err_free_devinfo; 847 goto err_free_devinfo;
848 } 848 }
849 849
850 mem = request_mem_region(mem->start, resource_size(mem),
851 dev_name(&pdev->dev));
852 if (!mem) {
853 dev_err(&pdev->dev, "%s: no mem region\n", __func__);
854 ret = -EBUSY;
855 goto err_free_devinfo;
856 }
857
850 irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 858 irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
851 859
852 pm_runtime_enable(&pdev->dev); 860 pm_runtime_enable(&pdev->dev);
@@ -883,7 +891,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
883 ret = sr_late_init(sr_info); 891 ret = sr_late_init(sr_info);
884 if (ret) { 892 if (ret) {
885 pr_warning("%s: Error in SR late init\n", __func__); 893 pr_warning("%s: Error in SR late init\n", __func__);
886 goto err_release_region; 894 return ret;
887 } 895 }
888 } 896 }
889 897
@@ -896,7 +904,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
896 vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm); 904 vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm);
897 if (!vdd_dbg_dir) { 905 if (!vdd_dbg_dir) {
898 ret = -EINVAL; 906 ret = -EINVAL;
899 goto err_release_region; 907 goto err_iounmap;
900 } 908 }
901 909
902 sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir); 910 sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
@@ -904,7 +912,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
904 dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n", 912 dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
905 __func__); 913 __func__);
906 ret = PTR_ERR(sr_info->dbg_dir); 914 ret = PTR_ERR(sr_info->dbg_dir);
907 goto err_release_region; 915 goto err_iounmap;
908 } 916 }
909 917
910 (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, 918 (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR,
@@ -921,7 +929,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
921 dev_err(&pdev->dev, "%s: Unable to create debugfs directory" 929 dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
922 "for n-values\n", __func__); 930 "for n-values\n", __func__);
923 ret = PTR_ERR(nvalue_dir); 931 ret = PTR_ERR(nvalue_dir);
924 goto err_release_region; 932 goto err_debugfs;
925 } 933 }
926 934
927 omap_voltage_get_volttable(sr_info->voltdm, &volt_data); 935 omap_voltage_get_volttable(sr_info->voltdm, &volt_data);
@@ -931,7 +939,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
931 "entries for n-values\n", 939 "entries for n-values\n",
932 __func__, sr_info->voltdm->name); 940 __func__, sr_info->voltdm->name);
933 ret = -ENODATA; 941 ret = -ENODATA;
934 goto err_release_region; 942 goto err_debugfs;
935 } 943 }
936 944
937 for (i = 0; i < sr_info->nvalue_count; i++) { 945 for (i = 0; i < sr_info->nvalue_count; i++) {
@@ -945,6 +953,11 @@ static int __init omap_sr_probe(struct platform_device *pdev)
945 953
946 return ret; 954 return ret;
947 955
956err_debugfs:
957 debugfs_remove_recursive(sr_info->dbg_dir);
958err_iounmap:
959 list_del(&sr_info->node);
960 iounmap(sr_info->base);
948err_release_region: 961err_release_region:
949 release_mem_region(mem->start, resource_size(mem)); 962 release_mem_region(mem->start, resource_size(mem));
950err_free_devinfo: 963err_free_devinfo: