ds.c (2d8ad8719591fa803b0d589ed057fa46f49b7155) ds.c (e9fb13bfec7e017130ddc5c1b5466340470f4900)
1/*
2 * ds.c -- 16-bit PCMCIA core support
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * The initial developer of the original code is David A. Hinds

--- 31 unchanged lines hidden (view full) ---

40MODULE_DESCRIPTION("PCMCIA Driver Services");
41MODULE_LICENSE("GPL");
42
43
44/*====================================================================*/
45
46static void pcmcia_check_driver(struct pcmcia_driver *p_drv)
47{
1/*
2 * ds.c -- 16-bit PCMCIA core support
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * The initial developer of the original code is David A. Hinds

--- 31 unchanged lines hidden (view full) ---

40MODULE_DESCRIPTION("PCMCIA Driver Services");
41MODULE_LICENSE("GPL");
42
43
44/*====================================================================*/
45
46static void pcmcia_check_driver(struct pcmcia_driver *p_drv)
47{
48 struct pcmcia_device_id *did = p_drv->id_table;
48 const struct pcmcia_device_id *did = p_drv->id_table;
49 unsigned int i;
50 u32 hash;
51
52 if (!p_drv->probe || !p_drv->remove)
53 printk(KERN_DEBUG "pcmcia: %s lacks a requisite callback "
54 "function\n", p_drv->name);
55
56 while (did && did->match_flags) {

--- 722 unchanged lines hidden (view full) ---

779{
780 return -ENODEV;
781}
782
783#endif
784
785
786static inline int pcmcia_devmatch(struct pcmcia_device *dev,
49 unsigned int i;
50 u32 hash;
51
52 if (!p_drv->probe || !p_drv->remove)
53 printk(KERN_DEBUG "pcmcia: %s lacks a requisite callback "
54 "function\n", p_drv->name);
55
56 while (did && did->match_flags) {

--- 722 unchanged lines hidden (view full) ---

779{
780 return -ENODEV;
781}
782
783#endif
784
785
786static inline int pcmcia_devmatch(struct pcmcia_device *dev,
787 struct pcmcia_device_id *did)
787 const struct pcmcia_device_id *did)
788{
789 if (did->match_flags & PCMCIA_DEV_ID_MATCH_MANF_ID) {
790 if ((!dev->has_manf_id) || (dev->manf_id != did->manf_id))
791 return 0;
792 }
793
794 if (did->match_flags & PCMCIA_DEV_ID_MATCH_CARD_ID) {
795 if ((!dev->has_card_id) || (dev->card_id != did->card_id))

--- 89 unchanged lines hidden (view full) ---

885 return 1;
886}
887
888
889static int pcmcia_bus_match(struct device *dev, struct device_driver *drv)
890{
891 struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
892 struct pcmcia_driver *p_drv = to_pcmcia_drv(drv);
788{
789 if (did->match_flags & PCMCIA_DEV_ID_MATCH_MANF_ID) {
790 if ((!dev->has_manf_id) || (dev->manf_id != did->manf_id))
791 return 0;
792 }
793
794 if (did->match_flags & PCMCIA_DEV_ID_MATCH_CARD_ID) {
795 if ((!dev->has_card_id) || (dev->card_id != did->card_id))

--- 89 unchanged lines hidden (view full) ---

885 return 1;
886}
887
888
889static int pcmcia_bus_match(struct device *dev, struct device_driver *drv)
890{
891 struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
892 struct pcmcia_driver *p_drv = to_pcmcia_drv(drv);
893 struct pcmcia_device_id *did = p_drv->id_table;
893 const struct pcmcia_device_id *did = p_drv->id_table;
894 struct pcmcia_dynid *dynid;
895
896 /* match dynamic devices first */
897 mutex_lock(&p_drv->dynids.lock);
898 list_for_each_entry(dynid, &p_drv->dynids.list, node) {
899 dev_dbg(dev, "trying to match to %s\n", drv->name);
900 if (pcmcia_devmatch(p_dev, &dynid->id)) {
901 dev_dbg(dev, "matched to %s\n", drv->name);

--- 541 unchanged lines hidden ---
894 struct pcmcia_dynid *dynid;
895
896 /* match dynamic devices first */
897 mutex_lock(&p_drv->dynids.lock);
898 list_for_each_entry(dynid, &p_drv->dynids.list, node) {
899 dev_dbg(dev, "trying to match to %s\n", drv->name);
900 if (pcmcia_devmatch(p_dev, &dynid->id)) {
901 dev_dbg(dev, "matched to %s\n", drv->name);

--- 541 unchanged lines hidden ---