summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Gostev <fga022c@motorola.com>2014-03-05 23:04:08 -0500
committerAndrey Gostev <fga022c@motorola.com>2014-03-18 17:59:54 -0400
commitb69ab5f09a687d6514c1d328bd2b3847c0ff0c59 (patch)
tree741ee07f7724e72d2084521366ceb25d9492ef53
parent5dfa4e9ed7f92652f729aa86cc4781e81afc89cf (diff)
downloadolio-linux-3.10-b69ab5f09a687d6514c1d328bd2b3847c0ff0c59.tar.xz
olio-linux-3.10-b69ab5f09a687d6514c1d328bd2b3847c0ff0c59.zip
IKXCLOCK-377 ti-st: add conditional compiling statements for debugfs usage
Put debug fs usage under conditional compilation statements. Change-Id: I87d1c0636d65500c69dec1b08f31d5a015fff705 Signed-off-by: Andrey Gostev <fga022c@motorola.com>
-rw-r--r--drivers/misc/ti-st/st_kim.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
index 79bc9e96a9a..59caf12f5b0 100644
--- a/drivers/misc/ti-st/st_kim.c
+++ b/drivers/misc/ti-st/st_kim.c
@@ -27,7 +27,9 @@
#include <linux/delay.h>
#include <linux/wait.h>
#include <linux/gpio.h>
+#ifdef CONFIG_DEBUG_FS
#include <linux/debugfs.h>
+#endif
#include <linux/seq_file.h>
#include <linux/sched.h>
#include <linux/sysfs.h>
@@ -561,6 +563,7 @@ long st_kim_stop(void *kim_data)
return err;
}
+#ifdef CONFIG_DEBUG_FS
/**********************************************************************/
/* functions called from subsystems */
/* called when debugfs entry is read from */
@@ -580,6 +583,7 @@ static int show_list(struct seq_file *s, void *unused)
kim_st_list_protocols(kim_gdata->core_data, s);
return 0;
}
+#endif
static ssize_t show_install(struct device *dev,
struct device_attribute *attr, char *buf)
@@ -685,6 +689,7 @@ void st_kim_ref(struct st_data_s **core_data, int id)
*core_data = kim_gdata->core_data;
}
+#ifdef CONFIG_DEBUG_FS
static int kim_version_open(struct inode *i, struct file *f)
{
return single_open(f, show_version, i->i_private);
@@ -709,6 +714,7 @@ static const struct file_operations list_debugfs_fops = {
.llseek = seq_lseek,
.release = single_release,
};
+#endif
/**********************************************************************/
/* functions called from platform device driver subsystem
@@ -716,7 +722,9 @@ static const struct file_operations list_debugfs_fops = {
* board-*.c file
*/
+#ifdef CONFIG_DEBUG_FS
static struct dentry *kim_debugfs_dir;
+#endif
static int kim_probe(struct platform_device *pdev)
{
struct kim_data_s *kim_gdata;
@@ -779,6 +787,7 @@ static int kim_probe(struct platform_device *pdev)
kim_gdata->baud_rate = pdata->baud_rate;
pr_info("sysfs entries created\n");
+#ifdef CONFIG_DEBUG_FS
kim_debugfs_dir = debugfs_create_dir("ti-st", NULL);
if (IS_ERR(kim_debugfs_dir)) {
pr_err(" debugfs entries creation failed ");
@@ -795,6 +804,9 @@ static int kim_probe(struct platform_device *pdev)
err_debugfs_dir:
sysfs_remove_group(&pdev->dev.kobj, &uim_attr_grp);
+#else /* CONFIG_DEBUG_FS */
+ return 0;
+#endif
err_sysfs_group:
st_core_exit(kim_gdata->core_data);
@@ -819,7 +831,9 @@ static int kim_remove(struct platform_device *pdev)
gpio_free(pdata->nshutdown_gpio);
pr_info("nshutdown GPIO Freed");
+#ifdef CONFIG_DEBUG_FS
debugfs_remove_recursive(kim_debugfs_dir);
+#endif
sysfs_remove_group(&pdev->dev.kobj, &uim_attr_grp);
pr_info("sysfs entries removed");