All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] make struct of_device_id.data const
@ 2012-07-13 12:32 y at pengutronix.de
  2012-07-13 12:32 ` [PATCH 0/9] " y at pengutronix.de
                   ` (32 more replies)
  0 siblings, 33 replies; 57+ messages in thread
From: y at pengutronix.de @ 2012-07-13 12:32 UTC (permalink / raw)
  To: linux-arm-kernel

From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

Hello,

this series' goal is to make struct of_device_id.data const.
Conceptually a driver must not modify the data contained there so making
it const is the right thing.

This change might introduce warnings because drivers don't use const to
access the data pointed to by of_device_id.data. In most cases the fix
is to add some consts.

This series (apart from adding this const in patch 10) fixes all drivers
covered by all arm defconfigs (based on v3.5-rc6).

There is one exception though:
drivers/regulator/twl-regulator.c (build in omap2plus_defconfig) now
issues:

	drivers/regulator/twl-regulator.c: In function 'twlreg_probe':
	drivers/regulator/twl-regulator.c:1181: warning: assignment discards qualifiers from pointer target type
	drivers/regulator/twl-regulator.c:1190: warning: assignment discards qualifiers from pointer target type

that is because this driver really modifies his .of_match_table in the
precence of a traditionally probed device.
I didn't check deeply, but probably the easiest fix is to remove
traditional platform support. Don't know if omap is ready for that
though.

And also patch 11 adds some more consts that are possible now after
patch 10.

This series is available in my git tree at:

	git://git.pengutronix.de/git/ukl/linux.git ofdeviceiddata

Best regards
Uwe

Uwe Kleine-K?nig (11):
  spi/imx: make spi_imx_data.devtype_data member point to const data
  serial/imx: make imx_port.devdata member point to const data
  ARM: cache-l2x0: add a const qualifier
  misc/atmel_tc: make atmel_tc.tcb_config member point to const data
  gpio/gpio-omap.c: add a const qualifier
  i2c/i2c-omap: add a const qualifier
  dmaengine: at_hdmac: add a few const qualifiers
  spi/spi-omap2-mcspi: add a const qualifier
  mmc/omap_hsmmc: add a const qualifier
  of: add const to struct of_device_id.data
  gpio/gpio-omap: make platformdata used as of_device_id.data const

 arch/arm/mm/cache-l2x0.c        |    2 +-
 drivers/dma/at_hdmac.c          |    4 ++--
 drivers/gpio/gpio-omap.c        |    8 ++++----
 drivers/i2c/busses/i2c-omap.c   |    3 ++-
 drivers/mmc/host/omap_hsmmc.c   |    2 +-
 drivers/spi/spi-imx.c           |    2 +-
 drivers/spi/spi-omap2-mcspi.c   |    2 +-
 drivers/tty/serial/imx.c        |    2 +-
 include/linux/atmel_tc.h        |    2 +-
 include/linux/mod_devicetable.h |    2 +-
 10 files changed, 15 insertions(+), 14 deletions(-)

-- 
1.7.10.4

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

* [PATCH 0/9] make struct of_device_id.data const
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
  2012-07-13 12:32 ` [PATCH 0/9] " y at pengutronix.de
@ 2012-07-13 12:32 ` y
  2012-07-13 12:32 ` [PATCH 01/11] spi/imx: make spi_imx_data.devtype_data member point to const data y
                   ` (30 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y @ 2012-07-13 12:32 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann
  Cc: devicetree-discuss, Rob Herring, linux-arm-kernel, kernel,
	Uwe Kleine-König

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>


Uwe Kleine-König (9):
  spi/imx: make spi_imx_data.devtype_data member point to const data
  serial/imx: make imx_port.devdata member point to const data
  ARM: cache-l2x0: add a const qualifier
  misc/atmel_tc: make atmel_tc.tcb_config member point to const data
  gpio/gpio-omap.c: add a const qualifier
  i2c/i2c-omap: add a const qualifier
  spi/spi-omap2-mcspi: add a const qualifier
  of: add const to struct of_device_id.data
  gpio/gpio-omap: make platformdata used as of_device_id.data const

 arch/arm/mm/cache-l2x0.c        |    2 +-
 drivers/gpio/gpio-omap.c        |    8 ++++----
 drivers/i2c/busses/i2c-omap.c   |    3 ++-
 drivers/spi/spi-imx.c           |    2 +-
 drivers/spi/spi-omap2-mcspi.c   |    2 +-
 drivers/tty/serial/imx.c        |    2 +-
 include/linux/atmel_tc.h        |    2 +-
 include/linux/mod_devicetable.h |    2 +-
 8 files changed, 12 insertions(+), 11 deletions(-)

-- 
1.7.10


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 0/9] make struct of_device_id.data const
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
@ 2012-07-13 12:32 ` y at pengutronix.de
  2012-07-13 12:32 ` y
                   ` (31 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y at pengutronix.de @ 2012-07-13 12:32 UTC (permalink / raw)
  To: linux-arm-kernel

From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>


Uwe Kleine-K?nig (9):
  spi/imx: make spi_imx_data.devtype_data member point to const data
  serial/imx: make imx_port.devdata member point to const data
  ARM: cache-l2x0: add a const qualifier
  misc/atmel_tc: make atmel_tc.tcb_config member point to const data
  gpio/gpio-omap.c: add a const qualifier
  i2c/i2c-omap: add a const qualifier
  spi/spi-omap2-mcspi: add a const qualifier
  of: add const to struct of_device_id.data
  gpio/gpio-omap: make platformdata used as of_device_id.data const

 arch/arm/mm/cache-l2x0.c        |    2 +-
 drivers/gpio/gpio-omap.c        |    8 ++++----
 drivers/i2c/busses/i2c-omap.c   |    3 ++-
 drivers/spi/spi-imx.c           |    2 +-
 drivers/spi/spi-omap2-mcspi.c   |    2 +-
 drivers/tty/serial/imx.c        |    2 +-
 include/linux/atmel_tc.h        |    2 +-
 include/linux/mod_devicetable.h |    2 +-
 8 files changed, 12 insertions(+), 11 deletions(-)

-- 
1.7.10

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

* [PATCH 01/11] spi/imx: make spi_imx_data.devtype_data member point to const data
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (2 preceding siblings ...)
  2012-07-13 12:32 ` [PATCH 01/11] spi/imx: make spi_imx_data.devtype_data member point to const data y
@ 2012-07-13 12:32 ` y
  2012-07-13 12:32 ` y at pengutronix.de
                   ` (28 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y @ 2012-07-13 12:32 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Rob Herring,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ, Uwe Kleine-König,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change the
following warning would occur:

	drivers/spi/spi-imx.c: In function spi_imx_probe:
	drivers/spi/spi-imx.c:814:24: warning: assignment discards const qualifier from pointer target type [enabled by default]

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: spi-devel-general@lists.sourceforge.net
---
 drivers/spi/spi-imx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 47877d6..b09fc77 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -97,7 +97,7 @@ struct spi_imx_data {
 	const void *tx_buf;
 	unsigned int txfifo; /* number of words pushed in tx FIFO */
 
-	struct spi_imx_devtype_data *devtype_data;
+	const struct spi_imx_devtype_data *devtype_data;
 	int chipselect[0];
 };
 
-- 
1.7.10.4


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

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

* [PATCH 01/11] spi/imx: make spi_imx_data.devtype_data member point to const data
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
  2012-07-13 12:32 ` [PATCH 0/9] " y at pengutronix.de
  2012-07-13 12:32 ` y
@ 2012-07-13 12:32 ` y
  2012-07-13 12:32 ` y
                   ` (29 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y @ 2012-07-13 12:32 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann
  Cc: devicetree-discuss, Rob Herring, kernel, Uwe Kleine-König,
	spi-devel-general, linux-arm-kernel

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change the
following warning would occur:

	drivers/spi/spi-imx.c: In function spi_imx_probe:
	drivers/spi/spi-imx.c:814:24: warning: assignment discards const qualifier from pointer target type [enabled by default]

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: spi-devel-general@lists.sourceforge.net
---
 drivers/spi/spi-imx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 47877d6..b09fc77 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -97,7 +97,7 @@ struct spi_imx_data {
 	const void *tx_buf;
 	unsigned int txfifo; /* number of words pushed in tx FIFO */
 
-	struct spi_imx_devtype_data *devtype_data;
+	const struct spi_imx_devtype_data *devtype_data;
 	int chipselect[0];
 };
 
-- 
1.7.10.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 01/11] spi/imx: make spi_imx_data.devtype_data member point to const data
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (3 preceding siblings ...)
  2012-07-13 12:32 ` y
@ 2012-07-13 12:32 ` y at pengutronix.de
  2012-07-13 12:32 ` [PATCH 02/11] serial/imx: make imx_port.devdata " y
                   ` (27 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y at pengutronix.de @ 2012-07-13 12:32 UTC (permalink / raw)
  To: linux-arm-kernel

From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change the
following warning would occur:

	drivers/spi/spi-imx.c: In function spi_imx_probe:
	drivers/spi/spi-imx.c:814:24: warning: assignment discards const qualifier from pointer target type [enabled by default]

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Cc: spi-devel-general at lists.sourceforge.net
---
 drivers/spi/spi-imx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 47877d6..b09fc77 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -97,7 +97,7 @@ struct spi_imx_data {
 	const void *tx_buf;
 	unsigned int txfifo; /* number of words pushed in tx FIFO */
 
-	struct spi_imx_devtype_data *devtype_data;
+	const struct spi_imx_devtype_data *devtype_data;
 	int chipselect[0];
 };
 
-- 
1.7.10.4

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

* [PATCH 02/11] serial/imx: make imx_port.devdata member point to const data
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (4 preceding siblings ...)
  2012-07-13 12:32 ` y at pengutronix.de
@ 2012-07-13 12:32 ` y
  2012-07-13 12:32 ` y
                   ` (26 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y @ 2012-07-13 12:32 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann
  Cc: kernel, linux-arm-kernel, devicetree-discuss, Rob Herring,
	Uwe Kleine-König, Alan Cox, Greg Kroah-Hartman,
	linux-serial

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change the
following warning would occur:

	drivers/tty/serial/imx.c: In function 'serial_imx_probe_dt':
	drivers/tty/serial/imx.c:1430:17: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-serial@vger.kernel.org
---
 drivers/tty/serial/imx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 4ef7473..0af4eec 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -207,7 +207,7 @@ struct imx_port {
 	unsigned short		trcv_delay; /* transceiver delay */
 	struct clk		*clk_ipg;
 	struct clk		*clk_per;
-	struct imx_uart_data	*devdata;
+	const struct imx_uart_data *devdata;
 };
 
 struct imx_port_ucrs {
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 02/11] serial/imx: make imx_port.devdata member point to const data
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (5 preceding siblings ...)
  2012-07-13 12:32 ` [PATCH 02/11] serial/imx: make imx_port.devdata " y
@ 2012-07-13 12:32 ` y
  2012-07-13 12:32 ` y at pengutronix.de
                   ` (25 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y @ 2012-07-13 12:32 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann
  Cc: linux-serial, Greg Kroah-Hartman, devicetree-discuss,
	Rob Herring, kernel, Uwe Kleine-König, linux-arm-kernel,
	Alan Cox

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change the
following warning would occur:

	drivers/tty/serial/imx.c: In function 'serial_imx_probe_dt':
	drivers/tty/serial/imx.c:1430:17: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-serial@vger.kernel.org
---
 drivers/tty/serial/imx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 4ef7473..0af4eec 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -207,7 +207,7 @@ struct imx_port {
 	unsigned short		trcv_delay; /* transceiver delay */
 	struct clk		*clk_ipg;
 	struct clk		*clk_per;
-	struct imx_uart_data	*devdata;
+	const struct imx_uart_data *devdata;
 };
 
 struct imx_port_ucrs {
-- 
1.7.10.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 02/11] serial/imx: make imx_port.devdata member point to const data
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (6 preceding siblings ...)
  2012-07-13 12:32 ` y
@ 2012-07-13 12:32 ` y at pengutronix.de
  2012-07-13 12:32 ` [PATCH 03/11] ARM: cache-l2x0: add a const qualifier y at pengutronix.de
                   ` (24 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y at pengutronix.de @ 2012-07-13 12:32 UTC (permalink / raw)
  To: linux-arm-kernel

From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change the
following warning would occur:

	drivers/tty/serial/imx.c: In function 'serial_imx_probe_dt':
	drivers/tty/serial/imx.c:1430:17: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-serial at vger.kernel.org
---
 drivers/tty/serial/imx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 4ef7473..0af4eec 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -207,7 +207,7 @@ struct imx_port {
 	unsigned short		trcv_delay; /* transceiver delay */
 	struct clk		*clk_ipg;
 	struct clk		*clk_per;
-	struct imx_uart_data	*devdata;
+	const struct imx_uart_data *devdata;
 };
 
 struct imx_port_ucrs {
-- 
1.7.10.4

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

* [PATCH 03/11] ARM: cache-l2x0: add a const qualifier
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (8 preceding siblings ...)
  2012-07-13 12:32 ` [PATCH 03/11] ARM: cache-l2x0: add a const qualifier y at pengutronix.de
@ 2012-07-13 12:32 ` y
  2012-07-13 12:32 ` [PATCH 04/11] misc/atmel_tc: make atmel_tc.tcb_config member point to const data y
                   ` (22 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y @ 2012-07-13 12:32 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann
  Cc: Russell King, devicetree-discuss, Rob Herring, kernel,
	Uwe Kleine-König, linux-arm-kernel

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change the
following warning would occur:

	arch/arm/mm/cache-l2x0.c: In function 'l2x0_of_init':
	arch/arm/mm/cache-l2x0.c:573:7: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]

though.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Russell King <linux@arm.linux.org.uk>
---
 arch/arm/mm/cache-l2x0.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 2a8e380..577baf7 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -554,7 +554,7 @@ static const struct of_device_id l2x0_ids[] __initconst = {
 int __init l2x0_of_init(u32 aux_val, u32 aux_mask)
 {
 	struct device_node *np;
-	struct l2x0_of_data *data;
+	const struct l2x0_of_data *data;
 	struct resource res;
 
 	np = of_find_matching_node(NULL, l2x0_ids);
-- 
1.7.10.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 03/11] ARM: cache-l2x0: add a const qualifier
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (7 preceding siblings ...)
  2012-07-13 12:32 ` y at pengutronix.de
@ 2012-07-13 12:32 ` y at pengutronix.de
  2012-07-13 12:32 ` y
                   ` (23 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y at pengutronix.de @ 2012-07-13 12:32 UTC (permalink / raw)
  To: linux-arm-kernel

From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change the
following warning would occur:

	arch/arm/mm/cache-l2x0.c: In function 'l2x0_of_init':
	arch/arm/mm/cache-l2x0.c:573:7: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]

though.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Cc: Russell King <linux@arm.linux.org.uk>
---
 arch/arm/mm/cache-l2x0.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 2a8e380..577baf7 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -554,7 +554,7 @@ static const struct of_device_id l2x0_ids[] __initconst = {
 int __init l2x0_of_init(u32 aux_val, u32 aux_mask)
 {
 	struct device_node *np;
-	struct l2x0_of_data *data;
+	const struct l2x0_of_data *data;
 	struct resource res;
 
 	np = of_find_matching_node(NULL, l2x0_ids);
-- 
1.7.10.4

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

* [PATCH 04/11] misc/atmel_tc: make atmel_tc.tcb_config member point to const data
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (9 preceding siblings ...)
  2012-07-13 12:32 ` y
@ 2012-07-13 12:32 ` y
  2012-07-13 12:32 ` y at pengutronix.de
                   ` (21 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y @ 2012-07-13 12:32 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann
  Cc: Greg Kroah-Hartman, devicetree-discuss, Nicolas Ferre,
	Rob Herring, kernel, Uwe Kleine-König, linux-arm-kernel

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change
the following warning would occur:

	drivers/misc/atmel_tclib.c: In function 'tc_probe':
	drivers/misc/atmel_tclib.c:170: warning: assignment discards qualifiers from pointer target type

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Hello,

btw, get_maintainer.pl suggested to Cc:
linux-atm-general@lists.sourceforge.net but not the Atmel people because
include/linux/atmel_tc.h matches include/linux/atm*.

Best regards
Uwe
 include/linux/atmel_tc.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/atmel_tc.h b/include/linux/atmel_tc.h
index 1d14b1dc..89a931b 100644
--- a/include/linux/atmel_tc.h
+++ b/include/linux/atmel_tc.h
@@ -63,7 +63,7 @@ struct atmel_tc {
 	struct platform_device	*pdev;
 	struct resource		*iomem;
 	void __iomem		*regs;
-	struct atmel_tcb_config	*tcb_config;
+	const struct atmel_tcb_config *tcb_config;
 	int			irq[3];
 	struct clk		*clk[3];
 	struct list_head	node;
-- 
1.7.10.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 04/11] misc/atmel_tc: make atmel_tc.tcb_config member point to const data
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (10 preceding siblings ...)
  2012-07-13 12:32 ` [PATCH 04/11] misc/atmel_tc: make atmel_tc.tcb_config member point to const data y
@ 2012-07-13 12:32 ` y at pengutronix.de
  2012-07-13 13:40     ` Nicolas Ferre
  2012-07-13 12:32 ` [PATCH 05/11] gpio/gpio-omap.c: add a const qualifier y at pengutronix.de
                   ` (20 subsequent siblings)
  32 siblings, 1 reply; 57+ messages in thread
From: y at pengutronix.de @ 2012-07-13 12:32 UTC (permalink / raw)
  To: linux-arm-kernel

From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change
the following warning would occur:

	drivers/misc/atmel_tclib.c: In function 'tc_probe':
	drivers/misc/atmel_tclib.c:170: warning: assignment discards qualifiers from pointer target type

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Hello,

btw, get_maintainer.pl suggested to Cc:
linux-atm-general at lists.sourceforge.net but not the Atmel people because
include/linux/atmel_tc.h matches include/linux/atm*.

Best regards
Uwe
 include/linux/atmel_tc.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/atmel_tc.h b/include/linux/atmel_tc.h
index 1d14b1dc..89a931b 100644
--- a/include/linux/atmel_tc.h
+++ b/include/linux/atmel_tc.h
@@ -63,7 +63,7 @@ struct atmel_tc {
 	struct platform_device	*pdev;
 	struct resource		*iomem;
 	void __iomem		*regs;
-	struct atmel_tcb_config	*tcb_config;
+	const struct atmel_tcb_config *tcb_config;
 	int			irq[3];
 	struct clk		*clk[3];
 	struct list_head	node;
-- 
1.7.10.4

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

* [PATCH 05/11] gpio/gpio-omap.c: add a const qualifier
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (12 preceding siblings ...)
  2012-07-13 12:32 ` [PATCH 05/11] gpio/gpio-omap.c: add a const qualifier y at pengutronix.de
@ 2012-07-13 12:32 ` y
  2012-07-13 12:32 ` [PATCH 06/11] i2c/i2c-omap: " y
                   ` (18 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y @ 2012-07-13 12:32 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann
  Cc: Linus Walleij, devicetree-discuss, Rob Herring, kernel,
	Uwe Kleine-König, linux-arm-kernel

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change
the following warning would occur:

	drivers/gpio/gpio-omap.c: In function 'omap_gpio_probe':
	drivers/gpio/gpio-omap.c:1060: warning: assignment discards qualifiers from pointer target type

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Linus Walleij <linus.walleij@stericsson.com>
---
 drivers/gpio/gpio-omap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index c4ed172..019cb7b 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1050,7 +1050,7 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct device_node *node = dev->of_node;
 	const struct of_device_id *match;
-	struct omap_gpio_platform_data *pdata;
+	const struct omap_gpio_platform_data *pdata;
 	struct resource *res;
 	struct gpio_bank *bank;
 	int ret = 0;
-- 
1.7.10.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 05/11] gpio/gpio-omap.c: add a const qualifier
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (11 preceding siblings ...)
  2012-07-13 12:32 ` y at pengutronix.de
@ 2012-07-13 12:32 ` y at pengutronix.de
  2012-07-13 12:32 ` y
                   ` (19 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y at pengutronix.de @ 2012-07-13 12:32 UTC (permalink / raw)
  To: linux-arm-kernel

From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change
the following warning would occur:

	drivers/gpio/gpio-omap.c: In function 'omap_gpio_probe':
	drivers/gpio/gpio-omap.c:1060: warning: assignment discards qualifiers from pointer target type

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Cc: Linus Walleij <linus.walleij@stericsson.com>
---
 drivers/gpio/gpio-omap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index c4ed172..019cb7b 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1050,7 +1050,7 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct device_node *node = dev->of_node;
 	const struct of_device_id *match;
-	struct omap_gpio_platform_data *pdata;
+	const struct omap_gpio_platform_data *pdata;
 	struct resource *res;
 	struct gpio_bank *bank;
 	int ret = 0;
-- 
1.7.10.4

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

* [PATCH 06/11] i2c/i2c-omap: add a const qualifier
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (14 preceding siblings ...)
  2012-07-13 12:32 ` [PATCH 06/11] i2c/i2c-omap: " y
@ 2012-07-13 12:32 ` y
  2012-07-13 12:32 ` y
                   ` (16 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y @ 2012-07-13 12:32 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann
  Cc: kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Rob Herring,
	Uwe Kleine-König, Tony Lindgren, Wolfram Sang,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

From: Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

This prepares of_device_id.data becoming const. Without this change
the following warning would occur:

	drivers/i2c/busses/i2c-omap.c: In function 'omap_i2c_probe':
	drivers/i2c/busses/i2c-omap.c:1025: warning: assignment discards qualifiers from pointer target type

Signed-off-by: Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
Cc: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
---
 drivers/i2c/busses/i2c-omap.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 801df60..4fc585d 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -987,7 +987,8 @@ omap_i2c_probe(struct platform_device *pdev)
 	struct omap_i2c_dev	*dev;
 	struct i2c_adapter	*adap;
 	struct resource		*mem, *irq, *ioarea;
-	struct omap_i2c_bus_platform_data *pdata = pdev->dev.platform_data;
+	const struct omap_i2c_bus_platform_data *pdata =
+		pdev->dev.platform_data;
 	struct device_node	*node = pdev->dev.of_node;
 	const struct of_device_id *match;
 	irq_handler_t isr;
-- 
1.7.10.4

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

* [PATCH 06/11] i2c/i2c-omap: add a const qualifier
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (15 preceding siblings ...)
  2012-07-13 12:32 ` y
@ 2012-07-13 12:32 ` y
  2012-07-13 12:32 ` y at pengutronix.de
                   ` (15 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y @ 2012-07-13 12:32 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann
  Cc: kernel, linux-arm-kernel, devicetree-discuss, Rob Herring,
	Uwe Kleine-König, Tony Lindgren, Wolfram Sang, linux-omap,
	linux-i2c

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change
the following warning would occur:

	drivers/i2c/busses/i2c-omap.c: In function 'omap_i2c_probe':
	drivers/i2c/busses/i2c-omap.c:1025: warning: assignment discards qualifiers from pointer target type

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Wolfram Sang <w.sang@pengutronix.de>
Cc: linux-omap@vger.kernel.org
Cc: linux-i2c@vger.kernel.org
---
 drivers/i2c/busses/i2c-omap.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 801df60..4fc585d 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -987,7 +987,8 @@ omap_i2c_probe(struct platform_device *pdev)
 	struct omap_i2c_dev	*dev;
 	struct i2c_adapter	*adap;
 	struct resource		*mem, *irq, *ioarea;
-	struct omap_i2c_bus_platform_data *pdata = pdev->dev.platform_data;
+	const struct omap_i2c_bus_platform_data *pdata =
+		pdev->dev.platform_data;
 	struct device_node	*node = pdev->dev.of_node;
 	const struct of_device_id *match;
 	irq_handler_t isr;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 06/11] i2c/i2c-omap: add a const qualifier
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (13 preceding siblings ...)
  2012-07-13 12:32 ` y
@ 2012-07-13 12:32 ` y
  2012-07-13 12:32 ` y
                   ` (17 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y @ 2012-07-13 12:32 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann
  Cc: Tony Lindgren, devicetree-discuss, Wolfram Sang, Rob Herring,
	linux-i2c, kernel, Uwe Kleine-König, linux-omap,
	linux-arm-kernel

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change
the following warning would occur:

	drivers/i2c/busses/i2c-omap.c: In function 'omap_i2c_probe':
	drivers/i2c/busses/i2c-omap.c:1025: warning: assignment discards qualifiers from pointer target type

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Wolfram Sang <w.sang@pengutronix.de>
Cc: linux-omap@vger.kernel.org
Cc: linux-i2c@vger.kernel.org
---
 drivers/i2c/busses/i2c-omap.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 801df60..4fc585d 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -987,7 +987,8 @@ omap_i2c_probe(struct platform_device *pdev)
 	struct omap_i2c_dev	*dev;
 	struct i2c_adapter	*adap;
 	struct resource		*mem, *irq, *ioarea;
-	struct omap_i2c_bus_platform_data *pdata = pdev->dev.platform_data;
+	const struct omap_i2c_bus_platform_data *pdata =
+		pdev->dev.platform_data;
 	struct device_node	*node = pdev->dev.of_node;
 	const struct of_device_id *match;
 	irq_handler_t isr;
-- 
1.7.10.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 06/11] i2c/i2c-omap: add a const qualifier
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (16 preceding siblings ...)
  2012-07-13 12:32 ` y
@ 2012-07-13 12:32 ` y at pengutronix.de
  2012-07-13 12:32 ` [PATCH 07/11] dmaengine: at_hdmac: add a few const qualifiers y at pengutronix.de
                   ` (14 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y at pengutronix.de @ 2012-07-13 12:32 UTC (permalink / raw)
  To: linux-arm-kernel

From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change
the following warning would occur:

	drivers/i2c/busses/i2c-omap.c: In function 'omap_i2c_probe':
	drivers/i2c/busses/i2c-omap.c:1025: warning: assignment discards qualifiers from pointer target type

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Wolfram Sang <w.sang@pengutronix.de>
Cc: linux-omap at vger.kernel.org
Cc: linux-i2c at vger.kernel.org
---
 drivers/i2c/busses/i2c-omap.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 801df60..4fc585d 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -987,7 +987,8 @@ omap_i2c_probe(struct platform_device *pdev)
 	struct omap_i2c_dev	*dev;
 	struct i2c_adapter	*adap;
 	struct resource		*mem, *irq, *ioarea;
-	struct omap_i2c_bus_platform_data *pdata = pdev->dev.platform_data;
+	const struct omap_i2c_bus_platform_data *pdata =
+		pdev->dev.platform_data;
 	struct device_node	*node = pdev->dev.of_node;
 	const struct of_device_id *match;
 	irq_handler_t isr;
-- 
1.7.10.4

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

* [PATCH 07/11] dmaengine: at_hdmac: add a few const qualifiers
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (18 preceding siblings ...)
  2012-07-13 12:32 ` [PATCH 07/11] dmaengine: at_hdmac: add a few const qualifiers y at pengutronix.de
@ 2012-07-13 12:32 ` y
  2012-07-13 12:32 ` [PATCH 08/11] spi/spi-omap2-mcspi: add a const qualifier y
                   ` (12 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y @ 2012-07-13 12:32 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann
  Cc: Vinod Koul, devicetree-discuss, Nicolas Ferre, Rob Herring,
	kernel, Uwe Kleine-König, Dan Williams, linux-arm-kernel

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change
the following warning would occur:

	drivers/dma/at_hdmac.c: In function 'at_dma_get_driver_data':
	drivers/dma/at_hdmac.c:1228: warning: return discards qualifiers from pointer target type

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
---
 drivers/dma/at_hdmac.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 7292aa8..7e9d265 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -1217,7 +1217,7 @@ static const struct platform_device_id atdma_devtypes[] = {
 	}
 };
 
-static inline struct at_dma_platform_data * __init at_dma_get_driver_data(
+static inline const struct at_dma_platform_data * __init at_dma_get_driver_data(
 						struct platform_device *pdev)
 {
 	if (pdev->dev.of_node) {
@@ -1255,7 +1255,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
 	int			irq;
 	int			err;
 	int			i;
-	struct at_dma_platform_data *plat_dat;
+	const struct at_dma_platform_data *plat_dat;
 
 	/* setup platform data for each SoC */
 	dma_cap_set(DMA_MEMCPY, at91sam9rl_config.cap_mask);
-- 
1.7.10.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 07/11] dmaengine: at_hdmac: add a few const qualifiers
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (17 preceding siblings ...)
  2012-07-13 12:32 ` y at pengutronix.de
@ 2012-07-13 12:32 ` y at pengutronix.de
  2012-07-13 13:54     ` Nicolas Ferre
  2012-07-16  6:38     ` Vinod Koul
  2012-07-13 12:32 ` y
                   ` (13 subsequent siblings)
  32 siblings, 2 replies; 57+ messages in thread
From: y at pengutronix.de @ 2012-07-13 12:32 UTC (permalink / raw)
  To: linux-arm-kernel

From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change
the following warning would occur:

	drivers/dma/at_hdmac.c: In function 'at_dma_get_driver_data':
	drivers/dma/at_hdmac.c:1228: warning: return discards qualifiers from pointer target type

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
---
 drivers/dma/at_hdmac.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 7292aa8..7e9d265 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -1217,7 +1217,7 @@ static const struct platform_device_id atdma_devtypes[] = {
 	}
 };
 
-static inline struct at_dma_platform_data * __init at_dma_get_driver_data(
+static inline const struct at_dma_platform_data * __init at_dma_get_driver_data(
 						struct platform_device *pdev)
 {
 	if (pdev->dev.of_node) {
@@ -1255,7 +1255,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
 	int			irq;
 	int			err;
 	int			i;
-	struct at_dma_platform_data *plat_dat;
+	const struct at_dma_platform_data *plat_dat;
 
 	/* setup platform data for each SoC */
 	dma_cap_set(DMA_MEMCPY, at91sam9rl_config.cap_mask);
-- 
1.7.10.4

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

* [PATCH 08/11] spi/spi-omap2-mcspi: add a const qualifier
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (19 preceding siblings ...)
  2012-07-13 12:32 ` y
@ 2012-07-13 12:32 ` y
  2012-07-13 12:32 ` y at pengutronix.de
                   ` (11 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y @ 2012-07-13 12:32 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Rob Herring,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ, Uwe Kleine-König,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change
the following warning would occur:

	drivers/spi/spi-omap2-mcspi.c: In function 'omap2_mcspi_probe':
	drivers/spi/spi-omap2-mcspi.c:1118: warning: assignment discards qualifiers from pointer target type

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: spi-devel-general@lists.sourceforge.net
---
 drivers/spi/spi-omap2-mcspi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 0c73dd4..3455769 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1087,7 +1087,7 @@ MODULE_DEVICE_TABLE(of, omap_mcspi_of_match);
 static int __devinit omap2_mcspi_probe(struct platform_device *pdev)
 {
 	struct spi_master	*master;
-	struct omap2_mcspi_platform_config *pdata;
+	const struct omap2_mcspi_platform_config *pdata;
 	struct omap2_mcspi	*mcspi;
 	struct resource		*r;
 	int			status = 0, i;
-- 
1.7.10.4


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

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

* [PATCH 08/11] spi/spi-omap2-mcspi: add a const qualifier
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (21 preceding siblings ...)
  2012-07-13 12:32 ` y at pengutronix.de
@ 2012-07-13 12:32 ` y
  2012-07-13 12:32 ` [PATCH 09/11] mmc/omap_hsmmc: " y at pengutronix.de
                   ` (9 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y @ 2012-07-13 12:32 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann
  Cc: devicetree-discuss, Rob Herring, kernel, Uwe Kleine-König,
	spi-devel-general, linux-arm-kernel

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change
the following warning would occur:

	drivers/spi/spi-omap2-mcspi.c: In function 'omap2_mcspi_probe':
	drivers/spi/spi-omap2-mcspi.c:1118: warning: assignment discards qualifiers from pointer target type

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: spi-devel-general@lists.sourceforge.net
---
 drivers/spi/spi-omap2-mcspi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 0c73dd4..3455769 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1087,7 +1087,7 @@ MODULE_DEVICE_TABLE(of, omap_mcspi_of_match);
 static int __devinit omap2_mcspi_probe(struct platform_device *pdev)
 {
 	struct spi_master	*master;
-	struct omap2_mcspi_platform_config *pdata;
+	const struct omap2_mcspi_platform_config *pdata;
 	struct omap2_mcspi	*mcspi;
 	struct resource		*r;
 	int			status = 0, i;
-- 
1.7.10.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 08/11] spi/spi-omap2-mcspi: add a const qualifier
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (20 preceding siblings ...)
  2012-07-13 12:32 ` [PATCH 08/11] spi/spi-omap2-mcspi: add a const qualifier y
@ 2012-07-13 12:32 ` y at pengutronix.de
  2012-07-13 12:32 ` y
                   ` (10 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y at pengutronix.de @ 2012-07-13 12:32 UTC (permalink / raw)
  To: linux-arm-kernel

From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change
the following warning would occur:

	drivers/spi/spi-omap2-mcspi.c: In function 'omap2_mcspi_probe':
	drivers/spi/spi-omap2-mcspi.c:1118: warning: assignment discards qualifiers from pointer target type

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Cc: spi-devel-general at lists.sourceforge.net
---
 drivers/spi/spi-omap2-mcspi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 0c73dd4..3455769 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1087,7 +1087,7 @@ MODULE_DEVICE_TABLE(of, omap_mcspi_of_match);
 static int __devinit omap2_mcspi_probe(struct platform_device *pdev)
 {
 	struct spi_master	*master;
-	struct omap2_mcspi_platform_config *pdata;
+	const struct omap2_mcspi_platform_config *pdata;
 	struct omap2_mcspi	*mcspi;
 	struct resource		*r;
 	int			status = 0, i;
-- 
1.7.10.4

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

* [PATCH 09/11] mmc/omap_hsmmc: add a const qualifier
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (25 preceding siblings ...)
  2012-07-13 12:32 ` y
@ 2012-07-13 12:32 ` y
  2012-07-13 12:32 ` [PATCH 10/11] of: add const to struct of_device_id.data y at pengutronix.de
                   ` (5 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y @ 2012-07-13 12:32 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann
  Cc: kernel, linux-arm-kernel, devicetree-discuss, Rob Herring,
	Uwe Kleine-König, Chris Ball, Venkatraman S, Balaji T K,
	Rajendra Nayak, Adrian Hunter, linux-omap, linux-mmc

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change
the following warning would occur:

	drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_probe':
	drivers/mmc/host/omap_hsmmc.c:1808: warning: initialization discards qualifiers from pointer target type

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Chris Ball <cjb@laptop.org>
Cc: Venkatraman S <svenkatr@ti.com>
Cc: Balaji T K <balajitk@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: linux-omap@vger.kernel.org
Cc: linux-mmc@vger.kernel.org
---
 drivers/mmc/host/omap_hsmmc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 389a3ee..5bcd043 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1805,7 +1805,7 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev)
 	if (match) {
 		pdata = of_get_hsmmc_pdata(&pdev->dev);
 		if (match->data) {
-			u16 *offsetp = match->data;
+			const u16 *offsetp = match->data;
 			pdata->reg_offset = *offsetp;
 		}
 	}
-- 
1.7.10.4


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

* [PATCH 09/11] mmc/omap_hsmmc: add a const qualifier
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (24 preceding siblings ...)
  2012-07-13 12:32 ` y
@ 2012-07-13 12:32 ` y
  2012-07-13 12:32 ` y
                   ` (6 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y @ 2012-07-13 12:32 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann
  Cc: kernel, linux-arm-kernel, devicetree-discuss, Rob Herring,
	Uwe Kleine-König, Chris Ball, Venkatraman S, Balaji T K,
	Rajendra Nayak, Adrian Hunter, linux-omap, linux-mmc

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change
the following warning would occur:

	drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_probe':
	drivers/mmc/host/omap_hsmmc.c:1808: warning: initialization discards qualifiers from pointer target type

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Chris Ball <cjb@laptop.org>
Cc: Venkatraman S <svenkatr@ti.com>
Cc: Balaji T K <balajitk@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: linux-omap@vger.kernel.org
Cc: linux-mmc@vger.kernel.org
---
 drivers/mmc/host/omap_hsmmc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 389a3ee..5bcd043 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1805,7 +1805,7 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev)
 	if (match) {
 		pdata = of_get_hsmmc_pdata(&pdev->dev);
 		if (match->data) {
-			u16 *offsetp = match->data;
+			const u16 *offsetp = match->data;
 			pdata->reg_offset = *offsetp;
 		}
 	}
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 09/11] mmc/omap_hsmmc: add a const qualifier
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (23 preceding siblings ...)
  2012-07-13 12:32 ` [PATCH 09/11] mmc/omap_hsmmc: " y at pengutronix.de
@ 2012-07-13 12:32 ` y
  2012-07-13 12:32 ` y
                   ` (7 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y @ 2012-07-13 12:32 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann
  Cc: Balaji T K, devicetree-discuss, Rajendra Nayak, linux-mmc,
	Adrian Hunter, Rob Herring, linux-omap, kernel,
	Uwe Kleine-König, Chris Ball, linux-arm-kernel

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change
the following warning would occur:

	drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_probe':
	drivers/mmc/host/omap_hsmmc.c:1808: warning: initialization discards qualifiers from pointer target type

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Chris Ball <cjb@laptop.org>
Cc: Venkatraman S <svenkatr@ti.com>
Cc: Balaji T K <balajitk@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: linux-omap@vger.kernel.org
Cc: linux-mmc@vger.kernel.org
---
 drivers/mmc/host/omap_hsmmc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 389a3ee..5bcd043 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1805,7 +1805,7 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev)
 	if (match) {
 		pdata = of_get_hsmmc_pdata(&pdev->dev);
 		if (match->data) {
-			u16 *offsetp = match->data;
+			const u16 *offsetp = match->data;
 			pdata->reg_offset = *offsetp;
 		}
 	}
-- 
1.7.10.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 09/11] mmc/omap_hsmmc: add a const qualifier
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (22 preceding siblings ...)
  2012-07-13 12:32 ` y
@ 2012-07-13 12:32 ` y at pengutronix.de
  2012-07-13 12:32 ` y
                   ` (8 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y at pengutronix.de @ 2012-07-13 12:32 UTC (permalink / raw)
  To: linux-arm-kernel

From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

This prepares of_device_id.data becoming const. Without this change
the following warning would occur:

	drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_probe':
	drivers/mmc/host/omap_hsmmc.c:1808: warning: initialization discards qualifiers from pointer target type

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Cc: Chris Ball <cjb@laptop.org>
Cc: Venkatraman S <svenkatr@ti.com>
Cc: Balaji T K <balajitk@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: linux-omap at vger.kernel.org
Cc: linux-mmc at vger.kernel.org
---
 drivers/mmc/host/omap_hsmmc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 389a3ee..5bcd043 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1805,7 +1805,7 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev)
 	if (match) {
 		pdata = of_get_hsmmc_pdata(&pdev->dev);
 		if (match->data) {
-			u16 *offsetp = match->data;
+			const u16 *offsetp = match->data;
 			pdata->reg_offset = *offsetp;
 		}
 	}
-- 
1.7.10.4

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

* [PATCH 10/11] of: add const to struct of_device_id.data
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (27 preceding siblings ...)
  2012-07-13 12:32 ` [PATCH 10/11] of: add const to struct of_device_id.data y at pengutronix.de
@ 2012-07-13 12:32 ` y
  2012-07-13 12:32 ` [PATCH 11/11] gpio/gpio-omap: make platformdata used as of_device_id.data const y at pengutronix.de
                   ` (3 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y @ 2012-07-13 12:32 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann
  Cc: devicetree-discuss, Greg Kroah-Hartman, Rob Herring, kernel,
	Uwe Kleine-König, linux-arm-kernel

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Drivers should never need to modify the data of a device id. So it can
be const which in turn allows more consts in the driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
 include/linux/mod_devicetable.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 5db9382..98fb3fe 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -224,7 +224,7 @@ struct of_device_id
 	char	type[32];
 	char	compatible[128];
 #ifdef __KERNEL__
-	void	*data;
+	const void *data;
 #else
 	kernel_ulong_t data;
 #endif
-- 
1.7.10.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 10/11] of: add const to struct of_device_id.data
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (26 preceding siblings ...)
  2012-07-13 12:32 ` y
@ 2012-07-13 12:32 ` y at pengutronix.de
  2012-07-13 12:32 ` y
                   ` (4 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y at pengutronix.de @ 2012-07-13 12:32 UTC (permalink / raw)
  To: linux-arm-kernel

From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

Drivers should never need to modify the data of a device id. So it can
be const which in turn allows more consts in the driver.

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
 include/linux/mod_devicetable.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 5db9382..98fb3fe 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -224,7 +224,7 @@ struct of_device_id
 	char	type[32];
 	char	compatible[128];
 #ifdef __KERNEL__
-	void	*data;
+	const void *data;
 #else
 	kernel_ulong_t data;
 #endif
-- 
1.7.10.4

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

* [PATCH 11/11] gpio/gpio-omap: make platformdata used as of_device_id.data const
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (29 preceding siblings ...)
  2012-07-13 12:32 ` [PATCH 11/11] gpio/gpio-omap: make platformdata used as of_device_id.data const y at pengutronix.de
@ 2012-07-13 12:32 ` y
  2012-07-13 12:39   ` Uwe Kleine-König
  2012-07-13 12:41   ` Rob Herring
  32 siblings, 0 replies; 57+ messages in thread
From: y @ 2012-07-13 12:32 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann
  Cc: Linus Walleij, devicetree-discuss, Rob Herring, kernel,
	Uwe Kleine-König, linux-arm-kernel

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Linus Walleij <linus.walleij@stericsson.com>
---
 drivers/gpio/gpio-omap.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 019cb7b..12ab547 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1430,19 +1430,19 @@ static struct omap_gpio_reg_offs omap4_gpio_regs = {
 	.fallingdetect =	OMAP4_GPIO_FALLINGDETECT,
 };
 
-static struct omap_gpio_platform_data omap2_pdata = {
+const static struct omap_gpio_platform_data omap2_pdata = {
 	.regs = &omap2_gpio_regs,
 	.bank_width = 32,
 	.dbck_flag = false,
 };
 
-static struct omap_gpio_platform_data omap3_pdata = {
+const static struct omap_gpio_platform_data omap3_pdata = {
 	.regs = &omap2_gpio_regs,
 	.bank_width = 32,
 	.dbck_flag = true,
 };
 
-static struct omap_gpio_platform_data omap4_pdata = {
+const static struct omap_gpio_platform_data omap4_pdata = {
 	.regs = &omap4_gpio_regs,
 	.bank_width = 32,
 	.dbck_flag = true,
-- 
1.7.10.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 11/11] gpio/gpio-omap: make platformdata used as of_device_id.data const
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
                   ` (28 preceding siblings ...)
  2012-07-13 12:32 ` y
@ 2012-07-13 12:32 ` y at pengutronix.de
  2012-07-13 12:32 ` y
                   ` (2 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: y at pengutronix.de @ 2012-07-13 12:32 UTC (permalink / raw)
  To: linux-arm-kernel

From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Cc: Linus Walleij <linus.walleij@stericsson.com>
---
 drivers/gpio/gpio-omap.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 019cb7b..12ab547 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1430,19 +1430,19 @@ static struct omap_gpio_reg_offs omap4_gpio_regs = {
 	.fallingdetect =	OMAP4_GPIO_FALLINGDETECT,
 };
 
-static struct omap_gpio_platform_data omap2_pdata = {
+const static struct omap_gpio_platform_data omap2_pdata = {
 	.regs = &omap2_gpio_regs,
 	.bank_width = 32,
 	.dbck_flag = false,
 };
 
-static struct omap_gpio_platform_data omap3_pdata = {
+const static struct omap_gpio_platform_data omap3_pdata = {
 	.regs = &omap2_gpio_regs,
 	.bank_width = 32,
 	.dbck_flag = true,
 };
 
-static struct omap_gpio_platform_data omap4_pdata = {
+const static struct omap_gpio_platform_data omap4_pdata = {
 	.regs = &omap4_gpio_regs,
 	.bank_width = 32,
 	.dbck_flag = true,
-- 
1.7.10.4

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

* Re: [PATCH 00/11] make struct of_device_id.data const
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
@ 2012-07-13 12:39   ` Uwe Kleine-König
  2012-07-13 12:32 ` y
                     ` (31 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: Uwe Kleine-König @ 2012-07-13 12:39 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Rob Herring
  Cc: Russell King, Linus Walleij, Vinod Koul, Greg Kroah-Hartman,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA, Adrian Hunter, Wolfram Sang,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Dan Williams,
	Chris Ball, Balaji T K, Alan Cox

Hello,

On Fri, Jul 13, 2012 at 02:32:02PM +0200, y@pengutronix.de wrote:
This is utter non-sense, it was me who sent these mails (and pressed 'y'
when git send-email asked if "Uwe Kleine-König
<u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>" is the right sender). Please make sure
to correct this when replying to the patches.

Sorry for the inconvenience.

Best regards
Uwe
-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* [PATCH 00/11] make struct of_device_id.data const
@ 2012-07-13 12:39   ` Uwe Kleine-König
  0 siblings, 0 replies; 57+ messages in thread
From: Uwe Kleine-König @ 2012-07-13 12:39 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

On Fri, Jul 13, 2012 at 02:32:02PM +0200, y at pengutronix.de wrote:
This is utter non-sense, it was me who sent these mails (and pressed 'y'
when git send-email asked if "Uwe Kleine-K?nig
<u.kleine-koenig@pengutronix.de>" is the right sender). Please make sure
to correct this when replying to the patches.

Sorry for the inconvenience.

Best regards
Uwe
-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: [PATCH 00/11] make struct of_device_id.data const
  2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
@ 2012-07-13 12:41   ` Rob Herring
  2012-07-13 12:32 ` y
                     ` (31 subsequent siblings)
  32 siblings, 0 replies; 57+ messages in thread
From: Rob Herring @ 2012-07-13 12:41 UTC (permalink / raw)
  To: y
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ, Uwe Kleine-König,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 07/13/2012 07:32 AM, y@pengutronix.de wrote:
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> Hello,
> 
> this series' goal is to make struct of_device_id.data const.
> Conceptually a driver must not modify the data contained there so making
> it const is the right thing.
> 
> This change might introduce warnings because drivers don't use const to
> access the data pointed to by of_device_id.data. In most cases the fix
> is to add some consts.
> 
> This series (apart from adding this const in patch 10) fixes all drivers
> covered by all arm defconfigs (based on v3.5-rc6).
> 

What about other arches?

Rob

> There is one exception though:
> drivers/regulator/twl-regulator.c (build in omap2plus_defconfig) now
> issues:
> 
> 	drivers/regulator/twl-regulator.c: In function 'twlreg_probe':
> 	drivers/regulator/twl-regulator.c:1181: warning: assignment discards qualifiers from pointer target type
> 	drivers/regulator/twl-regulator.c:1190: warning: assignment discards qualifiers from pointer target type
> 
> that is because this driver really modifies his .of_match_table in the
> precence of a traditionally probed device.
> I didn't check deeply, but probably the easiest fix is to remove
> traditional platform support. Don't know if omap is ready for that
> though.
> 
> And also patch 11 adds some more consts that are possible now after
> patch 10.
> 
> This series is available in my git tree at:
> 
> 	git://git.pengutronix.de/git/ukl/linux.git ofdeviceiddata
> 
> Best regards
> Uwe
> 
> Uwe Kleine-König (11):
>   spi/imx: make spi_imx_data.devtype_data member point to const data
>   serial/imx: make imx_port.devdata member point to const data
>   ARM: cache-l2x0: add a const qualifier
>   misc/atmel_tc: make atmel_tc.tcb_config member point to const data
>   gpio/gpio-omap.c: add a const qualifier
>   i2c/i2c-omap: add a const qualifier
>   dmaengine: at_hdmac: add a few const qualifiers
>   spi/spi-omap2-mcspi: add a const qualifier
>   mmc/omap_hsmmc: add a const qualifier
>   of: add const to struct of_device_id.data
>   gpio/gpio-omap: make platformdata used as of_device_id.data const
> 
>  arch/arm/mm/cache-l2x0.c        |    2 +-
>  drivers/dma/at_hdmac.c          |    4 ++--
>  drivers/gpio/gpio-omap.c        |    8 ++++----
>  drivers/i2c/busses/i2c-omap.c   |    3 ++-
>  drivers/mmc/host/omap_hsmmc.c   |    2 +-
>  drivers/spi/spi-imx.c           |    2 +-
>  drivers/spi/spi-omap2-mcspi.c   |    2 +-
>  drivers/tty/serial/imx.c        |    2 +-
>  include/linux/atmel_tc.h        |    2 +-
>  include/linux/mod_devicetable.h |    2 +-
>  10 files changed, 15 insertions(+), 14 deletions(-)
> 

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

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

* [PATCH 00/11] make struct of_device_id.data const
@ 2012-07-13 12:41   ` Rob Herring
  0 siblings, 0 replies; 57+ messages in thread
From: Rob Herring @ 2012-07-13 12:41 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/13/2012 07:32 AM, y at pengutronix.de wrote:
> From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
> 
> Hello,
> 
> this series' goal is to make struct of_device_id.data const.
> Conceptually a driver must not modify the data contained there so making
> it const is the right thing.
> 
> This change might introduce warnings because drivers don't use const to
> access the data pointed to by of_device_id.data. In most cases the fix
> is to add some consts.
> 
> This series (apart from adding this const in patch 10) fixes all drivers
> covered by all arm defconfigs (based on v3.5-rc6).
> 

What about other arches?

Rob

> There is one exception though:
> drivers/regulator/twl-regulator.c (build in omap2plus_defconfig) now
> issues:
> 
> 	drivers/regulator/twl-regulator.c: In function 'twlreg_probe':
> 	drivers/regulator/twl-regulator.c:1181: warning: assignment discards qualifiers from pointer target type
> 	drivers/regulator/twl-regulator.c:1190: warning: assignment discards qualifiers from pointer target type
> 
> that is because this driver really modifies his .of_match_table in the
> precence of a traditionally probed device.
> I didn't check deeply, but probably the easiest fix is to remove
> traditional platform support. Don't know if omap is ready for that
> though.
> 
> And also patch 11 adds some more consts that are possible now after
> patch 10.
> 
> This series is available in my git tree at:
> 
> 	git://git.pengutronix.de/git/ukl/linux.git ofdeviceiddata
> 
> Best regards
> Uwe
> 
> Uwe Kleine-K?nig (11):
>   spi/imx: make spi_imx_data.devtype_data member point to const data
>   serial/imx: make imx_port.devdata member point to const data
>   ARM: cache-l2x0: add a const qualifier
>   misc/atmel_tc: make atmel_tc.tcb_config member point to const data
>   gpio/gpio-omap.c: add a const qualifier
>   i2c/i2c-omap: add a const qualifier
>   dmaengine: at_hdmac: add a few const qualifiers
>   spi/spi-omap2-mcspi: add a const qualifier
>   mmc/omap_hsmmc: add a const qualifier
>   of: add const to struct of_device_id.data
>   gpio/gpio-omap: make platformdata used as of_device_id.data const
> 
>  arch/arm/mm/cache-l2x0.c        |    2 +-
>  drivers/dma/at_hdmac.c          |    4 ++--
>  drivers/gpio/gpio-omap.c        |    8 ++++----
>  drivers/i2c/busses/i2c-omap.c   |    3 ++-
>  drivers/mmc/host/omap_hsmmc.c   |    2 +-
>  drivers/spi/spi-imx.c           |    2 +-
>  drivers/spi/spi-omap2-mcspi.c   |    2 +-
>  drivers/tty/serial/imx.c        |    2 +-
>  include/linux/atmel_tc.h        |    2 +-
>  include/linux/mod_devicetable.h |    2 +-
>  10 files changed, 15 insertions(+), 14 deletions(-)
> 

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

* Re: [PATCH 04/11] misc/atmel_tc: make atmel_tc.tcb_config member point to const data
  2012-07-13 12:32 ` y at pengutronix.de
@ 2012-07-13 13:40     ` Nicolas Ferre
  0 siblings, 0 replies; 57+ messages in thread
From: Nicolas Ferre @ 2012-07-13 13:40 UTC (permalink / raw)
  Cc: Greg Kroah-Hartman, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	Rob Herring, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	Uwe Kleine-König,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 07/13/2012 02:32 PM, y@pengutronix.de :
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> This prepares of_device_id.data becoming const. Without this change
> the following warning would occur:
> 
> 	drivers/misc/atmel_tclib.c: In function 'tc_probe':
> 	drivers/misc/atmel_tclib.c:170: warning: assignment discards qualifiers from pointer target type
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Thanks Uwe!

> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> Hello,
> 
> btw, get_maintainer.pl suggested to Cc:
> linux-atm-general@lists.sourceforge.net but not the Atmel people because
> include/linux/atmel_tc.h matches include/linux/atm*.

Ah, ok, good to know. I will try to update MAINTAINERS file for this.

Bye,

> Best regards
> Uwe
>  include/linux/atmel_tc.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/atmel_tc.h b/include/linux/atmel_tc.h
> index 1d14b1dc..89a931b 100644
> --- a/include/linux/atmel_tc.h
> +++ b/include/linux/atmel_tc.h
> @@ -63,7 +63,7 @@ struct atmel_tc {
>  	struct platform_device	*pdev;
>  	struct resource		*iomem;
>  	void __iomem		*regs;
> -	struct atmel_tcb_config	*tcb_config;
> +	const struct atmel_tcb_config *tcb_config;
>  	int			irq[3];
>  	struct clk		*clk[3];
>  	struct list_head	node;
> 


-- 
Nicolas Ferre


_______________________________________________
devicetree-discuss mailing list
devicetree-discuss@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

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

* [PATCH 04/11] misc/atmel_tc: make atmel_tc.tcb_config member point to const data
@ 2012-07-13 13:40     ` Nicolas Ferre
  0 siblings, 0 replies; 57+ messages in thread
From: Nicolas Ferre @ 2012-07-13 13:40 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/13/2012 02:32 PM, y at pengutronix.de :
> From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
> 
> This prepares of_device_id.data becoming const. Without this change
> the following warning would occur:
> 
> 	drivers/misc/atmel_tclib.c: In function 'tc_probe':
> 	drivers/misc/atmel_tclib.c:170: warning: assignment discards qualifiers from pointer target type
> 
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Thanks Uwe!

> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> Hello,
> 
> btw, get_maintainer.pl suggested to Cc:
> linux-atm-general at lists.sourceforge.net but not the Atmel people because
> include/linux/atmel_tc.h matches include/linux/atm*.

Ah, ok, good to know. I will try to update MAINTAINERS file for this.

Bye,

> Best regards
> Uwe
>  include/linux/atmel_tc.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/atmel_tc.h b/include/linux/atmel_tc.h
> index 1d14b1dc..89a931b 100644
> --- a/include/linux/atmel_tc.h
> +++ b/include/linux/atmel_tc.h
> @@ -63,7 +63,7 @@ struct atmel_tc {
>  	struct platform_device	*pdev;
>  	struct resource		*iomem;
>  	void __iomem		*regs;
> -	struct atmel_tcb_config	*tcb_config;
> +	const struct atmel_tcb_config *tcb_config;
>  	int			irq[3];
>  	struct clk		*clk[3];
>  	struct list_head	node;
> 


-- 
Nicolas Ferre

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

* Re: [PATCH 00/11] make struct of_device_id.data const
  2012-07-13 12:41   ` Rob Herring
@ 2012-07-13 13:46       ` Uwe Kleine-König
  -1 siblings, 0 replies; 57+ messages in thread
From: Uwe Kleine-König @ 2012-07-13 13:46 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Fri, Jul 13, 2012 at 07:41:02AM -0500, Rob Herring wrote:
> On 07/13/2012 07:32 AM, y@pengutronix.de wrote:
> > From: Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > 
> > this series' goal is to make struct of_device_id.data const.
> > Conceptually a driver must not modify the data contained there so making
> > it const is the right thing.
> > 
> > This change might introduce warnings because drivers don't use const to
> > access the data pointed to by of_device_id.data. In most cases the fix
> > is to add some consts.
> > 
> > This series (apart from adding this const in patch 10) fixes all drivers
> > covered by all arm defconfigs (based on v3.5-rc6).
> > 
> 
> What about other arches?
I didn't looked at them, mainly because I don't have the scripts for
arches other than arm to do such testing. Also note that it introduces
only some warnings, but no breakage. So adding the const in the merge
window might be ok?!

I'm not sure I'll have the capacity to fix other arches now. Maybe only
add the const for ARCH=arm for now and I'll address the other archs as
time permits even though this is ugly? At least getting in patches 1-9
would be nice to get in to save me from keeping them up to date.

Which other arches do you consider relevant?

$ git grep -l '\<OF\>' arch/*/Kconfig
arch/arm/Kconfig
arch/c6x/Kconfig
arch/microblaze/Kconfig
arch/mips/Kconfig
arch/openrisc/Kconfig
arch/powerpc/Kconfig
arch/sparc/Kconfig
arch/x86/Kconfig

For most of these I first have to look where to get a toolchain from.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* [PATCH 00/11] make struct of_device_id.data const
@ 2012-07-13 13:46       ` Uwe Kleine-König
  0 siblings, 0 replies; 57+ messages in thread
From: Uwe Kleine-König @ 2012-07-13 13:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jul 13, 2012 at 07:41:02AM -0500, Rob Herring wrote:
> On 07/13/2012 07:32 AM, y at pengutronix.de wrote:
> > From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
> > 
> > this series' goal is to make struct of_device_id.data const.
> > Conceptually a driver must not modify the data contained there so making
> > it const is the right thing.
> > 
> > This change might introduce warnings because drivers don't use const to
> > access the data pointed to by of_device_id.data. In most cases the fix
> > is to add some consts.
> > 
> > This series (apart from adding this const in patch 10) fixes all drivers
> > covered by all arm defconfigs (based on v3.5-rc6).
> > 
> 
> What about other arches?
I didn't looked at them, mainly because I don't have the scripts for
arches other than arm to do such testing. Also note that it introduces
only some warnings, but no breakage. So adding the const in the merge
window might be ok?!

I'm not sure I'll have the capacity to fix other arches now. Maybe only
add the const for ARCH=arm for now and I'll address the other archs as
time permits even though this is ugly? At least getting in patches 1-9
would be nice to get in to save me from keeping them up to date.

Which other arches do you consider relevant?

$ git grep -l '\<OF\>' arch/*/Kconfig
arch/arm/Kconfig
arch/c6x/Kconfig
arch/microblaze/Kconfig
arch/mips/Kconfig
arch/openrisc/Kconfig
arch/powerpc/Kconfig
arch/sparc/Kconfig
arch/x86/Kconfig

For most of these I first have to look where to get a toolchain from.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: [PATCH 07/11] dmaengine: at_hdmac: add a few const qualifiers
  2012-07-13 12:32 ` [PATCH 07/11] dmaengine: at_hdmac: add a few const qualifiers y at pengutronix.de
@ 2012-07-13 13:54     ` Nicolas Ferre
  2012-07-16  6:38     ` Vinod Koul
  1 sibling, 0 replies; 57+ messages in thread
From: Nicolas Ferre @ 2012-07-13 13:54 UTC (permalink / raw)
  Cc: Vinod Koul, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	Rob Herring, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	Uwe Kleine-König, Dan Williams,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 07/13/2012 02:32 PM, y@pengutronix.de :
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> This prepares of_device_id.data becoming const. Without this change
> the following warning would occur:
> 
> 	drivers/dma/at_hdmac.c: In function 'at_dma_get_driver_data':
> 	drivers/dma/at_hdmac.c:1228: warning: return discards qualifiers from pointer target type
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Vinod Koul <vinod.koul@intel.com>
> ---
>  drivers/dma/at_hdmac.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
> index 7292aa8..7e9d265 100644
> --- a/drivers/dma/at_hdmac.c
> +++ b/drivers/dma/at_hdmac.c
> @@ -1217,7 +1217,7 @@ static const struct platform_device_id atdma_devtypes[] = {
>  	}
>  };
>  
> -static inline struct at_dma_platform_data * __init at_dma_get_driver_data(
> +static inline const struct at_dma_platform_data * __init at_dma_get_driver_data(
>  						struct platform_device *pdev)
>  {
>  	if (pdev->dev.of_node) {
> @@ -1255,7 +1255,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
>  	int			irq;
>  	int			err;
>  	int			i;
> -	struct at_dma_platform_data *plat_dat;
> +	const struct at_dma_platform_data *plat_dat;
>  
>  	/* setup platform data for each SoC */
>  	dma_cap_set(DMA_MEMCPY, at91sam9rl_config.cap_mask);
> 


-- 
Nicolas Ferre


_______________________________________________
devicetree-discuss mailing list
devicetree-discuss@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

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

* [PATCH 07/11] dmaengine: at_hdmac: add a few const qualifiers
@ 2012-07-13 13:54     ` Nicolas Ferre
  0 siblings, 0 replies; 57+ messages in thread
From: Nicolas Ferre @ 2012-07-13 13:54 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/13/2012 02:32 PM, y at pengutronix.de :
> From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
> 
> This prepares of_device_id.data becoming const. Without this change
> the following warning would occur:
> 
> 	drivers/dma/at_hdmac.c: In function 'at_dma_get_driver_data':
> 	drivers/dma/at_hdmac.c:1228: warning: return discards qualifiers from pointer target type
> 
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Vinod Koul <vinod.koul@intel.com>
> ---
>  drivers/dma/at_hdmac.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
> index 7292aa8..7e9d265 100644
> --- a/drivers/dma/at_hdmac.c
> +++ b/drivers/dma/at_hdmac.c
> @@ -1217,7 +1217,7 @@ static const struct platform_device_id atdma_devtypes[] = {
>  	}
>  };
>  
> -static inline struct at_dma_platform_data * __init at_dma_get_driver_data(
> +static inline const struct at_dma_platform_data * __init at_dma_get_driver_data(
>  						struct platform_device *pdev)
>  {
>  	if (pdev->dev.of_node) {
> @@ -1255,7 +1255,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
>  	int			irq;
>  	int			err;
>  	int			i;
> -	struct at_dma_platform_data *plat_dat;
> +	const struct at_dma_platform_data *plat_dat;
>  
>  	/* setup platform data for each SoC */
>  	dma_cap_set(DMA_MEMCPY, at91sam9rl_config.cap_mask);
> 


-- 
Nicolas Ferre

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

* Re: [PATCH 00/11] make struct of_device_id.data const
  2012-07-13 13:46       ` Uwe Kleine-König
@ 2012-07-13 16:24           ` Arnd Bergmann
  -1 siblings, 0 replies; 57+ messages in thread
From: Arnd Bergmann @ 2012-07-13 16:24 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ

On Friday 13 July 2012, Uwe Kleine-König wrote:
> On Fri, Jul 13, 2012 at 07:41:02AM -0500, Rob Herring wrote:
> > On 07/13/2012 07:32 AM, y@pengutronix.de wrote:
> > > From: Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > > 
> > > this series' goal is to make struct of_device_id.data const.
> > > Conceptually a driver must not modify the data contained there so making
> > > it const is the right thing.
> > > 
> > > This change might introduce warnings because drivers don't use const to
> > > access the data pointed to by of_device_id.data. In most cases the fix
> > > is to add some consts.
> > > 
> > > This series (apart from adding this const in patch 10) fixes all drivers
> > > covered by all arm defconfigs (based on v3.5-rc6).
> > > 
> > 
> > What about other arches?
>
> I didn't looked at them, mainly because I don't have the scripts for
> arches other than arm to do such testing. Also note that it introduces
> only some warnings, but no breakage. So adding the const in the merge
> window might be ok?!

I think it makes sense to change the drivers that are easy to find now:

git grep -A6 of_device_id | grep '\<data\>.*='  | brain

arch/c6x/platforms/plldata.c-   { .compatible = "ti,c6455-pll", .data = c6455_setup_clocks },
arch/mips/lantiq/irq.c- { .compatible = "lantiq,icu", .data = icu_of_init },
arch/powerpc/platforms/83xx/suspend.c-          .data = &pmc_types[0],
arch/powerpc/platforms/cell/celleb_pci.c-               .data = &celleb_fake_pci_spec,
arch/powerpc/platforms/cell/celleb_pci.c-               .data = &celleb_epci_spec,
arch/powerpc/sysdev/fsl_msi.c-          .data = (void *)&mpic_msi_feature,
drivers/atm/fore200e.c-         .data = (void *) &fore200e_bus[1],
drivers/char/xilinx_hwicap/xilinx_hwicap.c-     { .compatible = "xlnx,opb-hwicap-1.00.b", .data = &buffer_icap_config},
drivers/i2c/busses/i2c-mpc.c-   {.compatible = "mpc5200-i2c", .data = &mpc_i2c_data_52xx, },
drivers/macintosh/mediabay.c-   .data           = &keylargo_mb_ops,
drivers/mfd/da9052-i2c.c-       { .compatible = "dlg,da9053-aa", .data = &da9052_i2c_id[1] },
drivers/net/can/mscan/mpc5xxx_can.c-    { .compatible = "fsl,mpc5200-mscan", .data = &mpc5200_can_data, },
drivers/scsi/qlogicpti.c-               .data = &qpti_template,
drivers/usb/host/fsl-mph-dr-of.c-       { .compatible = "fsl-usb2-mph", .data = &fsl_usb2_mpc8xxx_pd, },
drivers/watchdog/mpc8xxx_wdt.c-         .data = &(struct mpc8xxx_wdt_type) {

I'm optimistic that this list covers the vast majority of the non-ARM
drivers, and some of them don't even need any changes. I've done
patches for the others below.

Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
---
 arch/powerpc/platforms/83xx/suspend.c    |    2 +-
 arch/powerpc/platforms/cell/celleb_pci.c |    2 +-
 arch/powerpc/sysdev/fsl_msi.c            |    8 ++++----
 drivers/i2c/busses/i2c-mpc.c             |   12 ++++++------
 drivers/macintosh/mediabay.c             |    8 ++++----
 drivers/mfd/da9052-i2c.c                 |    4 ++--
 drivers/net/can/mscan/mpc5xxx_can.c      |    6 +++---
 drivers/scsi/qlogicpti.c                 |    2 +-
 drivers/watchdog/mpc8xxx_wdt.c           |    2 +-
 10 files changed, 23 insertions(+), 26 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c
index 1a04671..1d769a2 100644
--- a/arch/powerpc/platforms/83xx/suspend.c
+++ b/arch/powerpc/platforms/83xx/suspend.c
@@ -326,7 +326,7 @@ static int pmc_probe(struct platform_device *ofdev)
 	const struct of_device_id *match;
 	struct device_node *np = ofdev->dev.of_node;
 	struct resource res;
-	struct pmc_type *type;
+	const struct pmc_type *type;
 	int ret = 0;
 
 	match = of_match_device(pmc_match, &ofdev->dev);
diff --git a/arch/powerpc/platforms/cell/celleb_pci.c b/arch/powerpc/platforms/cell/celleb_pci.c
index 5822141..abc8af4 100644
--- a/arch/powerpc/platforms/cell/celleb_pci.c
+++ b/arch/powerpc/platforms/cell/celleb_pci.c
@@ -472,7 +472,7 @@ int __init celleb_setup_phb(struct pci_controller *phb)
 {
 	struct device_node *dev = phb->dn;
 	const struct of_device_id *match;
-	struct celleb_phb_spec *phb_spec;
+	const struct celleb_phb_spec *phb_spec;
 	int rc;
 
 	match = of_match_node(celleb_phb_match, dev);
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index 6e097de..51ffafa 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -368,7 +368,7 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev)
 	int err, i, j, irq_index, count;
 	int rc;
 	const u32 *p;
-	struct fsl_msi_feature *features;
+	const struct fsl_msi_feature *features;
 	int len;
 	u32 offset;
 	static const u32 all_avail[] = { 0, NR_MSI_IRQS };
@@ -502,15 +502,15 @@ static const struct fsl_msi_feature vmpic_msi_feature = {
 static const struct of_device_id fsl_of_msi_ids[] = {
 	{
 		.compatible = "fsl,mpic-msi",
-		.data = (void *)&mpic_msi_feature,
+		.data = &mpic_msi_feature,
 	},
 	{
 		.compatible = "fsl,ipic-msi",
-		.data = (void *)&ipic_msi_feature,
+		.data = &ipic_msi_feature,
 	},
 	{
 		.compatible = "fsl,vmpic-msi",
-		.data = (void *)&vmpic_msi_feature,
+		.data = &vmpic_msi_feature,
 	},
 	{}
 };
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index b76731e..57f7703 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -647,7 +647,7 @@ static int __devinit fsl_i2c_probe(struct platform_device *op)
 	}
 
 	if (match->data) {
-		struct mpc_i2c_data *data = match->data;
+		const struct mpc_i2c_data *data = match->data;
 		data->setup(op->dev.of_node, i2c, clock, data->prescaler);
 	} else {
 		/* Backwards compatibility */
@@ -730,24 +730,24 @@ static int mpc_i2c_resume(struct device *dev)
 SIMPLE_DEV_PM_OPS(mpc_i2c_pm_ops, mpc_i2c_suspend, mpc_i2c_resume);
 #endif
 
-static struct mpc_i2c_data mpc_i2c_data_512x __devinitdata = {
+static const struct mpc_i2c_data mpc_i2c_data_512x __devinitdata = {
 	.setup = mpc_i2c_setup_512x,
 };
 
-static struct mpc_i2c_data mpc_i2c_data_52xx __devinitdata = {
+static const struct mpc_i2c_data mpc_i2c_data_52xx __devinitdata = {
 	.setup = mpc_i2c_setup_52xx,
 };
 
-static struct mpc_i2c_data mpc_i2c_data_8313 __devinitdata = {
+static const struct mpc_i2c_data mpc_i2c_data_8313 __devinitdata = {
 	.setup = mpc_i2c_setup_8xxx,
 };
 
-static struct mpc_i2c_data mpc_i2c_data_8543 __devinitdata = {
+static const struct mpc_i2c_data mpc_i2c_data_8543 __devinitdata = {
 	.setup = mpc_i2c_setup_8xxx,
 	.prescaler = 2,
 };
 
-static struct mpc_i2c_data mpc_i2c_data_8544 __devinitdata = {
+static const struct mpc_i2c_data mpc_i2c_data_8544 __devinitdata = {
 	.setup = mpc_i2c_setup_8xxx,
 	.prescaler = 3,
 };
diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c
index 831d751..3f8d032 100644
--- a/drivers/macintosh/mediabay.c
+++ b/drivers/macintosh/mediabay.c
@@ -63,7 +63,7 @@ struct media_bay_info {
 	int				value_count;
 	int				timer;
 	struct macio_dev		*mdev;
-	struct mb_ops*			ops;
+	const struct mb_ops*		ops;
 	int				index;
 	int				cached_gpio;
 	int				sleeping;
@@ -669,7 +669,7 @@ static int media_bay_resume(struct macio_dev *mdev)
 
 /* Definitions of "ops" structures.
  */
-static struct mb_ops ohare_mb_ops = {
+static const struct mb_ops ohare_mb_ops = {
 	.name		= "Ohare",
 	.content	= ohare_mb_content,
 	.power		= ohare_mb_power,
@@ -678,7 +678,7 @@ static struct mb_ops ohare_mb_ops = {
 	.un_reset_ide	= ohare_mb_un_reset_ide,
 };
 
-static struct mb_ops heathrow_mb_ops = {
+static const struct mb_ops heathrow_mb_ops = {
 	.name		= "Heathrow",
 	.content	= heathrow_mb_content,
 	.power		= heathrow_mb_power,
@@ -687,7 +687,7 @@ static struct mb_ops heathrow_mb_ops = {
 	.un_reset_ide	= heathrow_mb_un_reset_ide,
 };
 
-static struct mb_ops keylargo_mb_ops = {
+static const struct mb_ops keylargo_mb_ops = {
 	.name		= "KeyLargo",
 	.init		= keylargo_mb_init,
 	.content	= keylargo_mb_content,
diff --git a/drivers/mfd/da9052-i2c.c b/drivers/mfd/da9052-i2c.c
index 82c9d64..352c58b 100644
--- a/drivers/mfd/da9052-i2c.c
+++ b/drivers/mfd/da9052-i2c.c
@@ -46,7 +46,7 @@ static int da9052_i2c_enable_multiwrite(struct da9052 *da9052)
 	return 0;
 }
 
-static struct i2c_device_id da9052_i2c_id[] = {
+static const struct i2c_device_id da9052_i2c_id[] = {
 	{"da9052", DA9052},
 	{"da9053-aa", DA9053_AA},
 	{"da9053-ba", DA9053_BA},
@@ -104,7 +104,7 @@ static int __devinit da9052_i2c_probe(struct i2c_client *client,
 		const struct of_device_id *deviceid;
 
 		deviceid = of_match_node(dialog_dt_ids, np);
-		id = (const struct i2c_device_id *)deviceid->data;
+		id = deviceid->data;
 	}
 #endif
 
diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
index 5caa572..8a8df82 100644
--- a/drivers/net/can/mscan/mpc5xxx_can.c
+++ b/drivers/net/can/mscan/mpc5xxx_can.c
@@ -251,7 +251,7 @@ static struct of_device_id mpc5xxx_can_table[];
 static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev)
 {
 	const struct of_device_id *match;
-	struct mpc5xxx_can_data *data;
+	const struct mpc5xxx_can_data *data;
 	struct device_node *np = ofdev->dev.of_node;
 	struct net_device *dev;
 	struct mscan_priv *priv;
@@ -380,12 +380,12 @@ static int mpc5xxx_can_resume(struct platform_device *ofdev)
 }
 #endif
 
-static struct mpc5xxx_can_data __devinitdata mpc5200_can_data = {
+static const struct mpc5xxx_can_data __devinitdata mpc5200_can_data = {
 	.type = MSCAN_TYPE_MPC5200,
 	.get_clock = mpc52xx_can_get_clock,
 };
 
-static struct mpc5xxx_can_data __devinitdata mpc5121_can_data = {
+static const struct mpc5xxx_can_data __devinitdata mpc5121_can_data = {
 	.type = MSCAN_TYPE_MPC5121,
 	.get_clock = mpc512x_can_get_clock,
 };
diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c
index b191dd5..53ed15b 100644
--- a/drivers/scsi/qlogicpti.c
+++ b/drivers/scsi/qlogicpti.c
@@ -1305,7 +1305,7 @@ static int __devinit qpti_sbus_probe(struct platform_device *op)
 	match = of_match_device(qpti_match, &op->dev);
 	if (!match)
 		return -EINVAL;
-	tpnt = match->data;
+	tpnt = (void *)match->data;
 
 	/* Sometimes Antares cards come up not completely
 	 * setup, and we get a report of a zero IRQ.
diff --git a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c
index 40f7bf1..e6a038a 100644
--- a/drivers/watchdog/mpc8xxx_wdt.c
+++ b/drivers/watchdog/mpc8xxx_wdt.c
@@ -193,7 +193,7 @@ static int __devinit mpc8xxx_wdt_probe(struct platform_device *ofdev)
 	int ret;
 	const struct of_device_id *match;
 	struct device_node *np = ofdev->dev.of_node;
-	struct mpc8xxx_wdt_type *wdt_type;
+	const struct mpc8xxx_wdt_type *wdt_type;
 	u32 freq = fsl_get_sys_freq();
 	bool enabled;
 

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

* [PATCH 00/11] make struct of_device_id.data const
@ 2012-07-13 16:24           ` Arnd Bergmann
  0 siblings, 0 replies; 57+ messages in thread
From: Arnd Bergmann @ 2012-07-13 16:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 13 July 2012, Uwe Kleine-K?nig wrote:
> On Fri, Jul 13, 2012 at 07:41:02AM -0500, Rob Herring wrote:
> > On 07/13/2012 07:32 AM, y at pengutronix.de wrote:
> > > From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
> > > 
> > > this series' goal is to make struct of_device_id.data const.
> > > Conceptually a driver must not modify the data contained there so making
> > > it const is the right thing.
> > > 
> > > This change might introduce warnings because drivers don't use const to
> > > access the data pointed to by of_device_id.data. In most cases the fix
> > > is to add some consts.
> > > 
> > > This series (apart from adding this const in patch 10) fixes all drivers
> > > covered by all arm defconfigs (based on v3.5-rc6).
> > > 
> > 
> > What about other arches?
>
> I didn't looked at them, mainly because I don't have the scripts for
> arches other than arm to do such testing. Also note that it introduces
> only some warnings, but no breakage. So adding the const in the merge
> window might be ok?!

I think it makes sense to change the drivers that are easy to find now:

git grep -A6 of_device_id | grep '\<data\>.*='  | brain

arch/c6x/platforms/plldata.c-   { .compatible = "ti,c6455-pll", .data = c6455_setup_clocks },
arch/mips/lantiq/irq.c- { .compatible = "lantiq,icu", .data = icu_of_init },
arch/powerpc/platforms/83xx/suspend.c-          .data = &pmc_types[0],
arch/powerpc/platforms/cell/celleb_pci.c-               .data = &celleb_fake_pci_spec,
arch/powerpc/platforms/cell/celleb_pci.c-               .data = &celleb_epci_spec,
arch/powerpc/sysdev/fsl_msi.c-          .data = (void *)&mpic_msi_feature,
drivers/atm/fore200e.c-         .data = (void *) &fore200e_bus[1],
drivers/char/xilinx_hwicap/xilinx_hwicap.c-     { .compatible = "xlnx,opb-hwicap-1.00.b", .data = &buffer_icap_config},
drivers/i2c/busses/i2c-mpc.c-   {.compatible = "mpc5200-i2c", .data = &mpc_i2c_data_52xx, },
drivers/macintosh/mediabay.c-   .data           = &keylargo_mb_ops,
drivers/mfd/da9052-i2c.c-       { .compatible = "dlg,da9053-aa", .data = &da9052_i2c_id[1] },
drivers/net/can/mscan/mpc5xxx_can.c-    { .compatible = "fsl,mpc5200-mscan", .data = &mpc5200_can_data, },
drivers/scsi/qlogicpti.c-               .data = &qpti_template,
drivers/usb/host/fsl-mph-dr-of.c-       { .compatible = "fsl-usb2-mph", .data = &fsl_usb2_mpc8xxx_pd, },
drivers/watchdog/mpc8xxx_wdt.c-         .data = &(struct mpc8xxx_wdt_type) {

I'm optimistic that this list covers the vast majority of the non-ARM
drivers, and some of them don't even need any changes. I've done
patches for the others below.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/powerpc/platforms/83xx/suspend.c    |    2 +-
 arch/powerpc/platforms/cell/celleb_pci.c |    2 +-
 arch/powerpc/sysdev/fsl_msi.c            |    8 ++++----
 drivers/i2c/busses/i2c-mpc.c             |   12 ++++++------
 drivers/macintosh/mediabay.c             |    8 ++++----
 drivers/mfd/da9052-i2c.c                 |    4 ++--
 drivers/net/can/mscan/mpc5xxx_can.c      |    6 +++---
 drivers/scsi/qlogicpti.c                 |    2 +-
 drivers/watchdog/mpc8xxx_wdt.c           |    2 +-
 10 files changed, 23 insertions(+), 26 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c
index 1a04671..1d769a2 100644
--- a/arch/powerpc/platforms/83xx/suspend.c
+++ b/arch/powerpc/platforms/83xx/suspend.c
@@ -326,7 +326,7 @@ static int pmc_probe(struct platform_device *ofdev)
 	const struct of_device_id *match;
 	struct device_node *np = ofdev->dev.of_node;
 	struct resource res;
-	struct pmc_type *type;
+	const struct pmc_type *type;
 	int ret = 0;
 
 	match = of_match_device(pmc_match, &ofdev->dev);
diff --git a/arch/powerpc/platforms/cell/celleb_pci.c b/arch/powerpc/platforms/cell/celleb_pci.c
index 5822141..abc8af4 100644
--- a/arch/powerpc/platforms/cell/celleb_pci.c
+++ b/arch/powerpc/platforms/cell/celleb_pci.c
@@ -472,7 +472,7 @@ int __init celleb_setup_phb(struct pci_controller *phb)
 {
 	struct device_node *dev = phb->dn;
 	const struct of_device_id *match;
-	struct celleb_phb_spec *phb_spec;
+	const struct celleb_phb_spec *phb_spec;
 	int rc;
 
 	match = of_match_node(celleb_phb_match, dev);
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index 6e097de..51ffafa 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -368,7 +368,7 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev)
 	int err, i, j, irq_index, count;
 	int rc;
 	const u32 *p;
-	struct fsl_msi_feature *features;
+	const struct fsl_msi_feature *features;
 	int len;
 	u32 offset;
 	static const u32 all_avail[] = { 0, NR_MSI_IRQS };
@@ -502,15 +502,15 @@ static const struct fsl_msi_feature vmpic_msi_feature = {
 static const struct of_device_id fsl_of_msi_ids[] = {
 	{
 		.compatible = "fsl,mpic-msi",
-		.data = (void *)&mpic_msi_feature,
+		.data = &mpic_msi_feature,
 	},
 	{
 		.compatible = "fsl,ipic-msi",
-		.data = (void *)&ipic_msi_feature,
+		.data = &ipic_msi_feature,
 	},
 	{
 		.compatible = "fsl,vmpic-msi",
-		.data = (void *)&vmpic_msi_feature,
+		.data = &vmpic_msi_feature,
 	},
 	{}
 };
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index b76731e..57f7703 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -647,7 +647,7 @@ static int __devinit fsl_i2c_probe(struct platform_device *op)
 	}
 
 	if (match->data) {
-		struct mpc_i2c_data *data = match->data;
+		const struct mpc_i2c_data *data = match->data;
 		data->setup(op->dev.of_node, i2c, clock, data->prescaler);
 	} else {
 		/* Backwards compatibility */
@@ -730,24 +730,24 @@ static int mpc_i2c_resume(struct device *dev)
 SIMPLE_DEV_PM_OPS(mpc_i2c_pm_ops, mpc_i2c_suspend, mpc_i2c_resume);
 #endif
 
-static struct mpc_i2c_data mpc_i2c_data_512x __devinitdata = {
+static const struct mpc_i2c_data mpc_i2c_data_512x __devinitdata = {
 	.setup = mpc_i2c_setup_512x,
 };
 
-static struct mpc_i2c_data mpc_i2c_data_52xx __devinitdata = {
+static const struct mpc_i2c_data mpc_i2c_data_52xx __devinitdata = {
 	.setup = mpc_i2c_setup_52xx,
 };
 
-static struct mpc_i2c_data mpc_i2c_data_8313 __devinitdata = {
+static const struct mpc_i2c_data mpc_i2c_data_8313 __devinitdata = {
 	.setup = mpc_i2c_setup_8xxx,
 };
 
-static struct mpc_i2c_data mpc_i2c_data_8543 __devinitdata = {
+static const struct mpc_i2c_data mpc_i2c_data_8543 __devinitdata = {
 	.setup = mpc_i2c_setup_8xxx,
 	.prescaler = 2,
 };
 
-static struct mpc_i2c_data mpc_i2c_data_8544 __devinitdata = {
+static const struct mpc_i2c_data mpc_i2c_data_8544 __devinitdata = {
 	.setup = mpc_i2c_setup_8xxx,
 	.prescaler = 3,
 };
diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c
index 831d751..3f8d032 100644
--- a/drivers/macintosh/mediabay.c
+++ b/drivers/macintosh/mediabay.c
@@ -63,7 +63,7 @@ struct media_bay_info {
 	int				value_count;
 	int				timer;
 	struct macio_dev		*mdev;
-	struct mb_ops*			ops;
+	const struct mb_ops*		ops;
 	int				index;
 	int				cached_gpio;
 	int				sleeping;
@@ -669,7 +669,7 @@ static int media_bay_resume(struct macio_dev *mdev)
 
 /* Definitions of "ops" structures.
  */
-static struct mb_ops ohare_mb_ops = {
+static const struct mb_ops ohare_mb_ops = {
 	.name		= "Ohare",
 	.content	= ohare_mb_content,
 	.power		= ohare_mb_power,
@@ -678,7 +678,7 @@ static struct mb_ops ohare_mb_ops = {
 	.un_reset_ide	= ohare_mb_un_reset_ide,
 };
 
-static struct mb_ops heathrow_mb_ops = {
+static const struct mb_ops heathrow_mb_ops = {
 	.name		= "Heathrow",
 	.content	= heathrow_mb_content,
 	.power		= heathrow_mb_power,
@@ -687,7 +687,7 @@ static struct mb_ops heathrow_mb_ops = {
 	.un_reset_ide	= heathrow_mb_un_reset_ide,
 };
 
-static struct mb_ops keylargo_mb_ops = {
+static const struct mb_ops keylargo_mb_ops = {
 	.name		= "KeyLargo",
 	.init		= keylargo_mb_init,
 	.content	= keylargo_mb_content,
diff --git a/drivers/mfd/da9052-i2c.c b/drivers/mfd/da9052-i2c.c
index 82c9d64..352c58b 100644
--- a/drivers/mfd/da9052-i2c.c
+++ b/drivers/mfd/da9052-i2c.c
@@ -46,7 +46,7 @@ static int da9052_i2c_enable_multiwrite(struct da9052 *da9052)
 	return 0;
 }
 
-static struct i2c_device_id da9052_i2c_id[] = {
+static const struct i2c_device_id da9052_i2c_id[] = {
 	{"da9052", DA9052},
 	{"da9053-aa", DA9053_AA},
 	{"da9053-ba", DA9053_BA},
@@ -104,7 +104,7 @@ static int __devinit da9052_i2c_probe(struct i2c_client *client,
 		const struct of_device_id *deviceid;
 
 		deviceid = of_match_node(dialog_dt_ids, np);
-		id = (const struct i2c_device_id *)deviceid->data;
+		id = deviceid->data;
 	}
 #endif
 
diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
index 5caa572..8a8df82 100644
--- a/drivers/net/can/mscan/mpc5xxx_can.c
+++ b/drivers/net/can/mscan/mpc5xxx_can.c
@@ -251,7 +251,7 @@ static struct of_device_id mpc5xxx_can_table[];
 static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev)
 {
 	const struct of_device_id *match;
-	struct mpc5xxx_can_data *data;
+	const struct mpc5xxx_can_data *data;
 	struct device_node *np = ofdev->dev.of_node;
 	struct net_device *dev;
 	struct mscan_priv *priv;
@@ -380,12 +380,12 @@ static int mpc5xxx_can_resume(struct platform_device *ofdev)
 }
 #endif
 
-static struct mpc5xxx_can_data __devinitdata mpc5200_can_data = {
+static const struct mpc5xxx_can_data __devinitdata mpc5200_can_data = {
 	.type = MSCAN_TYPE_MPC5200,
 	.get_clock = mpc52xx_can_get_clock,
 };
 
-static struct mpc5xxx_can_data __devinitdata mpc5121_can_data = {
+static const struct mpc5xxx_can_data __devinitdata mpc5121_can_data = {
 	.type = MSCAN_TYPE_MPC5121,
 	.get_clock = mpc512x_can_get_clock,
 };
diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c
index b191dd5..53ed15b 100644
--- a/drivers/scsi/qlogicpti.c
+++ b/drivers/scsi/qlogicpti.c
@@ -1305,7 +1305,7 @@ static int __devinit qpti_sbus_probe(struct platform_device *op)
 	match = of_match_device(qpti_match, &op->dev);
 	if (!match)
 		return -EINVAL;
-	tpnt = match->data;
+	tpnt = (void *)match->data;
 
 	/* Sometimes Antares cards come up not completely
 	 * setup, and we get a report of a zero IRQ.
diff --git a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c
index 40f7bf1..e6a038a 100644
--- a/drivers/watchdog/mpc8xxx_wdt.c
+++ b/drivers/watchdog/mpc8xxx_wdt.c
@@ -193,7 +193,7 @@ static int __devinit mpc8xxx_wdt_probe(struct platform_device *ofdev)
 	int ret;
 	const struct of_device_id *match;
 	struct device_node *np = ofdev->dev.of_node;
-	struct mpc8xxx_wdt_type *wdt_type;
+	const struct mpc8xxx_wdt_type *wdt_type;
 	u32 freq = fsl_get_sys_freq();
 	bool enabled;
 

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

* Re: [PATCH 00/11] make struct of_device_id.data const
  2012-07-13 16:24           ` Arnd Bergmann
@ 2012-07-13 17:49               ` Uwe Kleine-König
  -1 siblings, 0 replies; 57+ messages in thread
From: Uwe Kleine-König @ 2012-07-13 17:49 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ

Hello,

On Fri, Jul 13, 2012 at 04:24:26PM +0000, Arnd Bergmann wrote:
> On Friday 13 July 2012, Uwe Kleine-König wrote:
> > On Fri, Jul 13, 2012 at 07:41:02AM -0500, Rob Herring wrote:
> > > On 07/13/2012 07:32 AM, y@pengutronix.de wrote:
> > > > From: Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > > > 
> > > > this series' goal is to make struct of_device_id.data const.
> > > > Conceptually a driver must not modify the data contained there so making
> > > > it const is the right thing.
> > > > 
> > > > This change might introduce warnings because drivers don't use const to
> > > > access the data pointed to by of_device_id.data. In most cases the fix
> > > > is to add some consts.
> > > > 
> > > > This series (apart from adding this const in patch 10) fixes all drivers
> > > > covered by all arm defconfigs (based on v3.5-rc6).
> > > > 
> > > 
> > > What about other arches?
> >
> > I didn't looked at them, mainly because I don't have the scripts for
> > arches other than arm to do such testing. Also note that it introduces
> > only some warnings, but no breakage. So adding the const in the merge
> > window might be ok?!
> 
> I think it makes sense to change the drivers that are easy to find now:
> 
> git grep -A6 of_device_id | grep '\<data\>.*='  | brain
> 
> arch/c6x/platforms/plldata.c-   { .compatible = "ti,c6455-pll", .data = c6455_setup_clocks },
> arch/mips/lantiq/irq.c- { .compatible = "lantiq,icu", .data = icu_of_init },
> arch/powerpc/platforms/83xx/suspend.c-          .data = &pmc_types[0],
> arch/powerpc/platforms/cell/celleb_pci.c-               .data = &celleb_fake_pci_spec,
> arch/powerpc/platforms/cell/celleb_pci.c-               .data = &celleb_epci_spec,
> arch/powerpc/sysdev/fsl_msi.c-          .data = (void *)&mpic_msi_feature,
> drivers/atm/fore200e.c-         .data = (void *) &fore200e_bus[1],
> drivers/char/xilinx_hwicap/xilinx_hwicap.c-     { .compatible = "xlnx,opb-hwicap-1.00.b", .data = &buffer_icap_config},
> drivers/i2c/busses/i2c-mpc.c-   {.compatible = "mpc5200-i2c", .data = &mpc_i2c_data_52xx, },
> drivers/macintosh/mediabay.c-   .data           = &keylargo_mb_ops,
> drivers/mfd/da9052-i2c.c-       { .compatible = "dlg,da9053-aa", .data = &da9052_i2c_id[1] },
> drivers/net/can/mscan/mpc5xxx_can.c-    { .compatible = "fsl,mpc5200-mscan", .data = &mpc5200_can_data, },
> drivers/scsi/qlogicpti.c-               .data = &qpti_template,
> drivers/usb/host/fsl-mph-dr-of.c-       { .compatible = "fsl-usb2-mph", .data = &fsl_usb2_mpc8xxx_pd, },
> drivers/watchdog/mpc8xxx_wdt.c-         .data = &(struct mpc8xxx_wdt_type) {
> 
> I'm optimistic that this list covers the vast majority of the non-ARM
> drivers, and some of them don't even need any changes. I've done
> patches for the others below.
> 
> Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
> ---
>  arch/powerpc/platforms/83xx/suspend.c    |    2 +-
>  arch/powerpc/platforms/cell/celleb_pci.c |    2 +-
>  arch/powerpc/sysdev/fsl_msi.c            |    8 ++++----
>  drivers/i2c/busses/i2c-mpc.c             |   12 ++++++------
>  drivers/macintosh/mediabay.c             |    8 ++++----
>  drivers/mfd/da9052-i2c.c                 |    4 ++--
>  drivers/net/can/mscan/mpc5xxx_can.c      |    6 +++---
>  drivers/scsi/qlogicpti.c                 |    2 +-
>  drivers/watchdog/mpc8xxx_wdt.c           |    2 +-
>  10 files changed, 23 insertions(+), 26 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c
> index 1a04671..1d769a2 100644
> --- a/arch/powerpc/platforms/83xx/suspend.c
> +++ b/arch/powerpc/platforms/83xx/suspend.c
> @@ -326,7 +326,7 @@ static int pmc_probe(struct platform_device *ofdev)
>  	const struct of_device_id *match;
>  	struct device_node *np = ofdev->dev.of_node;
>  	struct resource res;
> -	struct pmc_type *type;
> +	const struct pmc_type *type;
>  	int ret = 0;
>  
>  	match = of_match_device(pmc_match, &ofdev->dev);
> diff --git a/arch/powerpc/platforms/cell/celleb_pci.c b/arch/powerpc/platforms/cell/celleb_pci.c
> index 5822141..abc8af4 100644
> --- a/arch/powerpc/platforms/cell/celleb_pci.c
> +++ b/arch/powerpc/platforms/cell/celleb_pci.c
> @@ -472,7 +472,7 @@ int __init celleb_setup_phb(struct pci_controller *phb)
>  {
>  	struct device_node *dev = phb->dn;
>  	const struct of_device_id *match;
> -	struct celleb_phb_spec *phb_spec;
> +	const struct celleb_phb_spec *phb_spec;
>  	int rc;
>  
>  	match = of_match_node(celleb_phb_match, dev);
> diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
> index 6e097de..51ffafa 100644
> --- a/arch/powerpc/sysdev/fsl_msi.c
> +++ b/arch/powerpc/sysdev/fsl_msi.c
> @@ -368,7 +368,7 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev)
>  	int err, i, j, irq_index, count;
>  	int rc;
>  	const u32 *p;
> -	struct fsl_msi_feature *features;
> +	const struct fsl_msi_feature *features;
>  	int len;
>  	u32 offset;
>  	static const u32 all_avail[] = { 0, NR_MSI_IRQS };
> @@ -502,15 +502,15 @@ static const struct fsl_msi_feature vmpic_msi_feature = {
>  static const struct of_device_id fsl_of_msi_ids[] = {
>  	{
>  		.compatible = "fsl,mpic-msi",
> -		.data = (void *)&mpic_msi_feature,
> +		.data = &mpic_msi_feature,
This looks unrelated.

>  	},
>  	{
>  		.compatible = "fsl,ipic-msi",
> -		.data = (void *)&ipic_msi_feature,
> +		.data = &ipic_msi_feature,
>  	},
>  	{
>  		.compatible = "fsl,vmpic-msi",
> -		.data = (void *)&vmpic_msi_feature,
> +		.data = &vmpic_msi_feature,
>  	},
>  	{}
>  };
> diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
> index b76731e..57f7703 100644
> --- a/drivers/i2c/busses/i2c-mpc.c
> +++ b/drivers/i2c/busses/i2c-mpc.c
> @@ -647,7 +647,7 @@ static int __devinit fsl_i2c_probe(struct platform_device *op)
>  	}
>  
>  	if (match->data) {
> -		struct mpc_i2c_data *data = match->data;
> +		const struct mpc_i2c_data *data = match->data;
>  		data->setup(op->dev.of_node, i2c, clock, data->prescaler);
>  	} else {
>  		/* Backwards compatibility */
> @@ -730,24 +730,24 @@ static int mpc_i2c_resume(struct device *dev)
>  SIMPLE_DEV_PM_OPS(mpc_i2c_pm_ops, mpc_i2c_suspend, mpc_i2c_resume);
>  #endif
>  
> -static struct mpc_i2c_data mpc_i2c_data_512x __devinitdata = {
> +static const struct mpc_i2c_data mpc_i2c_data_512x __devinitdata = {
I guess this results in a warning until after patch 10 is applied? (A
few more down below.)

In the meantime I expanded my defconfig build script to handle powerpc,
too. I'll check these. I think I'll have to let the build run over
night...

Thanks Arnd for your effort.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* [PATCH 00/11] make struct of_device_id.data const
@ 2012-07-13 17:49               ` Uwe Kleine-König
  0 siblings, 0 replies; 57+ messages in thread
From: Uwe Kleine-König @ 2012-07-13 17:49 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

On Fri, Jul 13, 2012 at 04:24:26PM +0000, Arnd Bergmann wrote:
> On Friday 13 July 2012, Uwe Kleine-K?nig wrote:
> > On Fri, Jul 13, 2012 at 07:41:02AM -0500, Rob Herring wrote:
> > > On 07/13/2012 07:32 AM, y at pengutronix.de wrote:
> > > > From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
> > > > 
> > > > this series' goal is to make struct of_device_id.data const.
> > > > Conceptually a driver must not modify the data contained there so making
> > > > it const is the right thing.
> > > > 
> > > > This change might introduce warnings because drivers don't use const to
> > > > access the data pointed to by of_device_id.data. In most cases the fix
> > > > is to add some consts.
> > > > 
> > > > This series (apart from adding this const in patch 10) fixes all drivers
> > > > covered by all arm defconfigs (based on v3.5-rc6).
> > > > 
> > > 
> > > What about other arches?
> >
> > I didn't looked at them, mainly because I don't have the scripts for
> > arches other than arm to do such testing. Also note that it introduces
> > only some warnings, but no breakage. So adding the const in the merge
> > window might be ok?!
> 
> I think it makes sense to change the drivers that are easy to find now:
> 
> git grep -A6 of_device_id | grep '\<data\>.*='  | brain
> 
> arch/c6x/platforms/plldata.c-   { .compatible = "ti,c6455-pll", .data = c6455_setup_clocks },
> arch/mips/lantiq/irq.c- { .compatible = "lantiq,icu", .data = icu_of_init },
> arch/powerpc/platforms/83xx/suspend.c-          .data = &pmc_types[0],
> arch/powerpc/platforms/cell/celleb_pci.c-               .data = &celleb_fake_pci_spec,
> arch/powerpc/platforms/cell/celleb_pci.c-               .data = &celleb_epci_spec,
> arch/powerpc/sysdev/fsl_msi.c-          .data = (void *)&mpic_msi_feature,
> drivers/atm/fore200e.c-         .data = (void *) &fore200e_bus[1],
> drivers/char/xilinx_hwicap/xilinx_hwicap.c-     { .compatible = "xlnx,opb-hwicap-1.00.b", .data = &buffer_icap_config},
> drivers/i2c/busses/i2c-mpc.c-   {.compatible = "mpc5200-i2c", .data = &mpc_i2c_data_52xx, },
> drivers/macintosh/mediabay.c-   .data           = &keylargo_mb_ops,
> drivers/mfd/da9052-i2c.c-       { .compatible = "dlg,da9053-aa", .data = &da9052_i2c_id[1] },
> drivers/net/can/mscan/mpc5xxx_can.c-    { .compatible = "fsl,mpc5200-mscan", .data = &mpc5200_can_data, },
> drivers/scsi/qlogicpti.c-               .data = &qpti_template,
> drivers/usb/host/fsl-mph-dr-of.c-       { .compatible = "fsl-usb2-mph", .data = &fsl_usb2_mpc8xxx_pd, },
> drivers/watchdog/mpc8xxx_wdt.c-         .data = &(struct mpc8xxx_wdt_type) {
> 
> I'm optimistic that this list covers the vast majority of the non-ARM
> drivers, and some of them don't even need any changes. I've done
> patches for the others below.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/powerpc/platforms/83xx/suspend.c    |    2 +-
>  arch/powerpc/platforms/cell/celleb_pci.c |    2 +-
>  arch/powerpc/sysdev/fsl_msi.c            |    8 ++++----
>  drivers/i2c/busses/i2c-mpc.c             |   12 ++++++------
>  drivers/macintosh/mediabay.c             |    8 ++++----
>  drivers/mfd/da9052-i2c.c                 |    4 ++--
>  drivers/net/can/mscan/mpc5xxx_can.c      |    6 +++---
>  drivers/scsi/qlogicpti.c                 |    2 +-
>  drivers/watchdog/mpc8xxx_wdt.c           |    2 +-
>  10 files changed, 23 insertions(+), 26 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c
> index 1a04671..1d769a2 100644
> --- a/arch/powerpc/platforms/83xx/suspend.c
> +++ b/arch/powerpc/platforms/83xx/suspend.c
> @@ -326,7 +326,7 @@ static int pmc_probe(struct platform_device *ofdev)
>  	const struct of_device_id *match;
>  	struct device_node *np = ofdev->dev.of_node;
>  	struct resource res;
> -	struct pmc_type *type;
> +	const struct pmc_type *type;
>  	int ret = 0;
>  
>  	match = of_match_device(pmc_match, &ofdev->dev);
> diff --git a/arch/powerpc/platforms/cell/celleb_pci.c b/arch/powerpc/platforms/cell/celleb_pci.c
> index 5822141..abc8af4 100644
> --- a/arch/powerpc/platforms/cell/celleb_pci.c
> +++ b/arch/powerpc/platforms/cell/celleb_pci.c
> @@ -472,7 +472,7 @@ int __init celleb_setup_phb(struct pci_controller *phb)
>  {
>  	struct device_node *dev = phb->dn;
>  	const struct of_device_id *match;
> -	struct celleb_phb_spec *phb_spec;
> +	const struct celleb_phb_spec *phb_spec;
>  	int rc;
>  
>  	match = of_match_node(celleb_phb_match, dev);
> diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
> index 6e097de..51ffafa 100644
> --- a/arch/powerpc/sysdev/fsl_msi.c
> +++ b/arch/powerpc/sysdev/fsl_msi.c
> @@ -368,7 +368,7 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev)
>  	int err, i, j, irq_index, count;
>  	int rc;
>  	const u32 *p;
> -	struct fsl_msi_feature *features;
> +	const struct fsl_msi_feature *features;
>  	int len;
>  	u32 offset;
>  	static const u32 all_avail[] = { 0, NR_MSI_IRQS };
> @@ -502,15 +502,15 @@ static const struct fsl_msi_feature vmpic_msi_feature = {
>  static const struct of_device_id fsl_of_msi_ids[] = {
>  	{
>  		.compatible = "fsl,mpic-msi",
> -		.data = (void *)&mpic_msi_feature,
> +		.data = &mpic_msi_feature,
This looks unrelated.

>  	},
>  	{
>  		.compatible = "fsl,ipic-msi",
> -		.data = (void *)&ipic_msi_feature,
> +		.data = &ipic_msi_feature,
>  	},
>  	{
>  		.compatible = "fsl,vmpic-msi",
> -		.data = (void *)&vmpic_msi_feature,
> +		.data = &vmpic_msi_feature,
>  	},
>  	{}
>  };
> diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
> index b76731e..57f7703 100644
> --- a/drivers/i2c/busses/i2c-mpc.c
> +++ b/drivers/i2c/busses/i2c-mpc.c
> @@ -647,7 +647,7 @@ static int __devinit fsl_i2c_probe(struct platform_device *op)
>  	}
>  
>  	if (match->data) {
> -		struct mpc_i2c_data *data = match->data;
> +		const struct mpc_i2c_data *data = match->data;
>  		data->setup(op->dev.of_node, i2c, clock, data->prescaler);
>  	} else {
>  		/* Backwards compatibility */
> @@ -730,24 +730,24 @@ static int mpc_i2c_resume(struct device *dev)
>  SIMPLE_DEV_PM_OPS(mpc_i2c_pm_ops, mpc_i2c_suspend, mpc_i2c_resume);
>  #endif
>  
> -static struct mpc_i2c_data mpc_i2c_data_512x __devinitdata = {
> +static const struct mpc_i2c_data mpc_i2c_data_512x __devinitdata = {
I guess this results in a warning until after patch 10 is applied? (A
few more down below.)

In the meantime I expanded my defconfig build script to handle powerpc,
too. I'll check these. I think I'll have to let the build run over
night...

Thanks Arnd for your effort.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: [PATCH 00/11] make struct of_device_id.data const
  2012-07-13 17:49               ` Uwe Kleine-König
@ 2012-07-13 18:56                   ` Arnd Bergmann
  -1 siblings, 0 replies; 57+ messages in thread
From: Arnd Bergmann @ 2012-07-13 18:56 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ

On Friday 13 July 2012, Uwe Kleine-König wrote:
> > @@ -502,15 +502,15 @@ static const struct fsl_msi_feature vmpic_msi_feature = {
> >  static const struct of_device_id fsl_of_msi_ids[] = {
> >       {
> >               .compatible = "fsl,mpic-msi",
> > -             .data = (void *)&mpic_msi_feature,
> > +             .data = &mpic_msi_feature,
> This looks unrelated.
> 


Well, the cast to (void *) was used to cast away the const-ness of the
"static const struct fsl_msi_feature mpic_msi_feature", so that is no
longer needed after the last patch.

	Arnd.

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

* [PATCH 00/11] make struct of_device_id.data const
@ 2012-07-13 18:56                   ` Arnd Bergmann
  0 siblings, 0 replies; 57+ messages in thread
From: Arnd Bergmann @ 2012-07-13 18:56 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 13 July 2012, Uwe Kleine-K?nig wrote:
> > @@ -502,15 +502,15 @@ static const struct fsl_msi_feature vmpic_msi_feature = {
> >  static const struct of_device_id fsl_of_msi_ids[] = {
> >       {
> >               .compatible = "fsl,mpic-msi",
> > -             .data = (void *)&mpic_msi_feature,
> > +             .data = &mpic_msi_feature,
> This looks unrelated.
> 


Well, the cast to (void *) was used to cast away the const-ness of the
"static const struct fsl_msi_feature mpic_msi_feature", so that is no
longer needed after the last patch.

	Arnd.

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

* Re: [PATCH 00/11] make struct of_device_id.data const
  2012-07-13 12:41   ` Rob Herring
@ 2012-07-13 19:36       ` Grant Likely
  -1 siblings, 0 replies; 57+ messages in thread
From: Grant Likely @ 2012-07-13 19:36 UTC (permalink / raw)
  To: Rob Herring
  Cc: y, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ, Uwe Kleine-König,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Fri, Jul 13, 2012 at 6:41 AM, Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On 07/13/2012 07:32 AM, y@pengutronix.de wrote:
>> From: Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
>>
>> Hello,
>>
>> this series' goal is to make struct of_device_id.data const.
>> Conceptually a driver must not modify the data contained there so making
>> it const is the right thing.
>>
>> This change might introduce warnings because drivers don't use const to
>> access the data pointed to by of_device_id.data. In most cases the fix
>> is to add some consts.
>>
>> This series (apart from adding this const in patch 10) fixes all drivers
>> covered by all arm defconfigs (based on v3.5-rc6).
>>
>
> What about other arches?

This whole series is of questionable value to me.  While I agree that
.data should be const, I don't think changing it has is measurably
better than what we have now.  Particularly when the series isn't
complete for all users.  And "building all defconfigs" is not the
right way to look for affected users.

g.

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

* [PATCH 00/11] make struct of_device_id.data const
@ 2012-07-13 19:36       ` Grant Likely
  0 siblings, 0 replies; 57+ messages in thread
From: Grant Likely @ 2012-07-13 19:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jul 13, 2012 at 6:41 AM, Rob Herring <robherring2@gmail.com> wrote:
> On 07/13/2012 07:32 AM, y at pengutronix.de wrote:
>> From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
>>
>> Hello,
>>
>> this series' goal is to make struct of_device_id.data const.
>> Conceptually a driver must not modify the data contained there so making
>> it const is the right thing.
>>
>> This change might introduce warnings because drivers don't use const to
>> access the data pointed to by of_device_id.data. In most cases the fix
>> is to add some consts.
>>
>> This series (apart from adding this const in patch 10) fixes all drivers
>> covered by all arm defconfigs (based on v3.5-rc6).
>>
>
> What about other arches?

This whole series is of questionable value to me.  While I agree that
.data should be const, I don't think changing it has is measurably
better than what we have now.  Particularly when the series isn't
complete for all users.  And "building all defconfigs" is not the
right way to look for affected users.

g.

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

* Re: [PATCH 00/11] make struct of_device_id.data const
  2012-07-13 17:49               ` Uwe Kleine-König
@ 2012-07-13 19:48                   ` Rob Herring
  -1 siblings, 0 replies; 57+ messages in thread
From: Rob Herring @ 2012-07-13 19:48 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 07/13/2012 12:49 PM, Uwe Kleine-König wrote:

[snip]

> I guess this results in a warning until after patch 10 is applied? (A
> few more down below.)
> 
> In the meantime I expanded my defconfig build script to handle powerpc,
> too. I'll check these. I think I'll have to let the build run over
> night...

I'm not certain but just an allyesconfig build on powerpc should be
sufficient rather than building defconfigs. We still dream about doing
that on ARM.

Rob

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

* [PATCH 00/11] make struct of_device_id.data const
@ 2012-07-13 19:48                   ` Rob Herring
  0 siblings, 0 replies; 57+ messages in thread
From: Rob Herring @ 2012-07-13 19:48 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/13/2012 12:49 PM, Uwe Kleine-K?nig wrote:

[snip]

> I guess this results in a warning until after patch 10 is applied? (A
> few more down below.)
> 
> In the meantime I expanded my defconfig build script to handle powerpc,
> too. I'll check these. I think I'll have to let the build run over
> night...

I'm not certain but just an allyesconfig build on powerpc should be
sufficient rather than building defconfigs. We still dream about doing
that on ARM.

Rob

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

* Re: [PATCH 00/11] make struct of_device_id.data const
  2012-07-13 19:36       ` Grant Likely
@ 2012-07-14 18:31           ` Uwe Kleine-König
  -1 siblings, 0 replies; 57+ messages in thread
From: Uwe Kleine-König @ 2012-07-14 18:31 UTC (permalink / raw)
  To: Grant Likely
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ

Hello Grant,

On Fri, Jul 13, 2012 at 01:36:59PM -0600, Grant Likely wrote:
> On Fri, Jul 13, 2012 at 6:41 AM, Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > On 07/13/2012 07:32 AM, y@pengutronix.de wrote:
> >> this series' goal is to make struct of_device_id.data const.
> >> Conceptually a driver must not modify the data contained there so making
> >> it const is the right thing.
> >>
> >> This change might introduce warnings because drivers don't use const to
> >> access the data pointed to by of_device_id.data. In most cases the fix
> >> is to add some consts.
> >>
> >> This series (apart from adding this const in patch 10) fixes all drivers
> >> covered by all arm defconfigs (based on v3.5-rc6).
> >>
> >
> > What about other arches?
> 
> This whole series is of questionable value to me.  While I agree that
> .data should be const, I don't think changing it has is measurably
> better than what we have now.  Particularly when the series isn't
> complete for all users.  And "building all defconfigs" is not the
> right way to look for affected users.
As it's not really bad if a user isn't fixed (it only introduces a
compiler warning) I think not being 100% sure to have fixed all of them
is OK. I plan to check the defconfigs and an allyes build on powerpc and
look over the patch that Arnd sent. IMHO this is enough to go on.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* [PATCH 00/11] make struct of_device_id.data const
@ 2012-07-14 18:31           ` Uwe Kleine-König
  0 siblings, 0 replies; 57+ messages in thread
From: Uwe Kleine-König @ 2012-07-14 18:31 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Grant,

On Fri, Jul 13, 2012 at 01:36:59PM -0600, Grant Likely wrote:
> On Fri, Jul 13, 2012 at 6:41 AM, Rob Herring <robherring2@gmail.com> wrote:
> > On 07/13/2012 07:32 AM, y at pengutronix.de wrote:
> >> this series' goal is to make struct of_device_id.data const.
> >> Conceptually a driver must not modify the data contained there so making
> >> it const is the right thing.
> >>
> >> This change might introduce warnings because drivers don't use const to
> >> access the data pointed to by of_device_id.data. In most cases the fix
> >> is to add some consts.
> >>
> >> This series (apart from adding this const in patch 10) fixes all drivers
> >> covered by all arm defconfigs (based on v3.5-rc6).
> >>
> >
> > What about other arches?
> 
> This whole series is of questionable value to me.  While I agree that
> .data should be const, I don't think changing it has is measurably
> better than what we have now.  Particularly when the series isn't
> complete for all users.  And "building all defconfigs" is not the
> right way to look for affected users.
As it's not really bad if a user isn't fixed (it only introduces a
compiler warning) I think not being 100% sure to have fixed all of them
is OK. I plan to check the defconfigs and an allyes build on powerpc and
look over the patch that Arnd sent. IMHO this is enough to go on.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: [PATCH 07/11] dmaengine: at_hdmac: add a few const qualifiers
  2012-07-13 12:32 ` [PATCH 07/11] dmaengine: at_hdmac: add a few const qualifiers y at pengutronix.de
@ 2012-07-16  6:38     ` Vinod Koul
  2012-07-16  6:38     ` Vinod Koul
  1 sibling, 0 replies; 57+ messages in thread
From: Vinod Koul @ 2012-07-16  6:38 UTC (permalink / raw)
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Rob Herring,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ, Uwe Kleine-König,
	Dan Williams, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Fri, 2012-07-13 at 14:32 +0200, y@pengutronix.de wrote:
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> This prepares of_device_id.data becoming const. Without this change
> the following warning would occur:
> 
> 	drivers/dma/at_hdmac.c: In function 'at_dma_get_driver_data':
> 	drivers/dma/at_hdmac.c:1228: warning: return discards qualifiers from pointer target type
Applied, thanks.

By now, you should know git-send-mail asks for sender name and don't hit
"y". Bitten once, am careful about it :D

-- 
~Vinod

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

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

* [PATCH 07/11] dmaengine: at_hdmac: add a few const qualifiers
@ 2012-07-16  6:38     ` Vinod Koul
  0 siblings, 0 replies; 57+ messages in thread
From: Vinod Koul @ 2012-07-16  6:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 2012-07-13 at 14:32 +0200, y at pengutronix.de wrote:
> From: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
> 
> This prepares of_device_id.data becoming const. Without this change
> the following warning would occur:
> 
> 	drivers/dma/at_hdmac.c: In function 'at_dma_get_driver_data':
> 	drivers/dma/at_hdmac.c:1228: warning: return discards qualifiers from pointer target type
Applied, thanks.

By now, you should know git-send-mail asks for sender name and don't hit
"y". Bitten once, am careful about it :D

-- 
~Vinod

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

* [PATCH 00/11] make struct of_device_id.data const
@ 2012-07-13 12:32 y
  0 siblings, 0 replies; 57+ messages in thread
From: y @ 2012-07-13 12:32 UTC (permalink / raw)
  To: Grant Likely, Arnd Bergmann
  Cc: devicetree-discuss, Rob Herring, linux-arm-kernel, kernel,
	Uwe Kleine-König

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Hello,

this series' goal is to make struct of_device_id.data const.
Conceptually a driver must not modify the data contained there so making
it const is the right thing.

This change might introduce warnings because drivers don't use const to
access the data pointed to by of_device_id.data. In most cases the fix
is to add some consts.

This series (apart from adding this const in patch 10) fixes all drivers
covered by all arm defconfigs (based on v3.5-rc6).

There is one exception though:
drivers/regulator/twl-regulator.c (build in omap2plus_defconfig) now
issues:

	drivers/regulator/twl-regulator.c: In function 'twlreg_probe':
	drivers/regulator/twl-regulator.c:1181: warning: assignment discards qualifiers from pointer target type
	drivers/regulator/twl-regulator.c:1190: warning: assignment discards qualifiers from pointer target type

that is because this driver really modifies his .of_match_table in the
precence of a traditionally probed device.
I didn't check deeply, but probably the easiest fix is to remove
traditional platform support. Don't know if omap is ready for that
though.

And also patch 11 adds some more consts that are possible now after
patch 10.

This series is available in my git tree at:

	git://git.pengutronix.de/git/ukl/linux.git ofdeviceiddata

Best regards
Uwe

Uwe Kleine-König (11):
  spi/imx: make spi_imx_data.devtype_data member point to const data
  serial/imx: make imx_port.devdata member point to const data
  ARM: cache-l2x0: add a const qualifier
  misc/atmel_tc: make atmel_tc.tcb_config member point to const data
  gpio/gpio-omap.c: add a const qualifier
  i2c/i2c-omap: add a const qualifier
  dmaengine: at_hdmac: add a few const qualifiers
  spi/spi-omap2-mcspi: add a const qualifier
  mmc/omap_hsmmc: add a const qualifier
  of: add const to struct of_device_id.data
  gpio/gpio-omap: make platformdata used as of_device_id.data const

 arch/arm/mm/cache-l2x0.c        |    2 +-
 drivers/dma/at_hdmac.c          |    4 ++--
 drivers/gpio/gpio-omap.c        |    8 ++++----
 drivers/i2c/busses/i2c-omap.c   |    3 ++-
 drivers/mmc/host/omap_hsmmc.c   |    2 +-
 drivers/spi/spi-imx.c           |    2 +-
 drivers/spi/spi-omap2-mcspi.c   |    2 +-
 drivers/tty/serial/imx.c        |    2 +-
 include/linux/atmel_tc.h        |    2 +-
 include/linux/mod_devicetable.h |    2 +-
 10 files changed, 15 insertions(+), 14 deletions(-)

-- 
1.7.10.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2012-07-16  6:38 UTC | newest]

Thread overview: 57+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-13 12:32 [PATCH 00/11] make struct of_device_id.data const y at pengutronix.de
2012-07-13 12:32 ` [PATCH 0/9] " y at pengutronix.de
2012-07-13 12:32 ` y
2012-07-13 12:32 ` [PATCH 01/11] spi/imx: make spi_imx_data.devtype_data member point to const data y
2012-07-13 12:32 ` y
2012-07-13 12:32 ` y at pengutronix.de
2012-07-13 12:32 ` [PATCH 02/11] serial/imx: make imx_port.devdata " y
2012-07-13 12:32 ` y
2012-07-13 12:32 ` y at pengutronix.de
2012-07-13 12:32 ` [PATCH 03/11] ARM: cache-l2x0: add a const qualifier y at pengutronix.de
2012-07-13 12:32 ` y
2012-07-13 12:32 ` [PATCH 04/11] misc/atmel_tc: make atmel_tc.tcb_config member point to const data y
2012-07-13 12:32 ` y at pengutronix.de
2012-07-13 13:40   ` Nicolas Ferre
2012-07-13 13:40     ` Nicolas Ferre
2012-07-13 12:32 ` [PATCH 05/11] gpio/gpio-omap.c: add a const qualifier y at pengutronix.de
2012-07-13 12:32 ` y
2012-07-13 12:32 ` [PATCH 06/11] i2c/i2c-omap: " y
2012-07-13 12:32 ` y
2012-07-13 12:32 ` y
2012-07-13 12:32 ` y at pengutronix.de
2012-07-13 12:32 ` [PATCH 07/11] dmaengine: at_hdmac: add a few const qualifiers y at pengutronix.de
2012-07-13 13:54   ` Nicolas Ferre
2012-07-13 13:54     ` Nicolas Ferre
2012-07-16  6:38   ` Vinod Koul
2012-07-16  6:38     ` Vinod Koul
2012-07-13 12:32 ` y
2012-07-13 12:32 ` [PATCH 08/11] spi/spi-omap2-mcspi: add a const qualifier y
2012-07-13 12:32 ` y at pengutronix.de
2012-07-13 12:32 ` y
2012-07-13 12:32 ` [PATCH 09/11] mmc/omap_hsmmc: " y at pengutronix.de
2012-07-13 12:32 ` y
2012-07-13 12:32 ` y
2012-07-13 12:32 ` y
2012-07-13 12:32 ` [PATCH 10/11] of: add const to struct of_device_id.data y at pengutronix.de
2012-07-13 12:32 ` y
2012-07-13 12:32 ` [PATCH 11/11] gpio/gpio-omap: make platformdata used as of_device_id.data const y at pengutronix.de
2012-07-13 12:32 ` y
2012-07-13 12:39 ` [PATCH 00/11] make struct " Uwe Kleine-König
2012-07-13 12:39   ` Uwe Kleine-König
2012-07-13 12:41 ` Rob Herring
2012-07-13 12:41   ` Rob Herring
     [not found]   ` <5000175E.4070702-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-07-13 13:46     ` Uwe Kleine-König
2012-07-13 13:46       ` Uwe Kleine-König
     [not found]       ` <20120713134638.GH592-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-07-13 16:24         ` Arnd Bergmann
2012-07-13 16:24           ` Arnd Bergmann
     [not found]           ` <201207131624.27266.arnd-r2nGTMty4D4@public.gmane.org>
2012-07-13 17:49             ` Uwe Kleine-König
2012-07-13 17:49               ` Uwe Kleine-König
     [not found]               ` <20120713174935.GN592-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-07-13 18:56                 ` Arnd Bergmann
2012-07-13 18:56                   ` Arnd Bergmann
2012-07-13 19:48                 ` Rob Herring
2012-07-13 19:48                   ` Rob Herring
2012-07-13 19:36     ` Grant Likely
2012-07-13 19:36       ` Grant Likely
     [not found]       ` <CACxGe6tXvz+rt2yrHHaD=j94-=JQEh06sHW0FWGiHb2=9GS2pA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-14 18:31         ` Uwe Kleine-König
2012-07-14 18:31           ` Uwe Kleine-König
  -- strict thread matches above, loose matches on Subject: below --
2012-07-13 12:32 y

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.