From d1d522d4f8b40016b7071dd0e0167927e58814e3 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 18 Jun 2019 17:50:46 +0200 Subject: gpio: tegra: No need to cast away return value of debugfs_create_file() It is fine to ignore the return value (and encouraged), so no need to cast away the return value, you will not get a build warning at all. Cc: Bartosz Golaszewski Cc: linux-gpio@vger.kernel.org Cc: linux-tegra@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Acked-by: Jon Hunter Acked-by: Thierry Reding Signed-off-by: Linus Walleij --- drivers/gpio/gpio-tegra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/gpio/gpio-tegra.c') diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index 6d9b6906b9d0..a54bba1bda6c 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -550,8 +550,8 @@ DEFINE_SHOW_ATTRIBUTE(tegra_dbg_gpio); static void tegra_gpio_debuginit(struct tegra_gpio_info *tgi) { - (void) debugfs_create_file("tegra_gpio", 0444, - NULL, tgi, &tegra_dbg_gpio_fops); + debugfs_create_file("tegra_gpio", 0444, NULL, tgi, + &tegra_dbg_gpio_fops); } #else -- cgit v1.2.3 From a4de43049a1d0e2ed2a1d95e18e74b82cd9ca058 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Wed, 26 Jun 2019 14:42:58 +0100 Subject: gpio: tegra: Clean-up debugfs initialisation The function tegra_gpio_debuginit() just calls debugfs_create_file() and given that there is already a stub function implemented for debugfs_create_file() when CONFIG_DEBUG_FS is not enabled, there is no need for the function tegra_gpio_debuginit() and so remove it. Finally, use a space and not a tab between the #ifdef and CONFIG_DEBUG_FS. Signed-off-by: Jon Hunter Reviewed-by: Bartosz Golaszewski Signed-off-by: Linus Walleij --- drivers/gpio/gpio-tegra.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'drivers/gpio/gpio-tegra.c') diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index a54bba1bda6c..250f39fc5adf 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -517,7 +517,7 @@ static int tegra_gpio_irq_set_wake(struct irq_data *d, unsigned int enable) } #endif -#ifdef CONFIG_DEBUG_FS +#ifdef CONFIG_DEBUG_FS #include #include @@ -547,19 +547,6 @@ static int tegra_dbg_gpio_show(struct seq_file *s, void *unused) } DEFINE_SHOW_ATTRIBUTE(tegra_dbg_gpio); - -static void tegra_gpio_debuginit(struct tegra_gpio_info *tgi) -{ - debugfs_create_file("tegra_gpio", 0444, NULL, tgi, - &tegra_dbg_gpio_fops); -} - -#else - -static inline void tegra_gpio_debuginit(struct tegra_gpio_info *tgi) -{ -} - #endif static const struct dev_pm_ops tegra_gpio_pm_ops = { @@ -684,7 +671,8 @@ static int tegra_gpio_probe(struct platform_device *pdev) } } - tegra_gpio_debuginit(tgi); + debugfs_create_file("tegra_gpio", 0444, NULL, tgi, + &tegra_dbg_gpio_fops); return 0; } -- cgit v1.2.3 From 9b3b623804a67d2274ee372c1587926ab0275833 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Sat, 6 Jul 2019 20:15:54 +0200 Subject: Revert "gpio: tegra: Clean-up debugfs initialisation" This reverts commit a4de43049a1d0e2ed2a1d95e18e74b82cd9ca058. The commit creates build errors. Signed-off-by: Linus Walleij --- drivers/gpio/gpio-tegra.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'drivers/gpio/gpio-tegra.c') diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index 250f39fc5adf..a54bba1bda6c 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -517,7 +517,7 @@ static int tegra_gpio_irq_set_wake(struct irq_data *d, unsigned int enable) } #endif -#ifdef CONFIG_DEBUG_FS +#ifdef CONFIG_DEBUG_FS #include #include @@ -547,6 +547,19 @@ static int tegra_dbg_gpio_show(struct seq_file *s, void *unused) } DEFINE_SHOW_ATTRIBUTE(tegra_dbg_gpio); + +static void tegra_gpio_debuginit(struct tegra_gpio_info *tgi) +{ + debugfs_create_file("tegra_gpio", 0444, NULL, tgi, + &tegra_dbg_gpio_fops); +} + +#else + +static inline void tegra_gpio_debuginit(struct tegra_gpio_info *tgi) +{ +} + #endif static const struct dev_pm_ops tegra_gpio_pm_ops = { @@ -671,8 +684,7 @@ static int tegra_gpio_probe(struct platform_device *pdev) } } - debugfs_create_file("tegra_gpio", 0444, NULL, tgi, - &tegra_dbg_gpio_fops); + tegra_gpio_debuginit(tgi); return 0; } -- cgit v1.2.3