Patchwork [08/25] gpio/mpc8xxx: add a const qualifier

login
register
mail settings
Submitter Uwe Kleine-König
Date July 23, 2012, 9:13 a.m.
Message ID <1343034810-3386-9-git-send-email-u.kleine-koenig@pengutronix.de>
Download mbox | patch
Permalink /patch/172615/
State New
Headers show

Comments

Uwe Kleine-König - July 23, 2012, 9:13 a.m.
This prepares *of_device_id.data becoming const. Without this change
the following warning would occur:

	drivers/gpio/gpio-mpc8xxx.c: In function 'mpc8xxx_add_controller':
	drivers/gpio/gpio-mpc8xxx.c:360:30: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/gpio/gpio-mpc8xxx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Linus Walleij - July 29, 2012, 4:13 p.m.
On Mon, Jul 23, 2012 at 11:13 AM, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:

> This prepares *of_device_id.data becoming const. Without this change
> the following warning would occur:
>
>         drivers/gpio/gpio-mpc8xxx.c: In function 'mpc8xxx_add_controller':
>         drivers/gpio/gpio-mpc8xxx.c:360:30: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

Patch

diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c
index 5a1817e..9ae29cc 100644
--- a/drivers/gpio/gpio-mpc8xxx.c
+++ b/drivers/gpio/gpio-mpc8xxx.c
@@ -38,7 +38,7 @@  struct mpc8xxx_gpio_chip {
 	 */
 	u32 data;
 	struct irq_domain *irq;
-	void *of_dev_id_data;
+	const void *of_dev_id_data;
 };
 
 static inline u32 mpc8xxx_gpio2mask(unsigned int gpio)