Skip to content

Commit

Permalink
Driver core: Make platform_device_add_data accept a const pointer
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Scott Wood authored and gregkh committed Dec 13, 2006
1 parent c63e078 commit 6eefd34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/base/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion include/linux/platform_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6eefd34

Please sign in to comment.