diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-18 17:39:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-18 17:39:44 -0400 |
commit | 9cf52b2921fbe62566b6b2ee79f71203749c9e5e (patch) | |
tree | 5705ab0af0adfb7043407b5a4ffbf43fcbff42bd /drivers | |
parent | 952184304fbf030f0133d8b66a91b2847dce729e (diff) | |
parent | 5c45708352a040f19caceb683c78bc86aad466f6 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
[SPARC/64]: Consolidate of_register_driver
[SPARC] Videopix Frame Grabber: Convert device_lock_sem to mutex
[SPARC]: Support for new termios.
[SPARC64]: Check of_get_property() return in pci_determine_mem_io_space().
[SPARC64]: Fix boot failures due to bootmem.
[SPARC64]: Implement atomic backoff.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/of/platform.c | 21 | ||||
-rw-r--r-- | drivers/sbus/char/vfc.h | 2 | ||||
-rw-r--r-- | drivers/sbus/char/vfc_dev.c | 5 |
3 files changed, 25 insertions, 3 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 864f09fd9f86..b47bb2d7476a 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c | |||
@@ -12,6 +12,7 @@ | |||
12 | * | 12 | * |
13 | */ | 13 | */ |
14 | #include <linux/errno.h> | 14 | #include <linux/errno.h> |
15 | #include <linux/module.h> | ||
15 | #include <linux/device.h> | 16 | #include <linux/device.h> |
16 | #include <linux/of_device.h> | 17 | #include <linux/of_device.h> |
17 | #include <linux/of_platform.h> | 18 | #include <linux/of_platform.h> |
@@ -94,3 +95,23 @@ int of_bus_type_init(struct bus_type *bus, const char *name) | |||
94 | bus->resume = of_platform_device_resume; | 95 | bus->resume = of_platform_device_resume; |
95 | return bus_register(bus); | 96 | return bus_register(bus); |
96 | } | 97 | } |
98 | |||
99 | int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus) | ||
100 | { | ||
101 | /* initialize common driver fields */ | ||
102 | if (!drv->driver.name) | ||
103 | drv->driver.name = drv->name; | ||
104 | if (!drv->driver.owner) | ||
105 | drv->driver.owner = drv->owner; | ||
106 | drv->driver.bus = bus; | ||
107 | |||
108 | /* register with core */ | ||
109 | return driver_register(&drv->driver); | ||
110 | } | ||
111 | EXPORT_SYMBOL(of_register_driver); | ||
112 | |||
113 | void of_unregister_driver(struct of_platform_driver *drv) | ||
114 | { | ||
115 | driver_unregister(&drv->driver); | ||
116 | } | ||
117 | EXPORT_SYMBOL(of_unregister_driver); | ||
diff --git a/drivers/sbus/char/vfc.h b/drivers/sbus/char/vfc.h index 63941a259b92..f1aa1389ea4a 100644 --- a/drivers/sbus/char/vfc.h +++ b/drivers/sbus/char/vfc.h | |||
@@ -126,7 +126,7 @@ struct vfc_dev { | |||
126 | volatile struct vfc_regs __iomem *regs; | 126 | volatile struct vfc_regs __iomem *regs; |
127 | struct vfc_regs *phys_regs; | 127 | struct vfc_regs *phys_regs; |
128 | unsigned int control_reg; | 128 | unsigned int control_reg; |
129 | struct semaphore device_lock_sem; | 129 | struct mutex device_lock_mtx; |
130 | int instance; | 130 | int instance; |
131 | int busy; | 131 | int busy; |
132 | unsigned long which_io; | 132 | unsigned long which_io; |
diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c index 9269f7fbd363..e7a1642b2aa4 100644 --- a/drivers/sbus/char/vfc_dev.c +++ b/drivers/sbus/char/vfc_dev.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/fs.h> | 22 | #include <linux/fs.h> |
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/spinlock.h> | 24 | #include <linux/spinlock.h> |
25 | #include <linux/mutex.h> | ||
25 | #include <linux/mm.h> | 26 | #include <linux/mm.h> |
26 | 27 | ||
27 | #include <asm/openprom.h> | 28 | #include <asm/openprom.h> |
@@ -54,12 +55,12 @@ static unsigned char saa9051_init_array[VFC_SAA9051_NR] = { | |||
54 | 55 | ||
55 | void vfc_lock_device(struct vfc_dev *dev) | 56 | void vfc_lock_device(struct vfc_dev *dev) |
56 | { | 57 | { |
57 | down(&dev->device_lock_sem); | 58 | mutex_lock(&dev->device_lock_mtx); |
58 | } | 59 | } |
59 | 60 | ||
60 | void vfc_unlock_device(struct vfc_dev *dev) | 61 | void vfc_unlock_device(struct vfc_dev *dev) |
61 | { | 62 | { |
62 | up(&dev->device_lock_sem); | 63 | mutex_unlock(&dev->device_lock_mtx); |
63 | } | 64 | } |
64 | 65 | ||
65 | 66 | ||