[wilink8-wlan/build-utilites.git] / patches / kernel_patches / imx-3.14.52-android-5.1.1_2.1.0-ga / 0005-st_kim-do-not-use-debugfs-functions-if-not-enabled.patch
1 From b28edc7ef40cefedfdb209ce301a46af49438163 Mon Sep 17 00:00:00 2001
2 From: Eyal Reizer <eyalr@ti.com>
3 Date: Wed, 29 Jan 2014 09:24:06 +0200
4 Subject: [PATCH 05/12] st_kim: do not use debugfs functions if not enabled
6 the probe function was using debugfs apis without checking if
7 CONFIG_DEBUG_FS was enabled resulting with runtime errors.
8 Fix this so these apis will only be used if the switch is active.
10 Signed-off-by: Eyal Reizer <eyalr@ti.com>
11 ---
12 drivers/misc/ti-st/st_kim.c | 2 ++
13 1 file changed, 2 insertions(+)
15 diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
16 index 9d3dbb2..3bab3e8 100644
17 --- a/drivers/misc/ti-st/st_kim.c
18 +++ b/drivers/misc/ti-st/st_kim.c
19 @@ -777,6 +777,7 @@ static int kim_probe(struct platform_device *pdev)
20 kim_gdata->baud_rate = pdata->baud_rate;
21 pr_info("sysfs entries created\n");
23 +#ifdef CONFIG_DEBUG_FS
24 kim_debugfs_dir = debugfs_create_dir("ti-st", NULL);
25 if (IS_ERR(kim_debugfs_dir)) {
26 pr_err(" debugfs entries creation failed ");
27 @@ -793,6 +794,7 @@ static int kim_probe(struct platform_device *pdev)
29 err_debugfs_dir:
30 sysfs_remove_group(&pdev->dev.kobj, &uim_attr_grp);
31 +#endif
33 err_sysfs_group:
34 st_core_exit(kim_gdata->core_data);
35 --
36 1.7.9.5