diff options
Diffstat (limited to 'drivers/pcmcia/ds.c')
-rw-r--r-- | drivers/pcmcia/ds.c | 137 |
1 files changed, 74 insertions, 63 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 2382341975e5..a393501554ac 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -42,17 +42,22 @@ MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>"); | |||
42 | MODULE_DESCRIPTION("PCMCIA Driver Services"); | 42 | MODULE_DESCRIPTION("PCMCIA Driver Services"); |
43 | MODULE_LICENSE("GPL"); | 43 | MODULE_LICENSE("GPL"); |
44 | 44 | ||
45 | #ifdef DEBUG | 45 | #ifdef CONFIG_PCMCIA_DEBUG |
46 | int ds_pc_debug; | 46 | int ds_pc_debug; |
47 | 47 | ||
48 | module_param_named(pc_debug, ds_pc_debug, int, 0644); | 48 | module_param_named(pc_debug, ds_pc_debug, int, 0644); |
49 | 49 | ||
50 | #define ds_dbg(lvl, fmt, arg...) do { \ | 50 | #define ds_dbg(lvl, fmt, arg...) do { \ |
51 | if (ds_pc_debug > (lvl)) \ | 51 | if (ds_pc_debug > (lvl)) \ |
52 | printk(KERN_DEBUG "ds: " fmt , ## arg); \ | 52 | printk(KERN_DEBUG "ds: " fmt , ## arg); \ |
53 | } while (0) | 53 | } while (0) |
54 | #define ds_dev_dbg(lvl, dev, fmt, arg...) do { \ | ||
55 | if (ds_pc_debug > (lvl)) \ | ||
56 | dev_printk(KERN_DEBUG, dev, "ds: " fmt , ## arg); \ | ||
57 | } while (0) | ||
54 | #else | 58 | #else |
55 | #define ds_dbg(lvl, fmt, arg...) do { } while (0) | 59 | #define ds_dbg(lvl, fmt, arg...) do { } while (0) |
60 | #define ds_dev_dbg(lvl, dev, fmt, arg...) do { } while (0) | ||
56 | #endif | 61 | #endif |
57 | 62 | ||
58 | spinlock_t pcmcia_dev_list_lock; | 63 | spinlock_t pcmcia_dev_list_lock; |
@@ -391,7 +396,7 @@ static void pcmcia_release_function(struct kref *ref) | |||
391 | static void pcmcia_release_dev(struct device *dev) | 396 | static void pcmcia_release_dev(struct device *dev) |
392 | { | 397 | { |
393 | struct pcmcia_device *p_dev = to_pcmcia_dev(dev); | 398 | struct pcmcia_device *p_dev = to_pcmcia_dev(dev); |
394 | ds_dbg(1, "releasing device %s\n", p_dev->dev.bus_id); | 399 | ds_dev_dbg(1, dev, "releasing device\n"); |
395 | pcmcia_put_socket(p_dev->socket); | 400 | pcmcia_put_socket(p_dev->socket); |
396 | kfree(p_dev->devname); | 401 | kfree(p_dev->devname); |
397 | kref_put(&p_dev->function_config->ref, pcmcia_release_function); | 402 | kref_put(&p_dev->function_config->ref, pcmcia_release_function); |
@@ -401,7 +406,7 @@ static void pcmcia_release_dev(struct device *dev) | |||
401 | static void pcmcia_add_device_later(struct pcmcia_socket *s, int mfc) | 406 | static void pcmcia_add_device_later(struct pcmcia_socket *s, int mfc) |
402 | { | 407 | { |
403 | if (!s->pcmcia_state.device_add_pending) { | 408 | if (!s->pcmcia_state.device_add_pending) { |
404 | ds_dbg(1, "scheduling to add %s secondary" | 409 | ds_dev_dbg(1, &s->dev, "scheduling to add %s secondary" |
405 | " device to %d\n", mfc ? "mfc" : "pfc", s->sock); | 410 | " device to %d\n", mfc ? "mfc" : "pfc", s->sock); |
406 | s->pcmcia_state.device_add_pending = 1; | 411 | s->pcmcia_state.device_add_pending = 1; |
407 | s->pcmcia_state.mfc_pfc = mfc; | 412 | s->pcmcia_state.mfc_pfc = mfc; |
@@ -427,8 +432,7 @@ static int pcmcia_device_probe(struct device * dev) | |||
427 | p_drv = to_pcmcia_drv(dev->driver); | 432 | p_drv = to_pcmcia_drv(dev->driver); |
428 | s = p_dev->socket; | 433 | s = p_dev->socket; |
429 | 434 | ||
430 | ds_dbg(1, "trying to bind %s to %s\n", p_dev->dev.bus_id, | 435 | ds_dev_dbg(1, dev, "trying to bind to %s\n", p_drv->drv.name); |
431 | p_drv->drv.name); | ||
432 | 436 | ||
433 | if ((!p_drv->probe) || (!p_dev->function_config) || | 437 | if ((!p_drv->probe) || (!p_dev->function_config) || |
434 | (!try_module_get(p_drv->owner))) { | 438 | (!try_module_get(p_drv->owner))) { |
@@ -443,15 +447,16 @@ static int pcmcia_device_probe(struct device * dev) | |||
443 | p_dev->conf.ConfigBase = cis_config.base; | 447 | p_dev->conf.ConfigBase = cis_config.base; |
444 | p_dev->conf.Present = cis_config.rmask[0]; | 448 | p_dev->conf.Present = cis_config.rmask[0]; |
445 | } else { | 449 | } else { |
446 | printk(KERN_INFO "pcmcia: could not parse base and rmask0 of CIS\n"); | 450 | dev_printk(KERN_INFO, dev, |
451 | "pcmcia: could not parse base and rmask0 of CIS\n"); | ||
447 | p_dev->conf.ConfigBase = 0; | 452 | p_dev->conf.ConfigBase = 0; |
448 | p_dev->conf.Present = 0; | 453 | p_dev->conf.Present = 0; |
449 | } | 454 | } |
450 | 455 | ||
451 | ret = p_drv->probe(p_dev); | 456 | ret = p_drv->probe(p_dev); |
452 | if (ret) { | 457 | if (ret) { |
453 | ds_dbg(1, "binding %s to %s failed with %d\n", | 458 | ds_dev_dbg(1, dev, "binding to %s failed with %d\n", |
454 | p_dev->dev.bus_id, p_drv->drv.name, ret); | 459 | p_drv->drv.name, ret); |
455 | goto put_module; | 460 | goto put_module; |
456 | } | 461 | } |
457 | 462 | ||
@@ -485,8 +490,9 @@ static void pcmcia_card_remove(struct pcmcia_socket *s, struct pcmcia_device *le | |||
485 | struct pcmcia_device *tmp; | 490 | struct pcmcia_device *tmp; |
486 | unsigned long flags; | 491 | unsigned long flags; |
487 | 492 | ||
488 | ds_dbg(2, "pcmcia_card_remove(%d) %s\n", s->sock, | 493 | ds_dev_dbg(2, leftover ? &leftover->dev : &s->dev, |
489 | leftover ? leftover->devname : ""); | 494 | "pcmcia_card_remove(%d) %s\n", s->sock, |
495 | leftover ? leftover->devname : ""); | ||
490 | 496 | ||
491 | if (!leftover) | 497 | if (!leftover) |
492 | s->device_count = 0; | 498 | s->device_count = 0; |
@@ -503,7 +509,7 @@ static void pcmcia_card_remove(struct pcmcia_socket *s, struct pcmcia_device *le | |||
503 | p_dev->_removed=1; | 509 | p_dev->_removed=1; |
504 | spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); | 510 | spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); |
505 | 511 | ||
506 | ds_dbg(2, "unregistering device %s\n", p_dev->dev.bus_id); | 512 | ds_dev_dbg(2, &p_dev->dev, "unregistering device\n"); |
507 | device_unregister(&p_dev->dev); | 513 | device_unregister(&p_dev->dev); |
508 | } | 514 | } |
509 | 515 | ||
@@ -520,7 +526,7 @@ static int pcmcia_device_remove(struct device * dev) | |||
520 | p_dev = to_pcmcia_dev(dev); | 526 | p_dev = to_pcmcia_dev(dev); |
521 | p_drv = to_pcmcia_drv(dev->driver); | 527 | p_drv = to_pcmcia_drv(dev->driver); |
522 | 528 | ||
523 | ds_dbg(1, "removing device %s\n", p_dev->dev.bus_id); | 529 | ds_dev_dbg(1, dev, "removing device\n"); |
524 | 530 | ||
525 | /* If we're removing the primary module driving a | 531 | /* If we're removing the primary module driving a |
526 | * pseudo multi-function card, we need to unbind | 532 | * pseudo multi-function card, we need to unbind |
@@ -543,13 +549,15 @@ static int pcmcia_device_remove(struct device * dev) | |||
543 | 549 | ||
544 | /* check for proper unloading */ | 550 | /* check for proper unloading */ |
545 | if (p_dev->_irq || p_dev->_io || p_dev->_locked) | 551 | if (p_dev->_irq || p_dev->_io || p_dev->_locked) |
546 | printk(KERN_INFO "pcmcia: driver %s did not release config properly\n", | 552 | dev_printk(KERN_INFO, dev, |
547 | p_drv->drv.name); | 553 | "pcmcia: driver %s did not release config properly\n", |
554 | p_drv->drv.name); | ||
548 | 555 | ||
549 | for (i = 0; i < MAX_WIN; i++) | 556 | for (i = 0; i < MAX_WIN; i++) |
550 | if (p_dev->_win & CLIENT_WIN_REQ(i)) | 557 | if (p_dev->_win & CLIENT_WIN_REQ(i)) |
551 | printk(KERN_INFO "pcmcia: driver %s did not release windows properly\n", | 558 | dev_printk(KERN_INFO, dev, |
552 | p_drv->drv.name); | 559 | "pcmcia: driver %s did not release window properly\n", |
560 | p_drv->drv.name); | ||
553 | 561 | ||
554 | /* references from pcmcia_probe_device */ | 562 | /* references from pcmcia_probe_device */ |
555 | pcmcia_put_dev(p_dev); | 563 | pcmcia_put_dev(p_dev); |
@@ -598,8 +606,9 @@ static int pcmcia_device_query(struct pcmcia_device *p_dev) | |||
598 | } | 606 | } |
599 | if (!pccard_read_tuple(p_dev->socket, p_dev->func, | 607 | if (!pccard_read_tuple(p_dev->socket, p_dev->func, |
600 | CISTPL_DEVICE_GEO, devgeo)) { | 608 | CISTPL_DEVICE_GEO, devgeo)) { |
601 | ds_dbg(0, "mem device geometry probably means " | 609 | ds_dev_dbg(0, &p_dev->dev, |
602 | "FUNCID_MEMORY\n"); | 610 | "mem device geometry probably means " |
611 | "FUNCID_MEMORY\n"); | ||
603 | p_dev->func_id = CISTPL_FUNCID_MEMORY; | 612 | p_dev->func_id = CISTPL_FUNCID_MEMORY; |
604 | p_dev->has_func_id = 1; | 613 | p_dev->has_func_id = 1; |
605 | } | 614 | } |
@@ -680,7 +689,7 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f | |||
680 | if (!p_dev->devname) | 689 | if (!p_dev->devname) |
681 | goto err_free; | 690 | goto err_free; |
682 | sprintf (p_dev->devname, "pcmcia%s", p_dev->dev.bus_id); | 691 | sprintf (p_dev->devname, "pcmcia%s", p_dev->dev.bus_id); |
683 | ds_dbg(3, "devname is %s\n", p_dev->devname); | 692 | ds_dev_dbg(3, &p_dev->dev, "devname is %s\n", p_dev->devname); |
684 | 693 | ||
685 | spin_lock_irqsave(&pcmcia_dev_list_lock, flags); | 694 | spin_lock_irqsave(&pcmcia_dev_list_lock, flags); |
686 | 695 | ||
@@ -701,7 +710,7 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f | |||
701 | spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); | 710 | spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); |
702 | 711 | ||
703 | if (!p_dev->function_config) { | 712 | if (!p_dev->function_config) { |
704 | ds_dbg(3, "creating config_t for %s\n", p_dev->dev.bus_id); | 713 | ds_dev_dbg(3, &p_dev->dev, "creating config_t\n"); |
705 | p_dev->function_config = kzalloc(sizeof(struct config_t), | 714 | p_dev->function_config = kzalloc(sizeof(struct config_t), |
706 | GFP_KERNEL); | 715 | GFP_KERNEL); |
707 | if (!p_dev->function_config) | 716 | if (!p_dev->function_config) |
@@ -709,8 +718,9 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f | |||
709 | kref_init(&p_dev->function_config->ref); | 718 | kref_init(&p_dev->function_config->ref); |
710 | } | 719 | } |
711 | 720 | ||
712 | printk(KERN_NOTICE "pcmcia: registering new device %s\n", | 721 | dev_printk(KERN_NOTICE, &p_dev->dev, |
713 | p_dev->devname); | 722 | "pcmcia: registering new device %s\n", |
723 | p_dev->devname); | ||
714 | 724 | ||
715 | pcmcia_device_query(p_dev); | 725 | pcmcia_device_query(p_dev); |
716 | 726 | ||
@@ -745,19 +755,20 @@ static int pcmcia_card_add(struct pcmcia_socket *s) | |||
745 | int ret = 0; | 755 | int ret = 0; |
746 | 756 | ||
747 | if (!(s->resource_setup_done)) { | 757 | if (!(s->resource_setup_done)) { |
748 | ds_dbg(3, "no resources available, delaying card_add\n"); | 758 | ds_dev_dbg(3, &s->dev, |
759 | "no resources available, delaying card_add\n"); | ||
749 | return -EAGAIN; /* try again, but later... */ | 760 | return -EAGAIN; /* try again, but later... */ |
750 | } | 761 | } |
751 | 762 | ||
752 | if (pcmcia_validate_mem(s)) { | 763 | if (pcmcia_validate_mem(s)) { |
753 | ds_dbg(3, "validating mem resources failed, " | 764 | ds_dev_dbg(3, &s->dev, "validating mem resources failed, " |
754 | "delaying card_add\n"); | 765 | "delaying card_add\n"); |
755 | return -EAGAIN; /* try again, but later... */ | 766 | return -EAGAIN; /* try again, but later... */ |
756 | } | 767 | } |
757 | 768 | ||
758 | ret = pccard_validate_cis(s, BIND_FN_ALL, &no_chains); | 769 | ret = pccard_validate_cis(s, BIND_FN_ALL, &no_chains); |
759 | if (ret || !no_chains) { | 770 | if (ret || !no_chains) { |
760 | ds_dbg(0, "invalid CIS or invalid resources\n"); | 771 | ds_dev_dbg(0, &s->dev, "invalid CIS or invalid resources\n"); |
761 | return -ENODEV; | 772 | return -ENODEV; |
762 | } | 773 | } |
763 | 774 | ||
@@ -778,7 +789,7 @@ static void pcmcia_delayed_add_device(struct work_struct *work) | |||
778 | { | 789 | { |
779 | struct pcmcia_socket *s = | 790 | struct pcmcia_socket *s = |
780 | container_of(work, struct pcmcia_socket, device_add); | 791 | container_of(work, struct pcmcia_socket, device_add); |
781 | ds_dbg(1, "adding additional device to %d\n", s->sock); | 792 | ds_dev_dbg(1, &s->dev, "adding additional device to %d\n", s->sock); |
782 | pcmcia_device_add(s, s->pcmcia_state.mfc_pfc); | 793 | pcmcia_device_add(s, s->pcmcia_state.mfc_pfc); |
783 | s->pcmcia_state.device_add_pending = 0; | 794 | s->pcmcia_state.device_add_pending = 0; |
784 | s->pcmcia_state.mfc_pfc = 0; | 795 | s->pcmcia_state.mfc_pfc = 0; |
@@ -788,8 +799,7 @@ static int pcmcia_requery(struct device *dev, void * _data) | |||
788 | { | 799 | { |
789 | struct pcmcia_device *p_dev = to_pcmcia_dev(dev); | 800 | struct pcmcia_device *p_dev = to_pcmcia_dev(dev); |
790 | if (!p_dev->dev.driver) { | 801 | if (!p_dev->dev.driver) { |
791 | ds_dbg(1, "update device information for %s\n", | 802 | ds_dev_dbg(1, dev, "update device information\n"); |
792 | p_dev->dev.bus_id); | ||
793 | pcmcia_device_query(p_dev); | 803 | pcmcia_device_query(p_dev); |
794 | } | 804 | } |
795 | 805 | ||
@@ -803,7 +813,7 @@ static void pcmcia_bus_rescan(struct pcmcia_socket *skt, int new_cis) | |||
803 | unsigned long flags; | 813 | unsigned long flags; |
804 | 814 | ||
805 | /* must be called with skt_mutex held */ | 815 | /* must be called with skt_mutex held */ |
806 | ds_dbg(0, "re-scanning socket %d\n", skt->sock); | 816 | ds_dev_dbg(0, &skt->dev, "re-scanning socket %d\n", skt->sock); |
807 | 817 | ||
808 | spin_lock_irqsave(&pcmcia_dev_list_lock, flags); | 818 | spin_lock_irqsave(&pcmcia_dev_list_lock, flags); |
809 | if (list_empty(&skt->devices_list)) | 819 | if (list_empty(&skt->devices_list)) |
@@ -859,11 +869,12 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename) | |||
859 | if (!filename) | 869 | if (!filename) |
860 | return -EINVAL; | 870 | return -EINVAL; |
861 | 871 | ||
862 | ds_dbg(1, "trying to load CIS file %s\n", filename); | 872 | ds_dev_dbg(1, &dev->dev, "trying to load CIS file %s\n", filename); |
863 | 873 | ||
864 | if (strlen(filename) > (FIRMWARE_NAME_MAX - 1)) { | 874 | if (strlen(filename) > (FIRMWARE_NAME_MAX - 1)) { |
865 | printk(KERN_WARNING "pcmcia: CIS filename is too long [%s]\n", | 875 | dev_printk(KERN_WARNING, &dev->dev, |
866 | filename); | 876 | "pcmcia: CIS filename is too long [%s]\n", |
877 | filename); | ||
867 | return -EINVAL; | 878 | return -EINVAL; |
868 | } | 879 | } |
869 | 880 | ||
@@ -872,14 +883,16 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename) | |||
872 | if (request_firmware(&fw, path, &dev->dev) == 0) { | 883 | if (request_firmware(&fw, path, &dev->dev) == 0) { |
873 | if (fw->size >= CISTPL_MAX_CIS_SIZE) { | 884 | if (fw->size >= CISTPL_MAX_CIS_SIZE) { |
874 | ret = -EINVAL; | 885 | ret = -EINVAL; |
875 | printk(KERN_ERR "pcmcia: CIS override is too big\n"); | 886 | dev_printk(KERN_ERR, &dev->dev, |
887 | "pcmcia: CIS override is too big\n"); | ||
876 | goto release; | 888 | goto release; |
877 | } | 889 | } |
878 | 890 | ||
879 | if (!pcmcia_replace_cis(s, fw->data, fw->size)) | 891 | if (!pcmcia_replace_cis(s, fw->data, fw->size)) |
880 | ret = 0; | 892 | ret = 0; |
881 | else { | 893 | else { |
882 | printk(KERN_ERR "pcmcia: CIS override failed\n"); | 894 | dev_printk(KERN_ERR, &dev->dev, |
895 | "pcmcia: CIS override failed\n"); | ||
883 | goto release; | 896 | goto release; |
884 | } | 897 | } |
885 | 898 | ||
@@ -983,14 +996,14 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev, | |||
983 | * after it has re-checked that there is no possible module | 996 | * after it has re-checked that there is no possible module |
984 | * with a prod_id/manf_id/card_id match. | 997 | * with a prod_id/manf_id/card_id match. |
985 | */ | 998 | */ |
986 | ds_dbg(0, "skipping FUNC_ID match for %s until userspace " | 999 | ds_dev_dbg(0, &dev->dev, |
987 | "interaction\n", dev->dev.bus_id); | 1000 | "skipping FUNC_ID match until userspace interaction\n"); |
988 | if (!dev->allow_func_id_match) | 1001 | if (!dev->allow_func_id_match) |
989 | return 0; | 1002 | return 0; |
990 | } | 1003 | } |
991 | 1004 | ||
992 | if (did->match_flags & PCMCIA_DEV_ID_MATCH_FAKE_CIS) { | 1005 | if (did->match_flags & PCMCIA_DEV_ID_MATCH_FAKE_CIS) { |
993 | ds_dbg(0, "device %s needs a fake CIS\n", dev->dev.bus_id); | 1006 | ds_dev_dbg(0, &dev->dev, "device needs a fake CIS\n"); |
994 | if (!dev->socket->fake_cis) | 1007 | if (!dev->socket->fake_cis) |
995 | pcmcia_load_firmware(dev, did->cisfile); | 1008 | pcmcia_load_firmware(dev, did->cisfile); |
996 | 1009 | ||
@@ -1022,11 +1035,9 @@ static int pcmcia_bus_match(struct device * dev, struct device_driver * drv) { | |||
1022 | /* match dynamic devices first */ | 1035 | /* match dynamic devices first */ |
1023 | spin_lock(&p_drv->dynids.lock); | 1036 | spin_lock(&p_drv->dynids.lock); |
1024 | list_for_each_entry(dynid, &p_drv->dynids.list, node) { | 1037 | list_for_each_entry(dynid, &p_drv->dynids.list, node) { |
1025 | ds_dbg(3, "trying to match %s to %s\n", dev->bus_id, | 1038 | ds_dev_dbg(3, dev, "trying to match to %s\n", drv->name); |
1026 | drv->name); | ||
1027 | if (pcmcia_devmatch(p_dev, &dynid->id)) { | 1039 | if (pcmcia_devmatch(p_dev, &dynid->id)) { |
1028 | ds_dbg(0, "matched %s to %s\n", dev->bus_id, | 1040 | ds_dev_dbg(0, dev, "matched to %s\n", drv->name); |
1029 | drv->name); | ||
1030 | spin_unlock(&p_drv->dynids.lock); | 1041 | spin_unlock(&p_drv->dynids.lock); |
1031 | return 1; | 1042 | return 1; |
1032 | } | 1043 | } |
@@ -1036,18 +1047,15 @@ static int pcmcia_bus_match(struct device * dev, struct device_driver * drv) { | |||
1036 | #ifdef CONFIG_PCMCIA_IOCTL | 1047 | #ifdef CONFIG_PCMCIA_IOCTL |
1037 | /* matching by cardmgr */ | 1048 | /* matching by cardmgr */ |
1038 | if (p_dev->cardmgr == p_drv) { | 1049 | if (p_dev->cardmgr == p_drv) { |
1039 | ds_dbg(0, "cardmgr matched %s to %s\n", dev->bus_id, | 1050 | ds_dev_dbg(0, dev, "cardmgr matched to %s\n", drv->name); |
1040 | drv->name); | ||
1041 | return 1; | 1051 | return 1; |
1042 | } | 1052 | } |
1043 | #endif | 1053 | #endif |
1044 | 1054 | ||
1045 | while (did && did->match_flags) { | 1055 | while (did && did->match_flags) { |
1046 | ds_dbg(3, "trying to match %s to %s\n", dev->bus_id, | 1056 | ds_dev_dbg(3, dev, "trying to match to %s\n", drv->name); |
1047 | drv->name); | ||
1048 | if (pcmcia_devmatch(p_dev, did)) { | 1057 | if (pcmcia_devmatch(p_dev, did)) { |
1049 | ds_dbg(0, "matched %s to %s\n", dev->bus_id, | 1058 | ds_dev_dbg(0, dev, "matched to %s\n", drv->name); |
1050 | drv->name); | ||
1051 | return 1; | 1059 | return 1; |
1052 | } | 1060 | } |
1053 | did++; | 1061 | did++; |
@@ -1253,7 +1261,7 @@ static int pcmcia_dev_suspend(struct device * dev, pm_message_t state) | |||
1253 | if (p_dev->suspended) | 1261 | if (p_dev->suspended) |
1254 | return 0; | 1262 | return 0; |
1255 | 1263 | ||
1256 | ds_dbg(2, "suspending %s\n", dev->bus_id); | 1264 | ds_dev_dbg(2, dev, "suspending\n"); |
1257 | 1265 | ||
1258 | if (dev->driver) | 1266 | if (dev->driver) |
1259 | p_drv = to_pcmcia_drv(dev->driver); | 1267 | p_drv = to_pcmcia_drv(dev->driver); |
@@ -1264,15 +1272,16 @@ static int pcmcia_dev_suspend(struct device * dev, pm_message_t state) | |||
1264 | if (p_drv->suspend) { | 1272 | if (p_drv->suspend) { |
1265 | ret = p_drv->suspend(p_dev); | 1273 | ret = p_drv->suspend(p_dev); |
1266 | if (ret) { | 1274 | if (ret) { |
1267 | printk(KERN_ERR "pcmcia: device %s (driver %s) did " | 1275 | dev_printk(KERN_ERR, dev, |
1268 | "not want to go to sleep (%d)\n", | 1276 | "pcmcia: device %s (driver %s) did " |
1269 | p_dev->devname, p_drv->drv.name, ret); | 1277 | "not want to go to sleep (%d)\n", |
1278 | p_dev->devname, p_drv->drv.name, ret); | ||
1270 | goto out; | 1279 | goto out; |
1271 | } | 1280 | } |
1272 | } | 1281 | } |
1273 | 1282 | ||
1274 | if (p_dev->device_no == p_dev->func) { | 1283 | if (p_dev->device_no == p_dev->func) { |
1275 | ds_dbg(2, "releasing configuration for %s\n", dev->bus_id); | 1284 | ds_dev_dbg(2, dev, "releasing configuration\n"); |
1276 | pcmcia_release_configuration(p_dev); | 1285 | pcmcia_release_configuration(p_dev); |
1277 | } | 1286 | } |
1278 | 1287 | ||
@@ -1292,7 +1301,7 @@ static int pcmcia_dev_resume(struct device * dev) | |||
1292 | if (!p_dev->suspended) | 1301 | if (!p_dev->suspended) |
1293 | return 0; | 1302 | return 0; |
1294 | 1303 | ||
1295 | ds_dbg(2, "resuming %s\n", dev->bus_id); | 1304 | ds_dev_dbg(2, dev, "resuming\n"); |
1296 | 1305 | ||
1297 | if (dev->driver) | 1306 | if (dev->driver) |
1298 | p_drv = to_pcmcia_drv(dev->driver); | 1307 | p_drv = to_pcmcia_drv(dev->driver); |
@@ -1301,7 +1310,7 @@ static int pcmcia_dev_resume(struct device * dev) | |||
1301 | goto out; | 1310 | goto out; |
1302 | 1311 | ||
1303 | if (p_dev->device_no == p_dev->func) { | 1312 | if (p_dev->device_no == p_dev->func) { |
1304 | ds_dbg(2, "requesting configuration for %s\n", dev->bus_id); | 1313 | ds_dev_dbg(2, dev, "requesting configuration\n"); |
1305 | ret = pcmcia_request_configuration(p_dev, &p_dev->conf); | 1314 | ret = pcmcia_request_configuration(p_dev, &p_dev->conf); |
1306 | if (ret) | 1315 | if (ret) |
1307 | goto out; | 1316 | goto out; |
@@ -1343,14 +1352,14 @@ static int pcmcia_bus_resume_callback(struct device *dev, void * _data) | |||
1343 | 1352 | ||
1344 | static int pcmcia_bus_resume(struct pcmcia_socket *skt) | 1353 | static int pcmcia_bus_resume(struct pcmcia_socket *skt) |
1345 | { | 1354 | { |
1346 | ds_dbg(2, "resuming socket %d\n", skt->sock); | 1355 | ds_dev_dbg(2, &skt->dev, "resuming socket %d\n", skt->sock); |
1347 | bus_for_each_dev(&pcmcia_bus_type, NULL, skt, pcmcia_bus_resume_callback); | 1356 | bus_for_each_dev(&pcmcia_bus_type, NULL, skt, pcmcia_bus_resume_callback); |
1348 | return 0; | 1357 | return 0; |
1349 | } | 1358 | } |
1350 | 1359 | ||
1351 | static int pcmcia_bus_suspend(struct pcmcia_socket *skt) | 1360 | static int pcmcia_bus_suspend(struct pcmcia_socket *skt) |
1352 | { | 1361 | { |
1353 | ds_dbg(2, "suspending socket %d\n", skt->sock); | 1362 | ds_dev_dbg(2, &skt->dev, "suspending socket %d\n", skt->sock); |
1354 | if (bus_for_each_dev(&pcmcia_bus_type, NULL, skt, | 1363 | if (bus_for_each_dev(&pcmcia_bus_type, NULL, skt, |
1355 | pcmcia_bus_suspend_callback)) { | 1364 | pcmcia_bus_suspend_callback)) { |
1356 | pcmcia_bus_resume(skt); | 1365 | pcmcia_bus_resume(skt); |
@@ -1376,13 +1385,14 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority) | |||
1376 | struct pcmcia_socket *s = pcmcia_get_socket(skt); | 1385 | struct pcmcia_socket *s = pcmcia_get_socket(skt); |
1377 | 1386 | ||
1378 | if (!s) { | 1387 | if (!s) { |
1379 | printk(KERN_ERR "PCMCIA obtaining reference to socket %p " \ | 1388 | dev_printk(KERN_ERR, &skt->dev, |
1380 | "failed, event 0x%x lost!\n", skt, event); | 1389 | "PCMCIA obtaining reference to socket " \ |
1390 | "failed, event 0x%x lost!\n", event); | ||
1381 | return -ENODEV; | 1391 | return -ENODEV; |
1382 | } | 1392 | } |
1383 | 1393 | ||
1384 | ds_dbg(1, "ds_event(0x%06x, %d, 0x%p)\n", | 1394 | ds_dev_dbg(1, &skt->dev, "ds_event(0x%06x, %d, 0x%p)\n", |
1385 | event, priority, skt); | 1395 | event, priority, skt); |
1386 | 1396 | ||
1387 | switch (event) { | 1397 | switch (event) { |
1388 | case CS_EVENT_CARD_REMOVAL: | 1398 | case CS_EVENT_CARD_REMOVAL: |
@@ -1457,7 +1467,8 @@ static int __devinit pcmcia_bus_add_socket(struct device *dev, | |||
1457 | 1467 | ||
1458 | socket = pcmcia_get_socket(socket); | 1468 | socket = pcmcia_get_socket(socket); |
1459 | if (!socket) { | 1469 | if (!socket) { |
1460 | printk(KERN_ERR "PCMCIA obtaining reference to socket %p failed\n", socket); | 1470 | dev_printk(KERN_ERR, dev, |
1471 | "PCMCIA obtaining reference to socket failed\n"); | ||
1461 | return -ENODEV; | 1472 | return -ENODEV; |
1462 | } | 1473 | } |
1463 | 1474 | ||
@@ -1477,7 +1488,7 @@ static int __devinit pcmcia_bus_add_socket(struct device *dev, | |||
1477 | 1488 | ||
1478 | ret = pccard_register_pcmcia(socket, &pcmcia_bus_callback); | 1489 | ret = pccard_register_pcmcia(socket, &pcmcia_bus_callback); |
1479 | if (ret) { | 1490 | if (ret) { |
1480 | printk(KERN_ERR "PCMCIA registration PCCard core failed for socket %p\n", socket); | 1491 | dev_printk(KERN_ERR, dev, "PCMCIA registration failed\n"); |
1481 | pcmcia_put_socket(socket); | 1492 | pcmcia_put_socket(socket); |
1482 | return (ret); | 1493 | return (ret); |
1483 | } | 1494 | } |