devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of: add const to struct of_device_id.data
@ 2012-04-23  8:56 Uwe Kleine-König
       [not found] ` <1335171381-24869-1-git-send-email-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Uwe Kleine-König @ 2012-04-23  8:56 UTC (permalink / raw)
  To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Arnd Bergmann
  Cc: kernel-bIcnvbaLZ9MEGnE8C9+IrQ

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>
---
Hello,

this might introduce warnings in drivers that access the data member
without using const, so this is definitly merge window material if it is
considered at all.

Best regards
Uwe

 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 501da4c..183f411 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -222,7 +222,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

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

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

end of thread, other threads:[~2012-06-24 14:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-23  8:56 [PATCH] of: add const to struct of_device_id.data Uwe Kleine-König
     [not found] ` <1335171381-24869-1-git-send-email-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-05-18 14:43   ` Uwe Kleine-König
2012-05-21 19:49   ` [PATCH] spi/imx: make devtype_data member point to const data Uwe Kleine-König
     [not found]     ` <1337629775-9166-1-git-send-email-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-06-22  5:50       ` Uwe Kleine-König
2012-05-21 19:54   ` [PATCH] ARM: cache-l2x0: add a const qualifier Uwe Kleine-König
2012-05-21 19:57 ` [PATCH] serial/imx: make devdata member point to const data Uwe Kleine-König
2012-06-07 10:20 ` [PATCH RESEND] of: add const to struct of_device_id.data Uwe Kleine-König
2012-06-22  5:56   ` Uwe Kleine-König
2012-06-22 17:26     ` Arnd Bergmann
2012-06-24 14:43       ` Uwe Kleine-König

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