linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sh: sh4a: Remove unused tmu3_device
@ 2020-01-08 19:45 Krzysztof Kozlowski
  2020-01-09 12:56 ` Geert Uytterhoeven
  0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2020-01-08 19:45 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker, Krzysztof Kozlowski, linux-sh, linux-kernel
  Cc: Geert Uytterhoeven

Remove left-over from previous cleanups to silence the warning:

    arch/sh/kernel/cpu/sh4a/setup-sh7786.c:243:31:
        warning: ‘tmu3_device’ defined but not used [-Wunused-variable]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 arch/sh/kernel/cpu/sh4a/setup-sh7786.c | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
index 4b0db8259e3d..22d1c38f742f 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
@@ -229,27 +229,6 @@ static struct platform_device tmu2_device = {
 	.num_resources	= ARRAY_SIZE(tmu2_resources),
 };
 
-static struct sh_timer_config tmu3_platform_data = {
-	.channels_mask = 7,
-};
-
-static struct resource tmu3_resources[] = {
-	DEFINE_RES_MEM(0xffde0000, 0x2c),
-	DEFINE_RES_IRQ(evt2irq(0x7c0)),
-	DEFINE_RES_IRQ(evt2irq(0x7c0)),
-	DEFINE_RES_IRQ(evt2irq(0x7c0)),
-};
-
-static struct platform_device tmu3_device = {
-	.name		= "sh-tmu",
-	.id		= 3,
-	.dev = {
-		.platform_data	= &tmu3_platform_data,
-	},
-	.resource	= tmu3_resources,
-	.num_resources	= ARRAY_SIZE(tmu3_resources),
-};
-
 static const struct sh_dmae_channel dmac0_channels[] = {
 	{
 		.offset = 0,
-- 
2.17.1


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

* Re: [PATCH] sh: sh4a: Remove unused tmu3_device
  2020-01-08 19:45 [PATCH] sh: sh4a: Remove unused tmu3_device Krzysztof Kozlowski
@ 2020-01-09 12:56 ` Geert Uytterhoeven
  2020-01-18  8:01   ` Krzysztof Kozlowski
  0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2020-01-09 12:56 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Yoshinori Sato, Rich Felker, Linux-sh list,
	Linux Kernel Mailing List, Laurent Pinchart

Hi Krzysztof,

On Wed, Jan 8, 2020 at 8:45 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> Remove left-over from previous cleanups to silence the warning:
>
>     arch/sh/kernel/cpu/sh4a/setup-sh7786.c:243:31:
>         warning: ‘tmu3_device’ defined but not used [-Wunused-variable]
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  arch/sh/kernel/cpu/sh4a/setup-sh7786.c | 21 ---------------------
>  1 file changed, 21 deletions(-)
>
> diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
> index 4b0db8259e3d..22d1c38f742f 100644
> --- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
> +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
> @@ -229,27 +229,6 @@ static struct platform_device tmu2_device = {
>         .num_resources  = ARRAY_SIZE(tmu2_resources),
>  };
>
> -static struct sh_timer_config tmu3_platform_data = {
> -       .channels_mask = 7,
> -};
> -
> -static struct resource tmu3_resources[] = {
> -       DEFINE_RES_MEM(0xffde0000, 0x2c),
> -       DEFINE_RES_IRQ(evt2irq(0x7c0)),
> -       DEFINE_RES_IRQ(evt2irq(0x7c0)),
> -       DEFINE_RES_IRQ(evt2irq(0x7c0)),
> -};
> -
> -static struct platform_device tmu3_device = {
> -       .name           = "sh-tmu",
> -       .id             = 3,
> -       .dev = {
> -               .platform_data  = &tmu3_platform_data,
> -       },
> -       .resource       = tmu3_resources,
> -       .num_resources  = ARRAY_SIZE(tmu3_resources),
> -};
> -
>  static const struct sh_dmae_channel dmac0_channels[] = {
>         {
>                 .offset = 0,

Looks like the previous cleanup accidentally removed one too many tmu
device pointers.  The old style used one device per timer, the new style
uses one device per 3 timers, i.e. 4 devices for 12 timers.

So the correct fix would be to re-add "&tmu3_device" to
sh7786_early_devices[].

Fixes: 1399c195ef5009bf ("sh: Switch to new style TMU device")

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH] sh: sh4a: Remove unused tmu3_device
  2020-01-09 12:56 ` Geert Uytterhoeven
@ 2020-01-18  8:01   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2020-01-18  8:01 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Yoshinori Sato, Rich Felker, Linux-sh list,
	Linux Kernel Mailing List, Laurent Pinchart

On Thu, Jan 09, 2020 at 01:56:58PM +0100, Geert Uytterhoeven wrote:
> Hi Krzysztof,
> 
> On Wed, Jan 8, 2020 at 8:45 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> > Remove left-over from previous cleanups to silence the warning:
> >
> >     arch/sh/kernel/cpu/sh4a/setup-sh7786.c:243:31:
> >         warning: ‘tmu3_device’ defined but not used [-Wunused-variable]
> >
> > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> > ---
> >  arch/sh/kernel/cpu/sh4a/setup-sh7786.c | 21 ---------------------
> >  1 file changed, 21 deletions(-)
> >
> > diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
> > index 4b0db8259e3d..22d1c38f742f 100644
> > --- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
> > +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
> > @@ -229,27 +229,6 @@ static struct platform_device tmu2_device = {
> >         .num_resources  = ARRAY_SIZE(tmu2_resources),
> >  };
> >
> > -static struct sh_timer_config tmu3_platform_data = {
> > -       .channels_mask = 7,
> > -};
> > -
> > -static struct resource tmu3_resources[] = {
> > -       DEFINE_RES_MEM(0xffde0000, 0x2c),
> > -       DEFINE_RES_IRQ(evt2irq(0x7c0)),
> > -       DEFINE_RES_IRQ(evt2irq(0x7c0)),
> > -       DEFINE_RES_IRQ(evt2irq(0x7c0)),
> > -};
> > -
> > -static struct platform_device tmu3_device = {
> > -       .name           = "sh-tmu",
> > -       .id             = 3,
> > -       .dev = {
> > -               .platform_data  = &tmu3_platform_data,
> > -       },
> > -       .resource       = tmu3_resources,
> > -       .num_resources  = ARRAY_SIZE(tmu3_resources),
> > -};
> > -
> >  static const struct sh_dmae_channel dmac0_channels[] = {
> >         {
> >                 .offset = 0,
> 
> Looks like the previous cleanup accidentally removed one too many tmu
> device pointers.  The old style used one device per timer, the new style
> uses one device per 3 timers, i.e. 4 devices for 12 timers.
> 
> So the correct fix would be to re-add "&tmu3_device" to
> sh7786_early_devices[].
> 
> Fixes: 1399c195ef5009bf ("sh: Switch to new style TMU device")

Indeed, thanks. I'll send v2.

Best regards,
Krzysztof


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

end of thread, other threads:[~2020-01-18  8:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-08 19:45 [PATCH] sh: sh4a: Remove unused tmu3_device Krzysztof Kozlowski
2020-01-09 12:56 ` Geert Uytterhoeven
2020-01-18  8:01   ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).