diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-05 12:42:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-05 12:42:59 -0500 |
commit | d9b2c4d0b03c721808c0d259e43a27f1e80205bc (patch) | |
tree | f17a4166f62ee14faa1401a6cbd353a4ab8c77cb /drivers/usb | |
parent | 27d16d08717faeaa8afd1b736a096dbaab90f08e (diff) | |
parent | 5fa9167a1bf5f5a4b7282f5e7ac56a4a5a1fa044 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: (50 commits)
pcmcia: rework the irq_req_t typedef
pcmcia: remove deprecated handle_to_dev() macro
pcmcia: pcmcia_request_window() doesn't need a pointer to a pointer
pcmcia: remove unused "window_t" typedef
pcmcia: move some window-related code to pcmcia_ioctl.c
pcmcia: Change window_handle_t logic to unsigned long
pcmcia: Pass struct pcmcia_socket to pcmcia_get_mem_page()
pcmcia: Pass struct pcmcia_device to pcmcia_map_mem_page()
pcmcia: Pass struct pcmcia_device to pcmcia_release_window()
drivers/pcmcia: remove unnecessary kzalloc
pcmcia: correct handling for Zoomed Video registers in topic.h
pcmcia: fix printk formats
pcmcia: autoload module pcmcia
pcmcia/staging: update comedi drivers
PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket
PCMCIA: ss: allow PCI IRQs > 255
PCMCIA: soc_common: remove 'dev' member from soc_pcmcia_socket
PCMCIA: soc_common: constify soc_pcmcia_socket ops member
PCMCIA: sa1111: remove duplicated initializers
PCMCIA: sa1111: wrap soc_pcmcia_socket to contain sa1111 specific data
...
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/sl811_cs.c | 49 |
1 files changed, 14 insertions, 35 deletions
diff --git a/drivers/usb/host/sl811_cs.c b/drivers/usb/host/sl811_cs.c index 516848dd9b48..39d253e841f6 100644 --- a/drivers/usb/host/sl811_cs.c +++ b/drivers/usb/host/sl811_cs.c | |||
@@ -37,28 +37,8 @@ MODULE_LICENSE("GPL"); | |||
37 | /* MACROS */ | 37 | /* MACROS */ |
38 | /*====================================================================*/ | 38 | /*====================================================================*/ |
39 | 39 | ||
40 | #if defined(DEBUG) || defined(PCMCIA_DEBUG) | ||
41 | |||
42 | static int pc_debug = 0; | ||
43 | module_param(pc_debug, int, 0644); | ||
44 | |||
45 | #define DBG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG "sl811_cs: " args) | ||
46 | |||
47 | #else | ||
48 | #define DBG(n, args...) do{}while(0) | ||
49 | #endif /* no debugging */ | ||
50 | |||
51 | #define INFO(args...) printk(KERN_INFO "sl811_cs: " args) | 40 | #define INFO(args...) printk(KERN_INFO "sl811_cs: " args) |
52 | 41 | ||
53 | #define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0444) | ||
54 | |||
55 | #define CS_CHECK(fn, ret) \ | ||
56 | do { \ | ||
57 | last_fn = (fn); \ | ||
58 | if ((last_ret = (ret)) != 0) \ | ||
59 | goto cs_failed; \ | ||
60 | } while (0) | ||
61 | |||
62 | /*====================================================================*/ | 42 | /*====================================================================*/ |
63 | /* VARIABLES */ | 43 | /* VARIABLES */ |
64 | /*====================================================================*/ | 44 | /*====================================================================*/ |
@@ -76,7 +56,7 @@ static void sl811_cs_release(struct pcmcia_device * link); | |||
76 | 56 | ||
77 | static void release_platform_dev(struct device * dev) | 57 | static void release_platform_dev(struct device * dev) |
78 | { | 58 | { |
79 | DBG(0, "sl811_cs platform_dev release\n"); | 59 | dev_dbg(dev, "sl811_cs platform_dev release\n"); |
80 | dev->parent = NULL; | 60 | dev->parent = NULL; |
81 | } | 61 | } |
82 | 62 | ||
@@ -140,7 +120,7 @@ static int sl811_hc_init(struct device *parent, resource_size_t base_addr, | |||
140 | 120 | ||
141 | static void sl811_cs_detach(struct pcmcia_device *link) | 121 | static void sl811_cs_detach(struct pcmcia_device *link) |
142 | { | 122 | { |
143 | DBG(0, "sl811_cs_detach(0x%p)\n", link); | 123 | dev_dbg(&link->dev, "sl811_cs_detach\n"); |
144 | 124 | ||
145 | sl811_cs_release(link); | 125 | sl811_cs_release(link); |
146 | 126 | ||
@@ -150,7 +130,7 @@ static void sl811_cs_detach(struct pcmcia_device *link) | |||
150 | 130 | ||
151 | static void sl811_cs_release(struct pcmcia_device * link) | 131 | static void sl811_cs_release(struct pcmcia_device * link) |
152 | { | 132 | { |
153 | DBG(0, "sl811_cs_release(0x%p)\n", link); | 133 | dev_dbg(&link->dev, "sl811_cs_release\n"); |
154 | 134 | ||
155 | pcmcia_disable_device(link); | 135 | pcmcia_disable_device(link); |
156 | platform_device_unregister(&platform_dev); | 136 | platform_device_unregister(&platform_dev); |
@@ -205,11 +185,11 @@ static int sl811_cs_config_check(struct pcmcia_device *p_dev, | |||
205 | 185 | ||
206 | static int sl811_cs_config(struct pcmcia_device *link) | 186 | static int sl811_cs_config(struct pcmcia_device *link) |
207 | { | 187 | { |
208 | struct device *parent = &handle_to_dev(link); | 188 | struct device *parent = &link->dev; |
209 | local_info_t *dev = link->priv; | 189 | local_info_t *dev = link->priv; |
210 | int last_fn, last_ret; | 190 | int ret; |
211 | 191 | ||
212 | DBG(0, "sl811_cs_config(0x%p)\n", link); | 192 | dev_dbg(&link->dev, "sl811_cs_config\n"); |
213 | 193 | ||
214 | if (pcmcia_loop_config(link, sl811_cs_config_check, NULL)) | 194 | if (pcmcia_loop_config(link, sl811_cs_config_check, NULL)) |
215 | goto failed; | 195 | goto failed; |
@@ -217,14 +197,16 @@ static int sl811_cs_config(struct pcmcia_device *link) | |||
217 | /* require an IRQ and two registers */ | 197 | /* require an IRQ and two registers */ |
218 | if (!link->io.NumPorts1 || link->io.NumPorts1 < 2) | 198 | if (!link->io.NumPorts1 || link->io.NumPorts1 < 2) |
219 | goto failed; | 199 | goto failed; |
220 | if (link->conf.Attributes & CONF_ENABLE_IRQ) | 200 | if (link->conf.Attributes & CONF_ENABLE_IRQ) { |
221 | CS_CHECK(RequestIRQ, | 201 | ret = pcmcia_request_irq(link, &link->irq); |
222 | pcmcia_request_irq(link, &link->irq)); | 202 | if (ret) |
223 | else | 203 | goto failed; |
204 | } else | ||
224 | goto failed; | 205 | goto failed; |
225 | 206 | ||
226 | CS_CHECK(RequestConfiguration, | 207 | ret = pcmcia_request_configuration(link, &link->conf); |
227 | pcmcia_request_configuration(link, &link->conf)); | 208 | if (ret) |
209 | goto failed; | ||
228 | 210 | ||
229 | sprintf(dev->node.dev_name, driver_name); | 211 | sprintf(dev->node.dev_name, driver_name); |
230 | dev->node.major = dev->node.minor = 0; | 212 | dev->node.major = dev->node.minor = 0; |
@@ -241,8 +223,6 @@ static int sl811_cs_config(struct pcmcia_device *link) | |||
241 | 223 | ||
242 | if (sl811_hc_init(parent, link->io.BasePort1, link->irq.AssignedIRQ) | 224 | if (sl811_hc_init(parent, link->io.BasePort1, link->irq.AssignedIRQ) |
243 | < 0) { | 225 | < 0) { |
244 | cs_failed: | ||
245 | cs_error(link, last_fn, last_ret); | ||
246 | failed: | 226 | failed: |
247 | printk(KERN_WARNING "sl811_cs_config failed\n"); | 227 | printk(KERN_WARNING "sl811_cs_config failed\n"); |
248 | sl811_cs_release(link); | 228 | sl811_cs_release(link); |
@@ -263,7 +243,6 @@ static int sl811_cs_probe(struct pcmcia_device *link) | |||
263 | 243 | ||
264 | /* Initialize */ | 244 | /* Initialize */ |
265 | link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; | 245 | link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; |
266 | link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID; | ||
267 | link->irq.Handler = NULL; | 246 | link->irq.Handler = NULL; |
268 | 247 | ||
269 | link->conf.Attributes = 0; | 248 | link->conf.Attributes = 0; |