diff options
Diffstat (limited to 'arch/arm/mach-omap2/smartreflex.c')
-rw-r--r-- | arch/arm/mach-omap2/smartreflex.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index 34c01a7de810..bb606c9709b2 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c | |||
@@ -62,6 +62,7 @@ static LIST_HEAD(sr_list); | |||
62 | 62 | ||
63 | static struct omap_sr_class_data *sr_class; | 63 | static struct omap_sr_class_data *sr_class; |
64 | static struct omap_sr_pmic_data *sr_pmic_data; | 64 | static struct omap_sr_pmic_data *sr_pmic_data; |
65 | static struct dentry *sr_dbg_dir; | ||
65 | 66 | ||
66 | static inline void sr_write_reg(struct omap_sr *sr, unsigned offset, u32 value) | 67 | static inline void sr_write_reg(struct omap_sr *sr, unsigned offset, u32 value) |
67 | { | 68 | { |
@@ -826,9 +827,10 @@ static int __init omap_sr_probe(struct platform_device *pdev) | |||
826 | struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL); | 827 | struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL); |
827 | struct omap_sr_data *pdata = pdev->dev.platform_data; | 828 | struct omap_sr_data *pdata = pdev->dev.platform_data; |
828 | struct resource *mem, *irq; | 829 | struct resource *mem, *irq; |
829 | struct dentry *vdd_dbg_dir, *nvalue_dir; | 830 | struct dentry *nvalue_dir; |
830 | struct omap_volt_data *volt_data; | 831 | struct omap_volt_data *volt_data; |
831 | int i, ret = 0; | 832 | int i, ret = 0; |
833 | char *name; | ||
832 | 834 | ||
833 | if (!sr_info) { | 835 | if (!sr_info) { |
834 | dev_err(&pdev->dev, "%s: unable to allocate sr_info\n", | 836 | dev_err(&pdev->dev, "%s: unable to allocate sr_info\n", |
@@ -899,18 +901,25 @@ static int __init omap_sr_probe(struct platform_device *pdev) | |||
899 | } | 901 | } |
900 | 902 | ||
901 | dev_info(&pdev->dev, "%s: SmartReflex driver initialized\n", __func__); | 903 | dev_info(&pdev->dev, "%s: SmartReflex driver initialized\n", __func__); |
904 | if (!sr_dbg_dir) { | ||
905 | sr_dbg_dir = debugfs_create_dir("smartreflex", NULL); | ||
906 | if (!sr_dbg_dir) { | ||
907 | ret = PTR_ERR(sr_dbg_dir); | ||
908 | pr_err("%s:sr debugfs dir creation failed(%d)\n", | ||
909 | __func__, ret); | ||
910 | goto err_iounmap; | ||
911 | } | ||
912 | } | ||
902 | 913 | ||
903 | /* | 914 | name = kasprintf(GFP_KERNEL, "sr_%s", sr_info->voltdm->name); |
904 | * If the voltage domain debugfs directory is not created, do | 915 | if (!name) { |
905 | * not try to create rest of the debugfs entries. | 916 | dev_err(&pdev->dev, "%s: Unable to alloc debugfs name\n", |
906 | */ | 917 | __func__); |
907 | vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm); | 918 | ret = -ENOMEM; |
908 | if (!vdd_dbg_dir) { | ||
909 | ret = -EINVAL; | ||
910 | goto err_iounmap; | 919 | goto err_iounmap; |
911 | } | 920 | } |
912 | 921 | sr_info->dbg_dir = debugfs_create_dir(name, sr_dbg_dir); | |
913 | sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir); | 922 | kfree(name); |
914 | if (IS_ERR(sr_info->dbg_dir)) { | 923 | if (IS_ERR(sr_info->dbg_dir)) { |
915 | dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n", | 924 | dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n", |
916 | __func__); | 925 | __func__); |