]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Driver core: Make platform_device_add_data accept a const pointer
authorScott Wood <scottwood@freescale.com>
Mon, 4 Dec 2006 22:57:19 +0000 (14:57 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 13 Dec 2006 23:38:46 +0000 (15:38 -0800)
platform_device_add_data() makes a copy of the data that is given to it,
and thus the parameter can be const.  This removes a warning when data
from get_property() on powerpc is handed to platform_device_add_data(),
as get_property() returns a const pointer.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/platform.c
include/linux/platform_device.h

index 0338289f9b5cf9b60fc519260eae598b745e7b4b..f9c903ba9fcd1259e37120e2db74d55c6acdcbce 100644 (file)
@@ -212,7 +212,7 @@ EXPORT_SYMBOL_GPL(platform_device_add_resources);
  *     pointer.  The memory associated with the platform data will be freed
  *     when the platform device is released.
  */
-int platform_device_add_data(struct platform_device *pdev, void *data, size_t size)
+int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size)
 {
        void *d;
 
index 20f47b81d3fad3055a1eb048d7acf47473596c72..8bbd459eafdcbd64532613e3b45820c6986373a2 100644 (file)
@@ -39,7 +39,7 @@ extern struct platform_device *platform_device_register_simple(char *, unsigned
 
 extern struct platform_device *platform_device_alloc(const char *name, unsigned int id);
 extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num);
-extern int platform_device_add_data(struct platform_device *pdev, void *data, size_t size);
+extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size);
 extern int platform_device_add(struct platform_device *pdev);
 extern void platform_device_del(struct platform_device *pdev);
 extern void platform_device_put(struct platform_device *pdev);