diff options
author | Jean Pihet <jean.pihet@newoldbits.com> | 2012-02-29 17:33:48 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2012-03-05 14:29:27 -0500 |
commit | 54b28cdfcd8ffc491733f97378ba5816385803fc (patch) | |
tree | c3b8d66f65af5219821db9834423c7030b956642 | |
parent | d617369219f136dc6e7923f573d826c7afb4b269 (diff) |
ARM: OMAP3+: SmartReflex: fix the use of debugfs_create_* API
The debugfs_create_* API returns a return code or NULL
in the return ptr in case of problem.
Fix the smartreflex code to take this into account.
Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
-rw-r--r-- | arch/arm/mach-omap2/smartreflex.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index daf8053741f7..f6b8f455685b 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c | |||
@@ -989,7 +989,7 @@ static int __init omap_sr_probe(struct platform_device *pdev) | |||
989 | dev_info(&pdev->dev, "%s: SmartReflex driver initialized\n", __func__); | 989 | dev_info(&pdev->dev, "%s: SmartReflex driver initialized\n", __func__); |
990 | if (!sr_dbg_dir) { | 990 | if (!sr_dbg_dir) { |
991 | sr_dbg_dir = debugfs_create_dir("smartreflex", NULL); | 991 | sr_dbg_dir = debugfs_create_dir("smartreflex", NULL); |
992 | if (!sr_dbg_dir) { | 992 | if (IS_ERR_OR_NULL(sr_dbg_dir)) { |
993 | ret = PTR_ERR(sr_dbg_dir); | 993 | ret = PTR_ERR(sr_dbg_dir); |
994 | pr_err("%s:sr debugfs dir creation failed(%d)\n", | 994 | pr_err("%s:sr debugfs dir creation failed(%d)\n", |
995 | __func__, ret); | 995 | __func__, ret); |
@@ -1006,7 +1006,7 @@ static int __init omap_sr_probe(struct platform_device *pdev) | |||
1006 | } | 1006 | } |
1007 | sr_info->dbg_dir = debugfs_create_dir(name, sr_dbg_dir); | 1007 | sr_info->dbg_dir = debugfs_create_dir(name, sr_dbg_dir); |
1008 | kfree(name); | 1008 | kfree(name); |
1009 | if (IS_ERR(sr_info->dbg_dir)) { | 1009 | if (IS_ERR_OR_NULL(sr_info->dbg_dir)) { |
1010 | dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n", | 1010 | dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n", |
1011 | __func__); | 1011 | __func__); |
1012 | ret = PTR_ERR(sr_info->dbg_dir); | 1012 | ret = PTR_ERR(sr_info->dbg_dir); |
@@ -1023,7 +1023,7 @@ static int __init omap_sr_probe(struct platform_device *pdev) | |||
1023 | &sr_info->err_minlimit); | 1023 | &sr_info->err_minlimit); |
1024 | 1024 | ||
1025 | nvalue_dir = debugfs_create_dir("nvalue", sr_info->dbg_dir); | 1025 | nvalue_dir = debugfs_create_dir("nvalue", sr_info->dbg_dir); |
1026 | if (IS_ERR(nvalue_dir)) { | 1026 | if (IS_ERR_OR_NULL(nvalue_dir)) { |
1027 | dev_err(&pdev->dev, "%s: Unable to create debugfs directory" | 1027 | dev_err(&pdev->dev, "%s: Unable to create debugfs directory" |
1028 | "for n-values\n", __func__); | 1028 | "for n-values\n", __func__); |
1029 | ret = PTR_ERR(nvalue_dir); | 1029 | ret = PTR_ERR(nvalue_dir); |