Commit 5c0784c350516856ed15deb6adf6b053bf427792
Committed by
Greg Kroah-Hartman
1 parent
306955be37
Exists in
master
and in
7 other branches
[PATCH] Add logic module bus_type probe/remove methods
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 1 changed file with 18 additions and 18 deletions Side-by-side Diff
arch/arm/mach-integrator/lm.c
... | ... | @@ -22,20 +22,6 @@ |
22 | 22 | return 1; |
23 | 23 | } |
24 | 24 | |
25 | -static struct bus_type lm_bustype = { | |
26 | - .name = "logicmodule", | |
27 | - .match = lm_match, | |
28 | -// .suspend = lm_suspend, | |
29 | -// .resume = lm_resume, | |
30 | -}; | |
31 | - | |
32 | -static int __init lm_init(void) | |
33 | -{ | |
34 | - return bus_register(&lm_bustype); | |
35 | -} | |
36 | - | |
37 | -postcore_initcall(lm_init); | |
38 | - | |
39 | 25 | static int lm_bus_probe(struct device *dev) |
40 | 26 | { |
41 | 27 | struct lm_device *lmdev = to_lm_device(dev); |
42 | 28 | |
43 | 29 | |
... | ... | @@ -49,16 +35,30 @@ |
49 | 35 | struct lm_device *lmdev = to_lm_device(dev); |
50 | 36 | struct lm_driver *lmdrv = to_lm_driver(dev->driver); |
51 | 37 | |
52 | - lmdrv->remove(lmdev); | |
38 | + if (lmdrv->remove) | |
39 | + lmdrv->remove(lmdev); | |
53 | 40 | return 0; |
54 | 41 | } |
55 | 42 | |
43 | +static struct bus_type lm_bustype = { | |
44 | + .name = "logicmodule", | |
45 | + .match = lm_match, | |
46 | + .probe = lm_bus_probe, | |
47 | + .remove = lm_bus_remove, | |
48 | +// .suspend = lm_bus_suspend, | |
49 | +// .resume = lm_bus_resume, | |
50 | +}; | |
51 | + | |
52 | +static int __init lm_init(void) | |
53 | +{ | |
54 | + return bus_register(&lm_bustype); | |
55 | +} | |
56 | + | |
57 | +postcore_initcall(lm_init); | |
58 | + | |
56 | 59 | int lm_driver_register(struct lm_driver *drv) |
57 | 60 | { |
58 | 61 | drv->drv.bus = &lm_bustype; |
59 | - drv->drv.probe = lm_bus_probe; | |
60 | - drv->drv.remove = lm_bus_remove; | |
61 | - | |
62 | 62 | return driver_register(&drv->drv); |
63 | 63 | } |
64 | 64 |