* [PATCH] gpio: bcm-kona: fix bcm_kona_gpio_reset() warnings
@ 2016-06-07 16:22 Ben Dooks
2016-06-07 16:27 ` Ray Jui
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Ben Dooks @ 2016-06-07 16:22 UTC (permalink / raw)
To: linux-kernel
Cc: Alexandre Courbot, Ray Jui, Linus Walleij, linux-gpio, Ben Dooks,
bcm-kernel-feedback-list, Markus Mayer, linux-arm-kernel
The bcm_kona_gpio_reset() calls bcm_kona_gpio_write_lock_regs()
with what looks like the wrong parameter. The write_lock_regs
function takes a pointer to the registers, not the bcm_kona_gpio
structure.
Fix the warning, and probably bug by changing the function to
pass reg_base instead of kona_gpio, fixing the following warning:
drivers/gpio/gpio-bcm-kona.c:550:47: warning: incorrect type in argument 1 (different address spaces)
drivers/gpio/gpio-bcm-kona.c:550:47: expected void [noderef] <asn:2>*reg_base
drivers/gpio/gpio-bcm-kona.c:550:47: got struct bcm_kona_gpio *kona_gpio
drivers/gpio/gpio-bcm-kona.c:554:47: warning: incorrect type in argument 1 (different address spaces)
drivers/gpio/gpio-bcm-kona.c:554:47: expected void [noderef] <asn:2>*reg_base
drivers/gpio/gpio-bcm-kona.c:554:47: got struct bcm_kona_gpio *kona_gpio
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
Cc: Markus Mayer <mmayer@broadcom.com>
Cc: Ray Jui <rjui@broadcom.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: bcm-kernel-feedback-list@broadcom.com
Cc: linux-gpio@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
---
drivers/gpio/gpio-bcm-kona.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c
index 9aabc48..953e4b8 100644
--- a/drivers/gpio/gpio-bcm-kona.c
+++ b/drivers/gpio/gpio-bcm-kona.c
@@ -547,11 +547,11 @@ static void bcm_kona_gpio_reset(struct bcm_kona_gpio *kona_gpio)
/* disable interrupts and clear status */
for (i = 0; i < kona_gpio->num_bank; i++) {
/* Unlock the entire bank first */
- bcm_kona_gpio_write_lock_regs(kona_gpio, i, UNLOCK_CODE);
+ bcm_kona_gpio_write_lock_regs(reg_base, i, UNLOCK_CODE);
writel(0xffffffff, reg_base + GPIO_INT_MASK(i));
writel(0xffffffff, reg_base + GPIO_INT_STATUS(i));
/* Now re-lock the bank */
- bcm_kona_gpio_write_lock_regs(kona_gpio, i, LOCK_CODE);
+ bcm_kona_gpio_write_lock_regs(reg_base, i, LOCK_CODE);
}
}
--
2.8.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] gpio: bcm-kona: fix bcm_kona_gpio_reset() warnings
2016-06-07 16:22 [PATCH] gpio: bcm-kona: fix bcm_kona_gpio_reset() warnings Ben Dooks
@ 2016-06-07 16:27 ` Ray Jui
2016-06-07 16:33 ` Markus Mayer
2016-06-08 12:04 ` Linus Walleij
2 siblings, 0 replies; 4+ messages in thread
From: Ray Jui @ 2016-06-07 16:27 UTC (permalink / raw)
To: Ben Dooks, linux-kernel
Cc: Alexandre Courbot, Ray Jui, Linus Walleij, linux-gpio,
bcm-kernel-feedback-list, Markus Mayer, linux-arm-kernel
Hi Ben,
On 6/7/2016 9:22 AM, Ben Dooks wrote:
> The bcm_kona_gpio_reset() calls bcm_kona_gpio_write_lock_regs()
> with what looks like the wrong parameter. The write_lock_regs
> function takes a pointer to the registers, not the bcm_kona_gpio
> structure.
>
> Fix the warning, and probably bug by changing the function to
> pass reg_base instead of kona_gpio, fixing the following warning:
>
> drivers/gpio/gpio-bcm-kona.c:550:47: warning: incorrect type in argument 1 (different address spaces)
> drivers/gpio/gpio-bcm-kona.c:550:47: expected void [noderef] <asn:2>*reg_base
> drivers/gpio/gpio-bcm-kona.c:550:47: got struct bcm_kona_gpio *kona_gpio
> drivers/gpio/gpio-bcm-kona.c:554:47: warning: incorrect type in argument 1 (different address spaces)
> drivers/gpio/gpio-bcm-kona.c:554:47: expected void [noderef] <asn:2>*reg_base
> drivers/gpio/gpio-bcm-kona.c:554:47: got struct bcm_kona_gpio *kona_gpio
>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> Cc: Markus Mayer <mmayer@broadcom.com>
> Cc: Ray Jui <rjui@broadcom.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Alexandre Courbot <gnurou@gmail.com>
> Cc: bcm-kernel-feedback-list@broadcom.com
> Cc: linux-gpio@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> ---
> drivers/gpio/gpio-bcm-kona.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c
> index 9aabc48..953e4b8 100644
> --- a/drivers/gpio/gpio-bcm-kona.c
> +++ b/drivers/gpio/gpio-bcm-kona.c
> @@ -547,11 +547,11 @@ static void bcm_kona_gpio_reset(struct bcm_kona_gpio *kona_gpio)
> /* disable interrupts and clear status */
> for (i = 0; i < kona_gpio->num_bank; i++) {
> /* Unlock the entire bank first */
> - bcm_kona_gpio_write_lock_regs(kona_gpio, i, UNLOCK_CODE);
> + bcm_kona_gpio_write_lock_regs(reg_base, i, UNLOCK_CODE);
> writel(0xffffffff, reg_base + GPIO_INT_MASK(i));
> writel(0xffffffff, reg_base + GPIO_INT_STATUS(i));
> /* Now re-lock the bank */
> - bcm_kona_gpio_write_lock_regs(kona_gpio, i, LOCK_CODE);
> + bcm_kona_gpio_write_lock_regs(reg_base, i, LOCK_CODE);
> }
> }
>
>
This fix looks good. The original code shouldn't even have worked.
Thanks.
Acked-by: Ray Jui <ray.jui@broadcom.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gpio: bcm-kona: fix bcm_kona_gpio_reset() warnings
2016-06-07 16:22 [PATCH] gpio: bcm-kona: fix bcm_kona_gpio_reset() warnings Ben Dooks
2016-06-07 16:27 ` Ray Jui
@ 2016-06-07 16:33 ` Markus Mayer
2016-06-08 12:04 ` Linus Walleij
2 siblings, 0 replies; 4+ messages in thread
From: Markus Mayer @ 2016-06-07 16:33 UTC (permalink / raw)
To: Ben Dooks
Cc: linux-kernel, Alexandre Courbot, Ray Jui, Linus Walleij,
linux-gpio, BCM Kernel Feedback, Markus Mayer, Linux ARM Kernel
On 7 June 2016 at 09:22, Ben Dooks <ben.dooks@codethink.co.uk> wrote:
> The bcm_kona_gpio_reset() calls bcm_kona_gpio_write_lock_regs()
> with what looks like the wrong parameter. The write_lock_regs
> function takes a pointer to the registers, not the bcm_kona_gpio
> structure.
>
> Fix the warning, and probably bug by changing the function to
> pass reg_base instead of kona_gpio, fixing the following warning:
>
> drivers/gpio/gpio-bcm-kona.c:550:47: warning: incorrect type in argument 1 (different address spaces)
> drivers/gpio/gpio-bcm-kona.c:550:47: expected void [noderef] <asn:2>*reg_base
> drivers/gpio/gpio-bcm-kona.c:550:47: got struct bcm_kona_gpio *kona_gpio
> drivers/gpio/gpio-bcm-kona.c:554:47: warning: incorrect type in argument 1 (different address spaces)
> drivers/gpio/gpio-bcm-kona.c:554:47: expected void [noderef] <asn:2>*reg_base
> drivers/gpio/gpio-bcm-kona.c:554:47: got struct bcm_kona_gpio *kona_gpio
>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> Cc: Markus Mayer <mmayer@broadcom.com>
> Cc: Ray Jui <rjui@broadcom.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Alexandre Courbot <gnurou@gmail.com>
> Cc: bcm-kernel-feedback-list@broadcom.com
> Cc: linux-gpio@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> ---
> drivers/gpio/gpio-bcm-kona.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c
> index 9aabc48..953e4b8 100644
> --- a/drivers/gpio/gpio-bcm-kona.c
> +++ b/drivers/gpio/gpio-bcm-kona.c
> @@ -547,11 +547,11 @@ static void bcm_kona_gpio_reset(struct bcm_kona_gpio *kona_gpio)
> /* disable interrupts and clear status */
> for (i = 0; i < kona_gpio->num_bank; i++) {
> /* Unlock the entire bank first */
> - bcm_kona_gpio_write_lock_regs(kona_gpio, i, UNLOCK_CODE);
> + bcm_kona_gpio_write_lock_regs(reg_base, i, UNLOCK_CODE);
> writel(0xffffffff, reg_base + GPIO_INT_MASK(i));
> writel(0xffffffff, reg_base + GPIO_INT_STATUS(i));
> /* Now re-lock the bank */
> - bcm_kona_gpio_write_lock_regs(kona_gpio, i, LOCK_CODE);
> + bcm_kona_gpio_write_lock_regs(reg_base, i, LOCK_CODE);
> }
> }
>
> --
> 2.8.1
>
Looks good. Thanks for fixing this.
Reviewed-by: Markus Mayer <mmayer@broadcom.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gpio: bcm-kona: fix bcm_kona_gpio_reset() warnings
2016-06-07 16:22 [PATCH] gpio: bcm-kona: fix bcm_kona_gpio_reset() warnings Ben Dooks
2016-06-07 16:27 ` Ray Jui
2016-06-07 16:33 ` Markus Mayer
@ 2016-06-08 12:04 ` Linus Walleij
2 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2016-06-08 12:04 UTC (permalink / raw)
To: Ben Dooks
Cc: linux-kernel, Markus Mayer, Ray Jui, Alexandre Courbot,
bcm-kernel-feedback-list, linux-gpio@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
On Tue, Jun 7, 2016 at 6:22 PM, Ben Dooks <ben.dooks@codethink.co.uk> wrote:
> The bcm_kona_gpio_reset() calls bcm_kona_gpio_write_lock_regs()
> with what looks like the wrong parameter. The write_lock_regs
> function takes a pointer to the registers, not the bcm_kona_gpio
> structure.
>
> Fix the warning, and probably bug by changing the function to
> pass reg_base instead of kona_gpio, fixing the following warning:
>
> drivers/gpio/gpio-bcm-kona.c:550:47: warning: incorrect type in argument 1 (different address spaces)
> drivers/gpio/gpio-bcm-kona.c:550:47: expected void [noderef] <asn:2>*reg_base
> drivers/gpio/gpio-bcm-kona.c:550:47: got struct bcm_kona_gpio *kona_gpio
> drivers/gpio/gpio-bcm-kona.c:554:47: warning: incorrect type in argument 1 (different address spaces)
> drivers/gpio/gpio-bcm-kona.c:554:47: expected void [noderef] <asn:2>*reg_base
> drivers/gpio/gpio-bcm-kona.c:554:47: got struct bcm_kona_gpio *kona_gpio
>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Patch applied with the ACKs and tagged for stable.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-06-08 12:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-07 16:22 [PATCH] gpio: bcm-kona: fix bcm_kona_gpio_reset() warnings Ben Dooks
2016-06-07 16:27 ` Ray Jui
2016-06-07 16:33 ` Markus Mayer
2016-06-08 12:04 ` Linus Walleij
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).