[wilink8-wlan/build-utilites.git] / patches / kernel_patches / imx-3.10.53-android-5.0.0_1.0.0-ga / 0004-st_kim-do-not-use-debugfs-functions-if-not-enabled.patch
diff --git a/patches/kernel_patches/imx-3.10.53-android-5.0.0_1.0.0-ga/0004-st_kim-do-not-use-debugfs-functions-if-not-enabled.patch b/patches/kernel_patches/imx-3.10.53-android-5.0.0_1.0.0-ga/0004-st_kim-do-not-use-debugfs-functions-if-not-enabled.patch
--- /dev/null
@@ -0,0 +1,37 @@
+From fb03dbd35bce057284d7b20c41798026cc054e7a Mon Sep 17 00:00:00 2001
+From: Eyal Reizer <eyalr@ti.com>
+Date: Wed, 29 Jan 2014 09:24:06 +0200
+Subject: [PATCH 04/15] st_kim: do not use debugfs functions if not enabled
+
+the probe function was using debugfs apis without checking if
+CONFIG_DEBUG_FS was enabled resulting with runtime errors.
+Fix this so these apis will only be used if the switch is active.
+
+Signed-off-by: Eyal Reizer <eyalr@ti.com>
+---
+ drivers/misc/ti-st/st_kim.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
+index 83269f1..fbf4dfd 100644
+--- a/drivers/misc/ti-st/st_kim.c
++++ b/drivers/misc/ti-st/st_kim.c
+@@ -778,6 +778,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 ");
+@@ -794,6 +795,7 @@ static int kim_probe(struct platform_device *pdev)
+
+ err_debugfs_dir:
+ sysfs_remove_group(&pdev->dev.kobj, &uim_attr_grp);
++#endif
+
+ err_sysfs_group:
+ st_core_exit(kim_gdata->core_data);
+--
+1.7.9.5
+