Commit 0b7f1a7efb38b551f5948a13d0b36e876ba536db
1 parent
adbf6e6952
Exists in
master
and in
20 other branches
platform: Make platform resource input parameters const
Make the platform resource input parameters of platform_device_add_resources() and platform_device_register_simple() const, as the resources are copied and never modified. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 2 changed files with 6 additions and 4 deletions Side-by-side Diff
drivers/base/platform.c
... | ... | @@ -187,7 +187,7 @@ |
187 | 187 | * released. |
188 | 188 | */ |
189 | 189 | int platform_device_add_resources(struct platform_device *pdev, |
190 | - struct resource *res, unsigned int num) | |
190 | + const struct resource *res, unsigned int num) | |
191 | 191 | { |
192 | 192 | struct resource *r; |
193 | 193 | |
... | ... | @@ -367,7 +367,7 @@ |
367 | 367 | */ |
368 | 368 | struct platform_device *platform_device_register_simple(const char *name, |
369 | 369 | int id, |
370 | - struct resource *res, | |
370 | + const struct resource *res, | |
371 | 371 | unsigned int num) |
372 | 372 | { |
373 | 373 | struct platform_device *pdev; |
include/linux/platform_device.h
... | ... | @@ -44,12 +44,14 @@ |
44 | 44 | extern int platform_add_devices(struct platform_device **, int); |
45 | 45 | |
46 | 46 | extern struct platform_device *platform_device_register_simple(const char *, int id, |
47 | - struct resource *, unsigned int); | |
47 | + const struct resource *, unsigned int); | |
48 | 48 | extern struct platform_device *platform_device_register_data(struct device *, |
49 | 49 | const char *, int, const void *, size_t); |
50 | 50 | |
51 | 51 | extern struct platform_device *platform_device_alloc(const char *name, int id); |
52 | -extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num); | |
52 | +extern int platform_device_add_resources(struct platform_device *pdev, | |
53 | + const struct resource *res, | |
54 | + unsigned int num); | |
53 | 55 | extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size); |
54 | 56 | extern int platform_device_add(struct platform_device *pdev); |
55 | 57 | extern void platform_device_del(struct platform_device *pdev); |