Commit 0763ed2355198cdef2f6a2098e9d52eb1fe4365d
Committed by
Linus Torvalds
1 parent
74641f584d
Exists in
master
and in
7 other branches
of: make of_(un)register_platform_driver common code
Some drivers using of_register_platform_driver() wrapper break on sparc because the wrapper isn't in the header file. This patch moves it from Microblaze and PowerPC implementations and makes it common code. Fixes this sparc64 allmodconfig build error (at least): drivers/leds/leds-gpio.c: In function `gpio_led_init': drivers/leds/leds-gpio.c:295: error: implicit declaration of function `of_register_platform_driver' drivers/leds/leds-gpio.c: In function `gpio_led_exit': drivers/leds/leds-gpio.c:311: error: implicit declaration of function `of_unregister_platform_driver' Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: David S. Miller <davem@davemloft.net> Cc: Michal Simek <monstr@monstr.eu> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 3 changed files with 10 additions and 20 deletions Side-by-side Diff
arch/microblaze/include/asm/of_platform.h
... | ... | @@ -36,16 +36,6 @@ |
36 | 36 | {}, |
37 | 37 | }; |
38 | 38 | |
39 | -/* Platform drivers register/unregister */ | |
40 | -static inline int of_register_platform_driver(struct of_platform_driver *drv) | |
41 | -{ | |
42 | - return of_register_driver(drv, &of_platform_bus_type); | |
43 | -} | |
44 | -static inline void of_unregister_platform_driver(struct of_platform_driver *drv) | |
45 | -{ | |
46 | - of_unregister_driver(drv); | |
47 | -} | |
48 | - | |
49 | 39 | /* Platform devices and busses creation */ |
50 | 40 | extern struct of_device *of_platform_device_create(struct device_node *np, |
51 | 41 | const char *bus_id, |
arch/powerpc/include/asm/of_platform.h
... | ... | @@ -11,16 +11,6 @@ |
11 | 11 | * |
12 | 12 | */ |
13 | 13 | |
14 | -/* Platform drivers register/unregister */ | |
15 | -static inline int of_register_platform_driver(struct of_platform_driver *drv) | |
16 | -{ | |
17 | - return of_register_driver(drv, &of_platform_bus_type); | |
18 | -} | |
19 | -static inline void of_unregister_platform_driver(struct of_platform_driver *drv) | |
20 | -{ | |
21 | - of_unregister_driver(drv); | |
22 | -} | |
23 | - | |
24 | 14 | /* Platform devices and busses creation */ |
25 | 15 | extern struct of_device *of_platform_device_create(struct device_node *np, |
26 | 16 | const char *bus_id, |
include/linux/of_platform.h
... | ... | @@ -51,6 +51,16 @@ |
51 | 51 | struct bus_type *bus); |
52 | 52 | extern void of_unregister_driver(struct of_platform_driver *drv); |
53 | 53 | |
54 | +/* Platform drivers register/unregister */ | |
55 | +static inline int of_register_platform_driver(struct of_platform_driver *drv) | |
56 | +{ | |
57 | + return of_register_driver(drv, &of_platform_bus_type); | |
58 | +} | |
59 | +static inline void of_unregister_platform_driver(struct of_platform_driver *drv) | |
60 | +{ | |
61 | + of_unregister_driver(drv); | |
62 | +} | |
63 | + | |
54 | 64 | #include <asm/of_platform.h> |
55 | 65 | |
56 | 66 | extern struct of_device *of_find_device_by_node(struct device_node *np); |