diff options
author | David S. Miller <davem@davemloft.net> | 2009-12-05 18:22:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-05 18:22:26 -0500 |
commit | 28b4d5cc17c20786848cdc07b7ea237a309776bb (patch) | |
tree | bae406a4b17229dcce7c11be5073f7a67665e477 /drivers/pcmcia/ds.c | |
parent | d29cecda036f251aee4947f47eea0fe9ed8cc931 (diff) | |
parent | 96fa2b508d2d3fe040cf4ef2fffb955f0a537ea1 (diff) |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts:
drivers/net/pcmcia/fmvj18x_cs.c
drivers/net/pcmcia/nmclan_cs.c
drivers/net/pcmcia/xirc2ps_cs.c
drivers/net/wireless/ray_cs.c
Diffstat (limited to 'drivers/pcmcia/ds.c')
-rw-r--r-- | drivers/pcmcia/ds.c | 188 |
1 files changed, 35 insertions, 153 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index f5b7079f13d3..05893d41dd41 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -41,129 +41,11 @@ MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>"); | |||
41 | MODULE_DESCRIPTION("PCMCIA Driver Services"); | 41 | MODULE_DESCRIPTION("PCMCIA Driver Services"); |
42 | MODULE_LICENSE("GPL"); | 42 | MODULE_LICENSE("GPL"); |
43 | 43 | ||
44 | #ifdef CONFIG_PCMCIA_DEBUG | ||
45 | int ds_pc_debug; | ||
46 | |||
47 | module_param_named(pc_debug, ds_pc_debug, int, 0644); | ||
48 | |||
49 | #define ds_dbg(lvl, fmt, arg...) do { \ | ||
50 | if (ds_pc_debug > (lvl)) \ | ||
51 | printk(KERN_DEBUG "ds: " fmt , ## arg); \ | ||
52 | } while (0) | ||
53 | #define ds_dev_dbg(lvl, dev, fmt, arg...) do { \ | ||
54 | if (ds_pc_debug > (lvl)) \ | ||
55 | dev_printk(KERN_DEBUG, dev, "ds: " fmt , ## arg); \ | ||
56 | } while (0) | ||
57 | #else | ||
58 | #define ds_dbg(lvl, fmt, arg...) do { } while (0) | ||
59 | #define ds_dev_dbg(lvl, dev, fmt, arg...) do { } while (0) | ||
60 | #endif | ||
61 | 44 | ||
62 | spinlock_t pcmcia_dev_list_lock; | 45 | spinlock_t pcmcia_dev_list_lock; |
63 | 46 | ||
64 | /*====================================================================*/ | 47 | /*====================================================================*/ |
65 | 48 | ||
66 | /* code which was in cs.c before */ | ||
67 | |||
68 | /* String tables for error messages */ | ||
69 | |||
70 | typedef struct lookup_t { | ||
71 | const int key; | ||
72 | const char *msg; | ||
73 | } lookup_t; | ||
74 | |||
75 | static const lookup_t error_table[] = { | ||
76 | { 0, "Operation succeeded" }, | ||
77 | { -EIO, "Input/Output error" }, | ||
78 | { -ENODEV, "No card present" }, | ||
79 | { -EINVAL, "Bad parameter" }, | ||
80 | { -EACCES, "Configuration locked" }, | ||
81 | { -EBUSY, "Resource in use" }, | ||
82 | { -ENOSPC, "No more items" }, | ||
83 | { -ENOMEM, "Out of resource" }, | ||
84 | }; | ||
85 | |||
86 | |||
87 | static const lookup_t service_table[] = { | ||
88 | { AccessConfigurationRegister, "AccessConfigurationRegister" }, | ||
89 | { AddSocketServices, "AddSocketServices" }, | ||
90 | { AdjustResourceInfo, "AdjustResourceInfo" }, | ||
91 | { CheckEraseQueue, "CheckEraseQueue" }, | ||
92 | { CloseMemory, "CloseMemory" }, | ||
93 | { DeregisterClient, "DeregisterClient" }, | ||
94 | { DeregisterEraseQueue, "DeregisterEraseQueue" }, | ||
95 | { GetCardServicesInfo, "GetCardServicesInfo" }, | ||
96 | { GetClientInfo, "GetClientInfo" }, | ||
97 | { GetConfigurationInfo, "GetConfigurationInfo" }, | ||
98 | { GetEventMask, "GetEventMask" }, | ||
99 | { GetFirstClient, "GetFirstClient" }, | ||
100 | { GetFirstRegion, "GetFirstRegion" }, | ||
101 | { GetFirstTuple, "GetFirstTuple" }, | ||
102 | { GetNextClient, "GetNextClient" }, | ||
103 | { GetNextRegion, "GetNextRegion" }, | ||
104 | { GetNextTuple, "GetNextTuple" }, | ||
105 | { GetStatus, "GetStatus" }, | ||
106 | { GetTupleData, "GetTupleData" }, | ||
107 | { MapMemPage, "MapMemPage" }, | ||
108 | { ModifyConfiguration, "ModifyConfiguration" }, | ||
109 | { ModifyWindow, "ModifyWindow" }, | ||
110 | { OpenMemory, "OpenMemory" }, | ||
111 | { ParseTuple, "ParseTuple" }, | ||
112 | { ReadMemory, "ReadMemory" }, | ||
113 | { RegisterClient, "RegisterClient" }, | ||
114 | { RegisterEraseQueue, "RegisterEraseQueue" }, | ||
115 | { RegisterMTD, "RegisterMTD" }, | ||
116 | { ReleaseConfiguration, "ReleaseConfiguration" }, | ||
117 | { ReleaseIO, "ReleaseIO" }, | ||
118 | { ReleaseIRQ, "ReleaseIRQ" }, | ||
119 | { ReleaseWindow, "ReleaseWindow" }, | ||
120 | { RequestConfiguration, "RequestConfiguration" }, | ||
121 | { RequestIO, "RequestIO" }, | ||
122 | { RequestIRQ, "RequestIRQ" }, | ||
123 | { RequestSocketMask, "RequestSocketMask" }, | ||
124 | { RequestWindow, "RequestWindow" }, | ||
125 | { ResetCard, "ResetCard" }, | ||
126 | { SetEventMask, "SetEventMask" }, | ||
127 | { ValidateCIS, "ValidateCIS" }, | ||
128 | { WriteMemory, "WriteMemory" }, | ||
129 | { BindDevice, "BindDevice" }, | ||
130 | { BindMTD, "BindMTD" }, | ||
131 | { ReportError, "ReportError" }, | ||
132 | { SuspendCard, "SuspendCard" }, | ||
133 | { ResumeCard, "ResumeCard" }, | ||
134 | { EjectCard, "EjectCard" }, | ||
135 | { InsertCard, "InsertCard" }, | ||
136 | { ReplaceCIS, "ReplaceCIS" } | ||
137 | }; | ||
138 | |||
139 | const char *pcmcia_error_func(int func) | ||
140 | { | ||
141 | int i; | ||
142 | |||
143 | for (i = 0; i < ARRAY_SIZE(service_table); i++) | ||
144 | if (service_table[i].key == func) | ||
145 | return service_table[i].msg; | ||
146 | |||
147 | return "Unknown service number"; | ||
148 | } | ||
149 | EXPORT_SYMBOL(pcmcia_error_func); | ||
150 | |||
151 | const char *pcmcia_error_ret(int ret) | ||
152 | { | ||
153 | int i; | ||
154 | |||
155 | for (i = 0; i < ARRAY_SIZE(error_table); i++) | ||
156 | if (error_table[i].key == ret) | ||
157 | return error_table[i].msg; | ||
158 | |||
159 | return "unknown"; | ||
160 | } | ||
161 | EXPORT_SYMBOL(pcmcia_error_ret); | ||
162 | |||
163 | /*======================================================================*/ | ||
164 | |||
165 | |||
166 | |||
167 | static void pcmcia_check_driver(struct pcmcia_driver *p_drv) | 49 | static void pcmcia_check_driver(struct pcmcia_driver *p_drv) |
168 | { | 50 | { |
169 | struct pcmcia_device_id *did = p_drv->id_table; | 51 | struct pcmcia_device_id *did = p_drv->id_table; |
@@ -303,7 +185,7 @@ int pcmcia_register_driver(struct pcmcia_driver *driver) | |||
303 | spin_lock_init(&driver->dynids.lock); | 185 | spin_lock_init(&driver->dynids.lock); |
304 | INIT_LIST_HEAD(&driver->dynids.list); | 186 | INIT_LIST_HEAD(&driver->dynids.list); |
305 | 187 | ||
306 | ds_dbg(3, "registering driver %s\n", driver->drv.name); | 188 | pr_debug("registering driver %s\n", driver->drv.name); |
307 | 189 | ||
308 | error = driver_register(&driver->drv); | 190 | error = driver_register(&driver->drv); |
309 | if (error < 0) | 191 | if (error < 0) |
@@ -323,7 +205,7 @@ EXPORT_SYMBOL(pcmcia_register_driver); | |||
323 | */ | 205 | */ |
324 | void pcmcia_unregister_driver(struct pcmcia_driver *driver) | 206 | void pcmcia_unregister_driver(struct pcmcia_driver *driver) |
325 | { | 207 | { |
326 | ds_dbg(3, "unregistering driver %s\n", driver->drv.name); | 208 | pr_debug("unregistering driver %s\n", driver->drv.name); |
327 | driver_unregister(&driver->drv); | 209 | driver_unregister(&driver->drv); |
328 | pcmcia_free_dynids(driver); | 210 | pcmcia_free_dynids(driver); |
329 | } | 211 | } |
@@ -350,14 +232,14 @@ void pcmcia_put_dev(struct pcmcia_device *p_dev) | |||
350 | static void pcmcia_release_function(struct kref *ref) | 232 | static void pcmcia_release_function(struct kref *ref) |
351 | { | 233 | { |
352 | struct config_t *c = container_of(ref, struct config_t, ref); | 234 | struct config_t *c = container_of(ref, struct config_t, ref); |
353 | ds_dbg(1, "releasing config_t\n"); | 235 | pr_debug("releasing config_t\n"); |
354 | kfree(c); | 236 | kfree(c); |
355 | } | 237 | } |
356 | 238 | ||
357 | static void pcmcia_release_dev(struct device *dev) | 239 | static void pcmcia_release_dev(struct device *dev) |
358 | { | 240 | { |
359 | struct pcmcia_device *p_dev = to_pcmcia_dev(dev); | 241 | struct pcmcia_device *p_dev = to_pcmcia_dev(dev); |
360 | ds_dev_dbg(1, dev, "releasing device\n"); | 242 | dev_dbg(dev, "releasing device\n"); |
361 | pcmcia_put_socket(p_dev->socket); | 243 | pcmcia_put_socket(p_dev->socket); |
362 | kfree(p_dev->devname); | 244 | kfree(p_dev->devname); |
363 | kref_put(&p_dev->function_config->ref, pcmcia_release_function); | 245 | kref_put(&p_dev->function_config->ref, pcmcia_release_function); |
@@ -367,7 +249,7 @@ static void pcmcia_release_dev(struct device *dev) | |||
367 | static void pcmcia_add_device_later(struct pcmcia_socket *s, int mfc) | 249 | static void pcmcia_add_device_later(struct pcmcia_socket *s, int mfc) |
368 | { | 250 | { |
369 | if (!s->pcmcia_state.device_add_pending) { | 251 | if (!s->pcmcia_state.device_add_pending) { |
370 | ds_dev_dbg(1, &s->dev, "scheduling to add %s secondary" | 252 | dev_dbg(&s->dev, "scheduling to add %s secondary" |
371 | " device to %d\n", mfc ? "mfc" : "pfc", s->sock); | 253 | " device to %d\n", mfc ? "mfc" : "pfc", s->sock); |
372 | s->pcmcia_state.device_add_pending = 1; | 254 | s->pcmcia_state.device_add_pending = 1; |
373 | s->pcmcia_state.mfc_pfc = mfc; | 255 | s->pcmcia_state.mfc_pfc = mfc; |
@@ -405,7 +287,7 @@ static int pcmcia_device_probe(struct device * dev) | |||
405 | */ | 287 | */ |
406 | did = dev_get_drvdata(&p_dev->dev); | 288 | did = dev_get_drvdata(&p_dev->dev); |
407 | 289 | ||
408 | ds_dev_dbg(1, dev, "trying to bind to %s\n", p_drv->drv.name); | 290 | dev_dbg(dev, "trying to bind to %s\n", p_drv->drv.name); |
409 | 291 | ||
410 | if ((!p_drv->probe) || (!p_dev->function_config) || | 292 | if ((!p_drv->probe) || (!p_dev->function_config) || |
411 | (!try_module_get(p_drv->owner))) { | 293 | (!try_module_get(p_drv->owner))) { |
@@ -428,7 +310,7 @@ static int pcmcia_device_probe(struct device * dev) | |||
428 | 310 | ||
429 | ret = p_drv->probe(p_dev); | 311 | ret = p_drv->probe(p_dev); |
430 | if (ret) { | 312 | if (ret) { |
431 | ds_dev_dbg(1, dev, "binding to %s failed with %d\n", | 313 | dev_dbg(dev, "binding to %s failed with %d\n", |
432 | p_drv->drv.name, ret); | 314 | p_drv->drv.name, ret); |
433 | goto put_module; | 315 | goto put_module; |
434 | } | 316 | } |
@@ -456,7 +338,7 @@ static void pcmcia_card_remove(struct pcmcia_socket *s, struct pcmcia_device *le | |||
456 | struct pcmcia_device *tmp; | 338 | struct pcmcia_device *tmp; |
457 | unsigned long flags; | 339 | unsigned long flags; |
458 | 340 | ||
459 | ds_dev_dbg(2, leftover ? &leftover->dev : &s->dev, | 341 | dev_dbg(leftover ? &leftover->dev : &s->dev, |
460 | "pcmcia_card_remove(%d) %s\n", s->sock, | 342 | "pcmcia_card_remove(%d) %s\n", s->sock, |
461 | leftover ? leftover->devname : ""); | 343 | leftover ? leftover->devname : ""); |
462 | 344 | ||
@@ -475,7 +357,7 @@ static void pcmcia_card_remove(struct pcmcia_socket *s, struct pcmcia_device *le | |||
475 | p_dev->_removed=1; | 357 | p_dev->_removed=1; |
476 | spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); | 358 | spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); |
477 | 359 | ||
478 | ds_dev_dbg(2, &p_dev->dev, "unregistering device\n"); | 360 | dev_dbg(&p_dev->dev, "unregistering device\n"); |
479 | device_unregister(&p_dev->dev); | 361 | device_unregister(&p_dev->dev); |
480 | } | 362 | } |
481 | 363 | ||
@@ -492,7 +374,7 @@ static int pcmcia_device_remove(struct device * dev) | |||
492 | p_dev = to_pcmcia_dev(dev); | 374 | p_dev = to_pcmcia_dev(dev); |
493 | p_drv = to_pcmcia_drv(dev->driver); | 375 | p_drv = to_pcmcia_drv(dev->driver); |
494 | 376 | ||
495 | ds_dev_dbg(1, dev, "removing device\n"); | 377 | dev_dbg(dev, "removing device\n"); |
496 | 378 | ||
497 | /* If we're removing the primary module driving a | 379 | /* If we're removing the primary module driving a |
498 | * pseudo multi-function card, we need to unbind | 380 | * pseudo multi-function card, we need to unbind |
@@ -572,7 +454,7 @@ static int pcmcia_device_query(struct pcmcia_device *p_dev) | |||
572 | } | 454 | } |
573 | if (!pccard_read_tuple(p_dev->socket, p_dev->func, | 455 | if (!pccard_read_tuple(p_dev->socket, p_dev->func, |
574 | CISTPL_DEVICE_GEO, devgeo)) { | 456 | CISTPL_DEVICE_GEO, devgeo)) { |
575 | ds_dev_dbg(0, &p_dev->dev, | 457 | dev_dbg(&p_dev->dev, |
576 | "mem device geometry probably means " | 458 | "mem device geometry probably means " |
577 | "FUNCID_MEMORY\n"); | 459 | "FUNCID_MEMORY\n"); |
578 | p_dev->func_id = CISTPL_FUNCID_MEMORY; | 460 | p_dev->func_id = CISTPL_FUNCID_MEMORY; |
@@ -628,7 +510,7 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f | |||
628 | 510 | ||
629 | mutex_lock(&device_add_lock); | 511 | mutex_lock(&device_add_lock); |
630 | 512 | ||
631 | ds_dbg(3, "adding device to %d, function %d\n", s->sock, function); | 513 | pr_debug("adding device to %d, function %d\n", s->sock, function); |
632 | 514 | ||
633 | /* max of 4 devices per card */ | 515 | /* max of 4 devices per card */ |
634 | if (s->device_count == 4) | 516 | if (s->device_count == 4) |
@@ -654,7 +536,7 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f | |||
654 | p_dev->devname = kasprintf(GFP_KERNEL, "pcmcia%s", dev_name(&p_dev->dev)); | 536 | p_dev->devname = kasprintf(GFP_KERNEL, "pcmcia%s", dev_name(&p_dev->dev)); |
655 | if (!p_dev->devname) | 537 | if (!p_dev->devname) |
656 | goto err_free; | 538 | goto err_free; |
657 | ds_dev_dbg(3, &p_dev->dev, "devname is %s\n", p_dev->devname); | 539 | dev_dbg(&p_dev->dev, "devname is %s\n", p_dev->devname); |
658 | 540 | ||
659 | spin_lock_irqsave(&pcmcia_dev_list_lock, flags); | 541 | spin_lock_irqsave(&pcmcia_dev_list_lock, flags); |
660 | 542 | ||
@@ -677,7 +559,7 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f | |||
677 | spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); | 559 | spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); |
678 | 560 | ||
679 | if (!p_dev->function_config) { | 561 | if (!p_dev->function_config) { |
680 | ds_dev_dbg(3, &p_dev->dev, "creating config_t\n"); | 562 | dev_dbg(&p_dev->dev, "creating config_t\n"); |
681 | p_dev->function_config = kzalloc(sizeof(struct config_t), | 563 | p_dev->function_config = kzalloc(sizeof(struct config_t), |
682 | GFP_KERNEL); | 564 | GFP_KERNEL); |
683 | if (!p_dev->function_config) | 565 | if (!p_dev->function_config) |
@@ -722,20 +604,20 @@ static int pcmcia_card_add(struct pcmcia_socket *s) | |||
722 | int ret = 0; | 604 | int ret = 0; |
723 | 605 | ||
724 | if (!(s->resource_setup_done)) { | 606 | if (!(s->resource_setup_done)) { |
725 | ds_dev_dbg(3, &s->dev, | 607 | dev_dbg(&s->dev, |
726 | "no resources available, delaying card_add\n"); | 608 | "no resources available, delaying card_add\n"); |
727 | return -EAGAIN; /* try again, but later... */ | 609 | return -EAGAIN; /* try again, but later... */ |
728 | } | 610 | } |
729 | 611 | ||
730 | if (pcmcia_validate_mem(s)) { | 612 | if (pcmcia_validate_mem(s)) { |
731 | ds_dev_dbg(3, &s->dev, "validating mem resources failed, " | 613 | dev_dbg(&s->dev, "validating mem resources failed, " |
732 | "delaying card_add\n"); | 614 | "delaying card_add\n"); |
733 | return -EAGAIN; /* try again, but later... */ | 615 | return -EAGAIN; /* try again, but later... */ |
734 | } | 616 | } |
735 | 617 | ||
736 | ret = pccard_validate_cis(s, &no_chains); | 618 | ret = pccard_validate_cis(s, &no_chains); |
737 | if (ret || !no_chains) { | 619 | if (ret || !no_chains) { |
738 | ds_dev_dbg(0, &s->dev, "invalid CIS or invalid resources\n"); | 620 | dev_dbg(&s->dev, "invalid CIS or invalid resources\n"); |
739 | return -ENODEV; | 621 | return -ENODEV; |
740 | } | 622 | } |
741 | 623 | ||
@@ -756,7 +638,7 @@ static void pcmcia_delayed_add_device(struct work_struct *work) | |||
756 | { | 638 | { |
757 | struct pcmcia_socket *s = | 639 | struct pcmcia_socket *s = |
758 | container_of(work, struct pcmcia_socket, device_add); | 640 | container_of(work, struct pcmcia_socket, device_add); |
759 | ds_dev_dbg(1, &s->dev, "adding additional device to %d\n", s->sock); | 641 | dev_dbg(&s->dev, "adding additional device to %d\n", s->sock); |
760 | pcmcia_device_add(s, s->pcmcia_state.mfc_pfc); | 642 | pcmcia_device_add(s, s->pcmcia_state.mfc_pfc); |
761 | s->pcmcia_state.device_add_pending = 0; | 643 | s->pcmcia_state.device_add_pending = 0; |
762 | s->pcmcia_state.mfc_pfc = 0; | 644 | s->pcmcia_state.mfc_pfc = 0; |
@@ -766,7 +648,7 @@ static int pcmcia_requery(struct device *dev, void * _data) | |||
766 | { | 648 | { |
767 | struct pcmcia_device *p_dev = to_pcmcia_dev(dev); | 649 | struct pcmcia_device *p_dev = to_pcmcia_dev(dev); |
768 | if (!p_dev->dev.driver) { | 650 | if (!p_dev->dev.driver) { |
769 | ds_dev_dbg(1, dev, "update device information\n"); | 651 | dev_dbg(dev, "update device information\n"); |
770 | pcmcia_device_query(p_dev); | 652 | pcmcia_device_query(p_dev); |
771 | } | 653 | } |
772 | 654 | ||
@@ -780,7 +662,7 @@ static void pcmcia_bus_rescan(struct pcmcia_socket *skt, int new_cis) | |||
780 | unsigned long flags; | 662 | unsigned long flags; |
781 | 663 | ||
782 | /* must be called with skt_mutex held */ | 664 | /* must be called with skt_mutex held */ |
783 | ds_dev_dbg(0, &skt->dev, "re-scanning socket %d\n", skt->sock); | 665 | dev_dbg(&skt->dev, "re-scanning socket %d\n", skt->sock); |
784 | 666 | ||
785 | spin_lock_irqsave(&pcmcia_dev_list_lock, flags); | 667 | spin_lock_irqsave(&pcmcia_dev_list_lock, flags); |
786 | if (list_empty(&skt->devices_list)) | 668 | if (list_empty(&skt->devices_list)) |
@@ -835,7 +717,7 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename) | |||
835 | if (!filename) | 717 | if (!filename) |
836 | return -EINVAL; | 718 | return -EINVAL; |
837 | 719 | ||
838 | ds_dev_dbg(1, &dev->dev, "trying to load CIS file %s\n", filename); | 720 | dev_dbg(&dev->dev, "trying to load CIS file %s\n", filename); |
839 | 721 | ||
840 | if (request_firmware(&fw, filename, &dev->dev) == 0) { | 722 | if (request_firmware(&fw, filename, &dev->dev) == 0) { |
841 | if (fw->size >= CISTPL_MAX_CIS_SIZE) { | 723 | if (fw->size >= CISTPL_MAX_CIS_SIZE) { |
@@ -953,14 +835,14 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev, | |||
953 | * after it has re-checked that there is no possible module | 835 | * after it has re-checked that there is no possible module |
954 | * with a prod_id/manf_id/card_id match. | 836 | * with a prod_id/manf_id/card_id match. |
955 | */ | 837 | */ |
956 | ds_dev_dbg(0, &dev->dev, | 838 | dev_dbg(&dev->dev, |
957 | "skipping FUNC_ID match until userspace interaction\n"); | 839 | "skipping FUNC_ID match until userspace interaction\n"); |
958 | if (!dev->allow_func_id_match) | 840 | if (!dev->allow_func_id_match) |
959 | return 0; | 841 | return 0; |
960 | } | 842 | } |
961 | 843 | ||
962 | if (did->match_flags & PCMCIA_DEV_ID_MATCH_FAKE_CIS) { | 844 | if (did->match_flags & PCMCIA_DEV_ID_MATCH_FAKE_CIS) { |
963 | ds_dev_dbg(0, &dev->dev, "device needs a fake CIS\n"); | 845 | dev_dbg(&dev->dev, "device needs a fake CIS\n"); |
964 | if (!dev->socket->fake_cis) | 846 | if (!dev->socket->fake_cis) |
965 | pcmcia_load_firmware(dev, did->cisfile); | 847 | pcmcia_load_firmware(dev, did->cisfile); |
966 | 848 | ||
@@ -992,9 +874,9 @@ static int pcmcia_bus_match(struct device * dev, struct device_driver * drv) { | |||
992 | /* match dynamic devices first */ | 874 | /* match dynamic devices first */ |
993 | spin_lock(&p_drv->dynids.lock); | 875 | spin_lock(&p_drv->dynids.lock); |
994 | list_for_each_entry(dynid, &p_drv->dynids.list, node) { | 876 | list_for_each_entry(dynid, &p_drv->dynids.list, node) { |
995 | ds_dev_dbg(3, dev, "trying to match to %s\n", drv->name); | 877 | dev_dbg(dev, "trying to match to %s\n", drv->name); |
996 | if (pcmcia_devmatch(p_dev, &dynid->id)) { | 878 | if (pcmcia_devmatch(p_dev, &dynid->id)) { |
997 | ds_dev_dbg(0, dev, "matched to %s\n", drv->name); | 879 | dev_dbg(dev, "matched to %s\n", drv->name); |
998 | spin_unlock(&p_drv->dynids.lock); | 880 | spin_unlock(&p_drv->dynids.lock); |
999 | return 1; | 881 | return 1; |
1000 | } | 882 | } |
@@ -1004,15 +886,15 @@ static int pcmcia_bus_match(struct device * dev, struct device_driver * drv) { | |||
1004 | #ifdef CONFIG_PCMCIA_IOCTL | 886 | #ifdef CONFIG_PCMCIA_IOCTL |
1005 | /* matching by cardmgr */ | 887 | /* matching by cardmgr */ |
1006 | if (p_dev->cardmgr == p_drv) { | 888 | if (p_dev->cardmgr == p_drv) { |
1007 | ds_dev_dbg(0, dev, "cardmgr matched to %s\n", drv->name); | 889 | dev_dbg(dev, "cardmgr matched to %s\n", drv->name); |
1008 | return 1; | 890 | return 1; |
1009 | } | 891 | } |
1010 | #endif | 892 | #endif |
1011 | 893 | ||
1012 | while (did && did->match_flags) { | 894 | while (did && did->match_flags) { |
1013 | ds_dev_dbg(3, dev, "trying to match to %s\n", drv->name); | 895 | dev_dbg(dev, "trying to match to %s\n", drv->name); |
1014 | if (pcmcia_devmatch(p_dev, did)) { | 896 | if (pcmcia_devmatch(p_dev, did)) { |
1015 | ds_dev_dbg(0, dev, "matched to %s\n", drv->name); | 897 | dev_dbg(dev, "matched to %s\n", drv->name); |
1016 | return 1; | 898 | return 1; |
1017 | } | 899 | } |
1018 | did++; | 900 | did++; |
@@ -1218,7 +1100,7 @@ static int pcmcia_dev_suspend(struct device * dev, pm_message_t state) | |||
1218 | if (p_dev->suspended) | 1100 | if (p_dev->suspended) |
1219 | return 0; | 1101 | return 0; |
1220 | 1102 | ||
1221 | ds_dev_dbg(2, dev, "suspending\n"); | 1103 | dev_dbg(dev, "suspending\n"); |
1222 | 1104 | ||
1223 | if (dev->driver) | 1105 | if (dev->driver) |
1224 | p_drv = to_pcmcia_drv(dev->driver); | 1106 | p_drv = to_pcmcia_drv(dev->driver); |
@@ -1238,7 +1120,7 @@ static int pcmcia_dev_suspend(struct device * dev, pm_message_t state) | |||
1238 | } | 1120 | } |
1239 | 1121 | ||
1240 | if (p_dev->device_no == p_dev->func) { | 1122 | if (p_dev->device_no == p_dev->func) { |
1241 | ds_dev_dbg(2, dev, "releasing configuration\n"); | 1123 | dev_dbg(dev, "releasing configuration\n"); |
1242 | pcmcia_release_configuration(p_dev); | 1124 | pcmcia_release_configuration(p_dev); |
1243 | } | 1125 | } |
1244 | 1126 | ||
@@ -1258,7 +1140,7 @@ static int pcmcia_dev_resume(struct device * dev) | |||
1258 | if (!p_dev->suspended) | 1140 | if (!p_dev->suspended) |
1259 | return 0; | 1141 | return 0; |
1260 | 1142 | ||
1261 | ds_dev_dbg(2, dev, "resuming\n"); | 1143 | dev_dbg(dev, "resuming\n"); |
1262 | 1144 | ||
1263 | if (dev->driver) | 1145 | if (dev->driver) |
1264 | p_drv = to_pcmcia_drv(dev->driver); | 1146 | p_drv = to_pcmcia_drv(dev->driver); |
@@ -1267,7 +1149,7 @@ static int pcmcia_dev_resume(struct device * dev) | |||
1267 | goto out; | 1149 | goto out; |
1268 | 1150 | ||
1269 | if (p_dev->device_no == p_dev->func) { | 1151 | if (p_dev->device_no == p_dev->func) { |
1270 | ds_dev_dbg(2, dev, "requesting configuration\n"); | 1152 | dev_dbg(dev, "requesting configuration\n"); |
1271 | ret = pcmcia_request_configuration(p_dev, &p_dev->conf); | 1153 | ret = pcmcia_request_configuration(p_dev, &p_dev->conf); |
1272 | if (ret) | 1154 | if (ret) |
1273 | goto out; | 1155 | goto out; |
@@ -1309,14 +1191,14 @@ static int pcmcia_bus_resume_callback(struct device *dev, void * _data) | |||
1309 | 1191 | ||
1310 | static int pcmcia_bus_resume(struct pcmcia_socket *skt) | 1192 | static int pcmcia_bus_resume(struct pcmcia_socket *skt) |
1311 | { | 1193 | { |
1312 | ds_dev_dbg(2, &skt->dev, "resuming socket %d\n", skt->sock); | 1194 | dev_dbg(&skt->dev, "resuming socket %d\n", skt->sock); |
1313 | bus_for_each_dev(&pcmcia_bus_type, NULL, skt, pcmcia_bus_resume_callback); | 1195 | bus_for_each_dev(&pcmcia_bus_type, NULL, skt, pcmcia_bus_resume_callback); |
1314 | return 0; | 1196 | return 0; |
1315 | } | 1197 | } |
1316 | 1198 | ||
1317 | static int pcmcia_bus_suspend(struct pcmcia_socket *skt) | 1199 | static int pcmcia_bus_suspend(struct pcmcia_socket *skt) |
1318 | { | 1200 | { |
1319 | ds_dev_dbg(2, &skt->dev, "suspending socket %d\n", skt->sock); | 1201 | dev_dbg(&skt->dev, "suspending socket %d\n", skt->sock); |
1320 | if (bus_for_each_dev(&pcmcia_bus_type, NULL, skt, | 1202 | if (bus_for_each_dev(&pcmcia_bus_type, NULL, skt, |
1321 | pcmcia_bus_suspend_callback)) { | 1203 | pcmcia_bus_suspend_callback)) { |
1322 | pcmcia_bus_resume(skt); | 1204 | pcmcia_bus_resume(skt); |
@@ -1348,7 +1230,7 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority) | |||
1348 | return -ENODEV; | 1230 | return -ENODEV; |
1349 | } | 1231 | } |
1350 | 1232 | ||
1351 | ds_dev_dbg(1, &skt->dev, "ds_event(0x%06x, %d, 0x%p)\n", | 1233 | dev_dbg(&skt->dev, "ds_event(0x%06x, %d, 0x%p)\n", |
1352 | event, priority, skt); | 1234 | event, priority, skt); |
1353 | 1235 | ||
1354 | switch (event) { | 1236 | switch (event) { |