--- v2
+++ v4
@@ -6,17 +6,14 @@
sysfs operations are skipped while the code remains buildable and
type-checked.
-v2:
-- Replace CONFIG_FB_DEVICE ifdefs with runtime checks
-- Use dev_of_fbinfo() to guard sysfs creation and removal
-
Suggested-by: Thomas Zimmermann <tzimmermann@suse.de>
Suggested-by: Helge Deller <deller@gmx.de>
+Reviewed-by: Helge Deller <deller@gmx.de>
Signed-off-by: Chintan Patel <chintanlike@gmail.com>
---
drivers/staging/fbtft/Kconfig | 5 ++++-
- drivers/staging/fbtft/fbtft-sysfs.c | 18 ++++++++++++++----
- 2 files changed, 18 insertions(+), 5 deletions(-)
+ drivers/staging/fbtft/fbtft-sysfs.c | 20 ++++++++++++++++----
+ 2 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/fbtft/Kconfig b/drivers/staging/fbtft/Kconfig
index c2655768209a..578412a2f379 100644
@@ -39,16 +36,17 @@
if FB_TFT
diff --git a/drivers/staging/fbtft/fbtft-sysfs.c b/drivers/staging/fbtft/fbtft-sysfs.c
-index e45c90a03a90..848702fc871a 100644
+index e45c90a03a90..d05599d80011 100644
--- a/drivers/staging/fbtft/fbtft-sysfs.c
+++ b/drivers/staging/fbtft/fbtft-sysfs.c
-@@ -203,14 +203,24 @@ static struct device_attribute debug_device_attr =
+@@ -203,14 +203,26 @@ static struct device_attribute debug_device_attr =
void fbtft_sysfs_init(struct fbtft_par *par)
{
- device_create_file(par->info->dev, &debug_device_attr);
-+ struct device *dev = dev_of_fbinfo(par->info);
++ struct device *dev;
+
++ dev = dev_of_fbinfo(par->info);
+ if (!dev)
+ return;
+
@@ -61,8 +59,9 @@
void fbtft_sysfs_exit(struct fbtft_par *par)
{
- device_remove_file(par->info->dev, &debug_device_attr);
-+ struct device *dev = dev_of_fbinfo(par->info);
++ struct device *dev;
+
++ dev = dev_of_fbinfo(par->info);
+ if (!dev)
+ return;
+