hte: tegra194: add GPIOLIB dependency

Message ID 20231023115646.3573494-1-arnd@kernel.org
State New
Headers
Series hte: tegra194: add GPIOLIB dependency |

Commit Message

Arnd Bergmann Oct. 23, 2023, 11:56 a.m. UTC
  From: Arnd Bergmann <arnd@arndb.de>

The driver started calling into a few interfaces that are part of GPIOLIB and
don't have stub implementations otherwise:

drivers/hte/hte-tegra194.c: In function 'tegra_hte_line_xlate':
drivers/hte/hte-tegra194.c:424:48: error: implicit declaration of function 'gpio_device_get_base'; did you mean 'gpio_device_get_desc'? [-Werror=implicit-function-declaration]
  424 |                 line_id = desc->attr.line_id - gpio_device_get_base(gs->gdev);
      |                                                ^~~~~~~~~~~~~~~~~~~~
      |                                                gpio_device_get_desc

Add a Kconfig dependency to only allow building when this is defined.

Fixes: dc850faa28ee0 ("hte: tegra194: don't access struct gpio_chip")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/hte/Kconfig | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Bartosz Golaszewski Oct. 23, 2023, noon UTC | #1
On Mon, Oct 23, 2023 at 1:57 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The driver started calling into a few interfaces that are part of GPIOLIB and
> don't have stub implementations otherwise:
>
> drivers/hte/hte-tegra194.c: In function 'tegra_hte_line_xlate':
> drivers/hte/hte-tegra194.c:424:48: error: implicit declaration of function 'gpio_device_get_base'; did you mean 'gpio_device_get_desc'? [-Werror=implicit-function-declaration]
>   424 |                 line_id = desc->attr.line_id - gpio_device_get_base(gs->gdev);
>       |                                                ^~~~~~~~~~~~~~~~~~~~
>       |                                                gpio_device_get_desc
>
> Add a Kconfig dependency to only allow building when this is defined.
>
> Fixes: dc850faa28ee0 ("hte: tegra194: don't access struct gpio_chip")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/hte/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/hte/Kconfig b/drivers/hte/Kconfig
> index 083e67492bf2e..641af722b555d 100644
> --- a/drivers/hte/Kconfig
> +++ b/drivers/hte/Kconfig
> @@ -17,6 +17,7 @@ if HTE
>  config HTE_TEGRA194
>         tristate "NVIDIA Tegra194 HTE Support"
>         depends on (ARCH_TEGRA_194_SOC || COMPILE_TEST)
> +       depends on GPIOLIB
>         help
>           Enable this option for integrated hardware timestamping engine also
>           known as generic timestamping engine (GTE) support on NVIDIA Tegra194
> --
> 2.39.2
>

Thanks. None of the new interfaces are "consumer" APIs and are not
meant to have stubs so depending on GPIOLIB is correct here.

Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
  
Bartosz Golaszewski Oct. 23, 2023, 12:02 p.m. UTC | #2
On Mon, Oct 23, 2023 at 2:00 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> On Mon, Oct 23, 2023 at 1:57 PM Arnd Bergmann <arnd@kernel.org> wrote:
> >
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > The driver started calling into a few interfaces that are part of GPIOLIB and
> > don't have stub implementations otherwise:
> >
> > drivers/hte/hte-tegra194.c: In function 'tegra_hte_line_xlate':
> > drivers/hte/hte-tegra194.c:424:48: error: implicit declaration of function 'gpio_device_get_base'; did you mean 'gpio_device_get_desc'? [-Werror=implicit-function-declaration]
> >   424 |                 line_id = desc->attr.line_id - gpio_device_get_base(gs->gdev);
> >       |                                                ^~~~~~~~~~~~~~~~~~~~
> >       |                                                gpio_device_get_desc
> >
> > Add a Kconfig dependency to only allow building when this is defined.
> >
> > Fixes: dc850faa28ee0 ("hte: tegra194: don't access struct gpio_chip")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  drivers/hte/Kconfig | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/hte/Kconfig b/drivers/hte/Kconfig
> > index 083e67492bf2e..641af722b555d 100644
> > --- a/drivers/hte/Kconfig
> > +++ b/drivers/hte/Kconfig
> > @@ -17,6 +17,7 @@ if HTE
> >  config HTE_TEGRA194
> >         tristate "NVIDIA Tegra194 HTE Support"
> >         depends on (ARCH_TEGRA_194_SOC || COMPILE_TEST)
> > +       depends on GPIOLIB
> >         help
> >           Enable this option for integrated hardware timestamping engine also
> >           known as generic timestamping engine (GTE) support on NVIDIA Tegra194
> > --
> > 2.39.2
> >
>
> Thanks. None of the new interfaces are "consumer" APIs and are not
> meant to have stubs so depending on GPIOLIB is correct here.
>
> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Ah, this goes on top of the patch that is in my tree so I'll wait for
Dipen's Ack and apply it.

Bart
  
Dipen Patel Oct. 23, 2023, 5:26 p.m. UTC | #3
On 10/23/23 5:02 AM, Bartosz Golaszewski wrote:
> On Mon, Oct 23, 2023 at 2:00 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>>
>> On Mon, Oct 23, 2023 at 1:57 PM Arnd Bergmann <arnd@kernel.org> wrote:
>>>
>>> From: Arnd Bergmann <arnd@arndb.de>
>>>
>>> The driver started calling into a few interfaces that are part of GPIOLIB and
>>> don't have stub implementations otherwise:
>>>
>>> drivers/hte/hte-tegra194.c: In function 'tegra_hte_line_xlate':
>>> drivers/hte/hte-tegra194.c:424:48: error: implicit declaration of function 'gpio_device_get_base'; did you mean 'gpio_device_get_desc'? [-Werror=implicit-function-declaration]
>>>   424 |                 line_id = desc->attr.line_id - gpio_device_get_base(gs->gdev);
>>>       |                                                ^~~~~~~~~~~~~~~~~~~~
>>>       |                                                gpio_device_get_desc
>>>
>>> Add a Kconfig dependency to only allow building when this is defined.
>>>
>>> Fixes: dc850faa28ee0 ("hte: tegra194: don't access struct gpio_chip")
>>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>>> ---
>>>  drivers/hte/Kconfig | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/hte/Kconfig b/drivers/hte/Kconfig
>>> index 083e67492bf2e..641af722b555d 100644
>>> --- a/drivers/hte/Kconfig
>>> +++ b/drivers/hte/Kconfig
>>> @@ -17,6 +17,7 @@ if HTE
>>>  config HTE_TEGRA194
>>>         tristate "NVIDIA Tegra194 HTE Support"
>>>         depends on (ARCH_TEGRA_194_SOC || COMPILE_TEST)
>>> +       depends on GPIOLIB
>>>         help
>>>           Enable this option for integrated hardware timestamping engine also
>>>           known as generic timestamping engine (GTE) support on NVIDIA Tegra194
>>> --
>>> 2.39.2
>>>
>>
>> Thanks. None of the new interfaces are "consumer" APIs and are not
>> meant to have stubs so depending on GPIOLIB is correct here.
>>
>> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> 
> Ah, this goes on top of the patch that is in my tree so I'll wait for
> Dipen's Ack and apply it.

Acked-by: Dipen Patel <dipenp@nvidia.com>
> 
> Bart
  
Bartosz Golaszewski Oct. 23, 2023, 6:20 p.m. UTC | #4
On Mon, Oct 23, 2023 at 7:26 PM Dipen Patel <dipenp@nvidia.com> wrote:
>
> On 10/23/23 5:02 AM, Bartosz Golaszewski wrote:
> > On Mon, Oct 23, 2023 at 2:00 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> >>
> >> On Mon, Oct 23, 2023 at 1:57 PM Arnd Bergmann <arnd@kernel.org> wrote:
> >>>
> >>> From: Arnd Bergmann <arnd@arndb.de>
> >>>
> >>> The driver started calling into a few interfaces that are part of GPIOLIB and
> >>> don't have stub implementations otherwise:
> >>>
> >>> drivers/hte/hte-tegra194.c: In function 'tegra_hte_line_xlate':
> >>> drivers/hte/hte-tegra194.c:424:48: error: implicit declaration of function 'gpio_device_get_base'; did you mean 'gpio_device_get_desc'? [-Werror=implicit-function-declaration]
> >>>   424 |                 line_id = desc->attr.line_id - gpio_device_get_base(gs->gdev);
> >>>       |                                                ^~~~~~~~~~~~~~~~~~~~
> >>>       |                                                gpio_device_get_desc
> >>>
> >>> Add a Kconfig dependency to only allow building when this is defined.
> >>>
> >>> Fixes: dc850faa28ee0 ("hte: tegra194: don't access struct gpio_chip")
> >>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> >>> ---
> >>>  drivers/hte/Kconfig | 1 +
> >>>  1 file changed, 1 insertion(+)
> >>>
> >>> diff --git a/drivers/hte/Kconfig b/drivers/hte/Kconfig
> >>> index 083e67492bf2e..641af722b555d 100644
> >>> --- a/drivers/hte/Kconfig
> >>> +++ b/drivers/hte/Kconfig
> >>> @@ -17,6 +17,7 @@ if HTE
> >>>  config HTE_TEGRA194
> >>>         tristate "NVIDIA Tegra194 HTE Support"
> >>>         depends on (ARCH_TEGRA_194_SOC || COMPILE_TEST)
> >>> +       depends on GPIOLIB
> >>>         help
> >>>           Enable this option for integrated hardware timestamping engine also
> >>>           known as generic timestamping engine (GTE) support on NVIDIA Tegra194
> >>> --
> >>> 2.39.2
> >>>
> >>
> >> Thanks. None of the new interfaces are "consumer" APIs and are not
> >> meant to have stubs so depending on GPIOLIB is correct here.
> >>
> >> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >
> > Ah, this goes on top of the patch that is in my tree so I'll wait for
> > Dipen's Ack and apply it.
>
> Acked-by: Dipen Patel <dipenp@nvidia.com>
> >
> > Bart
>

I queued it. There's a trivial conflict with your HTE branch, Stephen
should be able to resolve it.

Bart
  

Patch

diff --git a/drivers/hte/Kconfig b/drivers/hte/Kconfig
index 083e67492bf2e..641af722b555d 100644
--- a/drivers/hte/Kconfig
+++ b/drivers/hte/Kconfig
@@ -17,6 +17,7 @@  if HTE
 config HTE_TEGRA194
 	tristate "NVIDIA Tegra194 HTE Support"
 	depends on (ARCH_TEGRA_194_SOC || COMPILE_TEST)
+	depends on GPIOLIB
 	help
 	  Enable this option for integrated hardware timestamping engine also
 	  known as generic timestamping engine (GTE) support on NVIDIA Tegra194