All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio: tegra: Clean-up debugfs initialisation
@ 2019-06-26 13:42 Jon Hunter
  2019-06-26 16:38 ` Bartosz Golaszewski
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jon Hunter @ 2019-06-26 13:42 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Thierry Reding
  Cc: linux-gpio, linux-tegra, gregkh, Jon Hunter

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 <jonathanh@nvidia.com>
---
 drivers/gpio/gpio-tegra.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index 0f59161a4701..59b99d8c3647 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -508,7 +508,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 <linux/debugfs.h>
 #include <linux/seq_file.h>
@@ -538,19 +538,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 = {
@@ -675,7 +662,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;
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] gpio: tegra: Clean-up debugfs initialisation
  2019-06-26 13:42 [PATCH] gpio: tegra: Clean-up debugfs initialisation Jon Hunter
@ 2019-06-26 16:38 ` Bartosz Golaszewski
  2019-06-27 16:25 ` Linus Walleij
  2019-07-08  7:04 ` Linus Walleij
  2 siblings, 0 replies; 6+ messages in thread
From: Bartosz Golaszewski @ 2019-06-26 16:38 UTC (permalink / raw)
  To: Jon Hunter
  Cc: Linus Walleij, Thierry Reding, linux-gpio, linux-tegra, Greg KH

śr., 26 cze 2019 o 15:43 Jon Hunter <jonathanh@nvidia.com> napisał(a):
>
> 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 <jonathanh@nvidia.com>
> ---
>  drivers/gpio/gpio-tegra.c | 18 +++---------------
>  1 file changed, 3 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
> index 0f59161a4701..59b99d8c3647 100644
> --- a/drivers/gpio/gpio-tegra.c
> +++ b/drivers/gpio/gpio-tegra.c
> @@ -508,7 +508,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 <linux/debugfs.h>
>  #include <linux/seq_file.h>
> @@ -538,19 +538,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 = {
> @@ -675,7 +662,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;
>  }
> --
> 2.17.1
>

Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

This depends on changes queued by Linus, so I'll let him pick it up directly.

Bart

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gpio: tegra: Clean-up debugfs initialisation
  2019-06-26 13:42 [PATCH] gpio: tegra: Clean-up debugfs initialisation Jon Hunter
  2019-06-26 16:38 ` Bartosz Golaszewski
@ 2019-06-27 16:25 ` Linus Walleij
  2019-07-08  7:04 ` Linus Walleij
  2 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2019-06-27 16:25 UTC (permalink / raw)
  To: Jon Hunter
  Cc: Bartosz Golaszewski, Thierry Reding, open list:GPIO SUBSYSTEM,
	linux-tegra, Greg KH

On Wed, Jun 26, 2019 at 2:43 PM Jon Hunter <jonathanh@nvidia.com> wrote:

> 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 <jonathanh@nvidia.com>

Patch applied with Bartosz review tag.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gpio: tegra: Clean-up debugfs initialisation
  2019-06-26 13:42 [PATCH] gpio: tegra: Clean-up debugfs initialisation Jon Hunter
  2019-06-26 16:38 ` Bartosz Golaszewski
  2019-06-27 16:25 ` Linus Walleij
@ 2019-07-08  7:04 ` Linus Walleij
  2019-07-09 10:10   ` Jon Hunter
  2 siblings, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2019-07-08  7:04 UTC (permalink / raw)
  To: Jon Hunter
  Cc: Bartosz Golaszewski, Thierry Reding, open list:GPIO SUBSYSTEM,
	linux-tegra, Greg KH

On Wed, Jun 26, 2019 at 3:43 PM Jon Hunter <jonathanh@nvidia.com> wrote:

> 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 <jonathanh@nvidia.com>

Sadly I've had to revert this commit because of build errors, but
let's see if we can figure it out after the merge window.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gpio: tegra: Clean-up debugfs initialisation
  2019-07-08  7:04 ` Linus Walleij
@ 2019-07-09 10:10   ` Jon Hunter
  2019-07-09 11:44     ` Linus Walleij
  0 siblings, 1 reply; 6+ messages in thread
From: Jon Hunter @ 2019-07-09 10:10 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Bartosz Golaszewski, Thierry Reding, open list:GPIO SUBSYSTEM,
	linux-tegra, Greg KH


On 08/07/2019 08:04, Linus Walleij wrote:
> On Wed, Jun 26, 2019 at 3:43 PM Jon Hunter <jonathanh@nvidia.com> wrote:
> 
>> 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 <jonathanh@nvidia.com>
> 
> Sadly I've had to revert this commit because of build errors, but
> let's see if we can figure it out after the merge window.

Sorry about that. I will be more thorough in future.

Jon

-- 
nvpublic

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gpio: tegra: Clean-up debugfs initialisation
  2019-07-09 10:10   ` Jon Hunter
@ 2019-07-09 11:44     ` Linus Walleij
  0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2019-07-09 11:44 UTC (permalink / raw)
  To: Jon Hunter
  Cc: Bartosz Golaszewski, Thierry Reding, open list:GPIO SUBSYSTEM,
	linux-tegra, Greg KH

On Tue, Jul 9, 2019 at 12:11 PM Jon Hunter <jonathanh@nvidia.com> wrote:
> On 08/07/2019 08:04, Linus Walleij wrote:

> > Sadly I've had to revert this commit because of build errors, but
> > let's see if we can figure it out after the merge window.
>
> Sorry about that. I will be more thorough in future.

Don't beat yourself up about it, happens all the time. I saw Arnd
sent some suggested fixups BTW!

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-07-09 11:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-26 13:42 [PATCH] gpio: tegra: Clean-up debugfs initialisation Jon Hunter
2019-06-26 16:38 ` Bartosz Golaszewski
2019-06-27 16:25 ` Linus Walleij
2019-07-08  7:04 ` Linus Walleij
2019-07-09 10:10   ` Jon Hunter
2019-07-09 11:44     ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.