[PATCH] pcmcia: move event handler
authorDominik Brodowski <linux@dominikbrodowski.net>
Fri, 8 Jul 2005 00:59:00 +0000 (17:59 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 8 Jul 2005 01:24:05 +0000 (18:24 -0700)
Move the "event handler" to struct pcmcia_driver -- the unified event handler
will disappear really soon, but switching it to struct pcmcia_driver in the
meantime allows for better "step-by-step" patches.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
43 files changed:
drivers/bluetooth/bluecard_cs.c
drivers/bluetooth/bt3c_cs.c
drivers/bluetooth/btuart_cs.c
drivers/bluetooth/dtl1_cs.c
drivers/char/pcmcia/synclink_cs.c
drivers/ide/legacy/ide-cs.c
drivers/isdn/hardware/avm/avm_cs.c
drivers/isdn/hisax/avma1_cs.c
drivers/isdn/hisax/elsa_cs.c
drivers/isdn/hisax/sedlbauer_cs.c
drivers/isdn/hisax/teles_cs.c
drivers/mtd/maps/pcmciamtd.c
drivers/net/pcmcia/3c574_cs.c
drivers/net/pcmcia/3c589_cs.c
drivers/net/pcmcia/axnet_cs.c
drivers/net/pcmcia/com20020_cs.c
drivers/net/pcmcia/fmvj18x_cs.c
drivers/net/pcmcia/ibmtr_cs.c
drivers/net/pcmcia/nmclan_cs.c
drivers/net/pcmcia/pcnet_cs.c
drivers/net/pcmcia/smc91c92_cs.c
drivers/net/pcmcia/xirc2ps_cs.c
drivers/net/wireless/airo_cs.c
drivers/net/wireless/atmel_cs.c
drivers/net/wireless/netwave_cs.c
drivers/net/wireless/orinoco_cs.c
drivers/net/wireless/ray_cs.c
drivers/net/wireless/wavelan_cs.c
drivers/net/wireless/wl3501_cs.c
drivers/parport/parport_cs.c
drivers/pcmcia/cs_internal.h
drivers/pcmcia/ds.c
drivers/scsi/pcmcia/aha152x_stub.c
drivers/scsi/pcmcia/fdomain_stub.c
drivers/scsi/pcmcia/nsp_cs.c
drivers/scsi/pcmcia/qlogic_stub.c
drivers/scsi/pcmcia/sym53c500_cs.c
drivers/serial/serial_cs.c
drivers/telephony/ixj_pcmcia.c
drivers/usb/host/sl811_cs.c
include/pcmcia/ds.h
sound/pcmcia/pdaudiocf/pdaudiocf.c
sound/pcmcia/vx/vx_entry.c

index 5ef9adb9fe7363919cce8c530a282df0f6b562f9..53661246100ed82010105d40fe6a9caba27434f2 100644 (file)
@@ -895,11 +895,6 @@ static dev_link_t *bluecard_attach(void)
        link->next = dev_list;
        dev_list = link;
        client_reg.dev_info = &dev_info;
-       client_reg.EventMask =
-               CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-               CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-               CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-       client_reg.event_handler = &bluecard_event;
        client_reg.Version = 0x0210;
        client_reg.event_callback_args.client_data = link;
 
@@ -1103,6 +1098,7 @@ static struct pcmcia_driver bluecard_driver = {
                .name   = "bluecard_cs",
        },
        .attach         = bluecard_attach,
+       .event          = bluecard_event,
        .detach         = bluecard_detach,
        .id_table       = bluecard_ids,
 };
index 9013cd759afb755cc9c406f86195ed3f9f1cb616..06539a542e9813212969034471967ad2e5cfe097 100644 (file)
@@ -696,11 +696,6 @@ static dev_link_t *bt3c_attach(void)
        link->next = dev_list;
        dev_list = link;
        client_reg.dev_info = &dev_info;
-       client_reg.EventMask =
-           CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-           CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-           CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-       client_reg.event_handler = &bt3c_event;
        client_reg.Version = 0x0210;
        client_reg.event_callback_args.client_data = link;
 
@@ -947,6 +942,7 @@ static struct pcmcia_driver bt3c_driver = {
                .name   = "bt3c_cs",
        },
        .attach         = bt3c_attach,
+       .event          = bt3c_event,
        .detach         = bt3c_detach,
        .id_table       = bt3c_ids,
 };
index c479484a1f7f0d004aa888be03b6103d2bc85ebb..f15a9cf2b787a76048f93168c30124e178d43b1f 100644 (file)
@@ -615,11 +615,6 @@ static dev_link_t *btuart_attach(void)
        link->next = dev_list;
        dev_list = link;
        client_reg.dev_info = &dev_info;
-       client_reg.EventMask =
-               CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-               CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-               CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-       client_reg.event_handler = &btuart_event;
        client_reg.Version = 0x0210;
        client_reg.event_callback_args.client_data = link;
 
@@ -867,6 +862,7 @@ static struct pcmcia_driver btuart_driver = {
                .name   = "btuart_cs",
        },
        .attach         = btuart_attach,
+       .event          = btuart_event,
        .detach         = btuart_detach,
        .id_table       = btuart_ids,
 };
index bb12f7daeb9195ce8a3981bab468beea50a2c041..58b09a9cc4c66774f51912f1817ec63f625dc666 100644 (file)
@@ -594,11 +594,6 @@ static dev_link_t *dtl1_attach(void)
        link->next = dev_list;
        dev_list = link;
        client_reg.dev_info = &dev_info;
-       client_reg.EventMask =
-               CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-               CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-               CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-       client_reg.event_handler = &dtl1_event;
        client_reg.Version = 0x0210;
        client_reg.event_callback_args.client_data = link;
 
@@ -820,6 +815,7 @@ static struct pcmcia_driver dtl1_driver = {
                .name   = "dtl1_cs",
        },
        .attach         = dtl1_attach,
+       .event          = dtl1_event,
        .detach         = dtl1_detach,
        .id_table       = dtl1_ids,
 };
index 8f36b1758eb6fa61f783bf72088200b81d1413e9..ea691561e0832b3d92e43e806445eee5c2f9c61c 100644 (file)
@@ -593,11 +593,6 @@ static dev_link_t *mgslpc_attach(void)
     dev_list = link;
 
     client_reg.dev_info = &dev_info;
-    client_reg.EventMask =
-           CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-           CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-           CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &mgslpc_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
 
@@ -3093,6 +3088,7 @@ static struct pcmcia_driver mgslpc_driver = {
                .name   = "synclink_cs",
        },
        .attach         = mgslpc_attach,
+       .event          = mgslpc_event,
        .detach         = mgslpc_detach,
        .id_table       = mgslpc_ids,
 };
index 978d27d6452dd5b7e13216fdc3bf11711c0232c3..fde0d5f1b876ceb2081729c0d2914473edf1cb0d 100644 (file)
@@ -134,11 +134,6 @@ static dev_link_t *ide_attach(void)
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.EventMask =
-       CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-       CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-       CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &ide_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -497,6 +492,7 @@ static struct pcmcia_driver ide_cs_driver = {
                .name   = "ide-cs",
        },
        .attach         = ide_attach,
+       .event          = ide_event,
        .detach         = ide_detach,
        .id_table       = ide_ids,
 };
index ee750e9456dd4908a3f48487f1c148a18f1ca118..a30c74fd75dab664717a9088326c1e4a9e7c9e95 100644 (file)
@@ -161,11 +161,6 @@ static dev_link_t *avmcs_attach(void)
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.EventMask =
-       CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-       CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-       CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &avmcs_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -500,6 +495,7 @@ static struct pcmcia_driver avmcs_driver = {
                .name   = "avm_cs",
        },
        .attach = avmcs_attach,
+       .event  = avmcs_event,
        .detach = avmcs_detach,
        .id_table = avmcs_ids,
 };
index 67c60e04a37bdb38f6e5108164b0c8c5a9ab30ee..d3de0e856192c3ebb4fd778cdc7dd215735a155e 100644 (file)
@@ -183,11 +183,6 @@ static dev_link_t *avma1cs_attach(void)
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.EventMask =
-       CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-       CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-       CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &avma1cs_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -514,6 +509,7 @@ static struct pcmcia_driver avma1cs_driver = {
                .name   = "avma1_cs",
        },
        .attach         = avma1cs_attach,
+       .event          = avma1cs_event,
        .detach         = avma1cs_detach,
        .id_table       = avma1cs_ids,
 };
index 9146be547044a071fd3d6ebc6cb6eb32eff22ae4..54f0d68ad796d94af0f08ab0928ed8cf8bfdc352 100644 (file)
@@ -212,11 +212,6 @@ static dev_link_t *elsa_cs_attach(void)
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.EventMask =
-        CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-        CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-        CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &elsa_cs_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -521,6 +516,7 @@ static struct pcmcia_driver elsa_cs_driver = {
                .name   = "elsa_cs",
        },
        .attach         = elsa_cs_attach,
+       .event          = elsa_cs_event,
        .detach         = elsa_cs_detach,
        .id_table       = elsa_ids,
 };
index 058147a6957624fbe434735541386cfa8f50a1cc..baf733e86474874102db2ef2fd8ccaaa20fbe868 100644 (file)
@@ -226,11 +226,6 @@ static dev_link_t *sedlbauer_attach(void)
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.EventMask =
-       CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-       CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-       CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &sedlbauer_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -634,6 +629,7 @@ static struct pcmcia_driver sedlbauer_driver = {
                .name   = "sedlbauer_cs",
        },
        .attach         = sedlbauer_attach,
+       .event          = sedlbauer_event,
        .detach         = sedlbauer_detach,
        .id_table       = sedlbauer_ids,
 };
index 107376ff5b9b53a61683cc0a5d116740e35fb8a3..b8eeb789f901f238352c08baa78f27e89fad2204 100644 (file)
@@ -193,11 +193,6 @@ static dev_link_t *teles_attach(void)
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.EventMask =
-        CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-        CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-        CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &teles_cs_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -501,6 +496,7 @@ static struct pcmcia_driver teles_cs_driver = {
                .name   = "teles_cs",
        },
        .attach         = teles_attach,
+       .event          = teles_cs_event,
        .detach         = teles_detach,
        .id_table       = teles_ids,
 };
index c2655a817e3d7099e9ced9a44de5710a8449471e..aa820ee4c31a960ea5a231a70b7c96fede5dc5e0 100644 (file)
@@ -800,11 +800,6 @@ static dev_link_t *pcmciamtd_attach(void)
 
        /* Register with Card Services */
        client_reg.dev_info = &dev_info;
-       client_reg.EventMask =
-               CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-               CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-               CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-       client_reg.event_handler = &pcmciamtd_event;
        client_reg.Version = 0x0210;
        client_reg.event_callback_args.client_data = link;
        DEBUG(2, "Calling RegisterClient");
@@ -850,6 +845,7 @@ static struct pcmcia_driver pcmciamtd_driver = {
                .name   = "pcmciamtd"
        },
        .attach         = pcmciamtd_attach,
+       .event          = pcmciamtd_event,
        .detach         = pcmciamtd_detach,
        .owner          = THIS_MODULE,
        .id_table       = pcmciamtd_ids,
index f0fc04bd37c4f6404d8458fb16c07c7b7fd293fd..c942964a49d2652601253c75db3d335f92c65c90 100644 (file)
@@ -312,11 +312,6 @@ static dev_link_t *tc574_attach(void)
        link->next = dev_list;
        dev_list = link;
        client_reg.dev_info = &dev_info;
-       client_reg.EventMask =
-               CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-                       CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-                               CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-       client_reg.event_handler = &tc574_event;
        client_reg.Version = 0x0210;
        client_reg.event_callback_args.client_data = link;
        ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -1299,6 +1294,7 @@ static struct pcmcia_driver tc574_driver = {
                .name   = "3c574_cs",
        },
        .attach         = tc574_attach,
+       .event          = tc574_event,
        .detach         = tc574_detach,
        .id_table       = tc574_ids,
 };
index 8fa1b5f0fb68a5f82e3d235e819d8c44852dbbbf..810864c6d1ea0eba1db0c945d301b5b1df3226f6 100644 (file)
@@ -226,11 +226,6 @@ static dev_link_t *tc589_attach(void)
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.EventMask =
-       CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-       CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-       CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &tc589_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -1074,6 +1069,7 @@ static struct pcmcia_driver tc589_driver = {
                .name   = "3c589_cs",
        },
        .attach         = tc589_attach,
+       .event          = tc589_event,
        .detach         = tc589_detach,
         .id_table       = tc589_ids,
 };
index 23ce77b1d5b013bda9fb9770e4b2f9847714fc8a..3d01079598c8e02d5107d9a15eb3d569cecfbb3c 100644 (file)
@@ -181,11 +181,6 @@ static dev_link_t *axnet_attach(void)
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.EventMask =
-       CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-       CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-       CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &axnet_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -884,6 +879,7 @@ static struct pcmcia_driver axnet_cs_driver = {
                .name   = "axnet_cs",
        },
        .attach         = axnet_attach,
+       .event          = axnet_event,
        .detach         = axnet_detach,
        .id_table       = axnet_ids,
 };
index 68d58cc58d31d8ee9f9d2aaafe6a2e02a76aeebb..b5119607d5af36b86002edfa2798f9a4422a3a26 100644 (file)
@@ -200,11 +200,6 @@ static dev_link_t *com20020_attach(void)
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.EventMask =
-        CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-        CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-        CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &com20020_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -495,6 +490,7 @@ static struct pcmcia_driver com20020_cs_driver = {
                .name   = "com20020_cs",
        },
        .attach         = com20020_attach,
+       .event          = com20020_event,
        .detach         = com20020_detach,
        .id_table       = com20020_ids,
 };
index 917adbbf0b5b88e80f39df9242ca450727b4c0f8..c7d9bb1da417af36f0f3c53c5fdc137e2ac80ba8 100644 (file)
@@ -288,11 +288,6 @@ static dev_link_t *fmvj18x_attach(void)
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.EventMask =
-       CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-       CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-       CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &fmvj18x_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -797,6 +792,7 @@ static struct pcmcia_driver fmvj18x_cs_driver = {
                .name   = "fmvj18x_cs",
        },
        .attach         = fmvj18x_attach,
+       .event          = fmvj18x_event,
        .detach         = fmvj18x_detach,
        .id_table       = fmvj18x_ids,
 };
index cf6d073ea558df00b4149aa8a9ab3b09a7a77284..39cec4a1e4b3c566b6b14d83273d72835c2395bf 100644 (file)
@@ -190,11 +190,6 @@ static dev_link_t *ibmtr_attach(void)
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.EventMask =
-        CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-        CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-        CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &ibmtr_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -521,6 +516,7 @@ static struct pcmcia_driver ibmtr_cs_driver = {
                .name   = "ibmtr_cs",
        },
        .attach         = ibmtr_attach,
+       .event          = ibmtr_event,
        .detach         = ibmtr_detach,
        .id_table       = ibmtr_ids,
 };
index b86e7253fbfce721361b2058287e934429ce4e6c..49124dc26b35c733a1c5aeba40281b6a0a749e98 100644 (file)
@@ -502,11 +502,6 @@ static dev_link_t *nmclan_attach(void)
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.EventMask =
-       CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-       CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-       CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &nmclan_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -1688,6 +1683,7 @@ static struct pcmcia_driver nmclan_cs_driver = {
                .name   = "nmclan_cs",
        },
        .attach         = nmclan_attach,
+       .event          = nmclan_event,
        .detach         = nmclan_detach,
        .id_table       = nmclan_ids,
 };
index 855a45d062b19ea77260f1822e5d55984bdaff9b..b22b354af5c058092ae965344be9faf446eb61ac 100644 (file)
@@ -276,11 +276,6 @@ static dev_link_t *pcnet_attach(void)
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.EventMask =
-       CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-       CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-       CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &pcnet_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -1844,6 +1839,7 @@ static struct pcmcia_driver pcnet_driver = {
                .name   = "pcnet_cs",
        },
        .attach         = pcnet_attach,
+       .event          = pcnet_event,
        .detach         = pcnet_detach,
        .owner          = THIS_MODULE,
        .id_table       = pcnet_ids,
index bc01c88c67093877d8bd9685ab45de1131fa2096..6b5471dfb55401e87b333939de519eb9d1a6ff6a 100644 (file)
@@ -370,10 +370,6 @@ static dev_link_t *smc91c92_attach(void)
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.EventMask = CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-       CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-       CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &smc91c92_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -2365,6 +2361,7 @@ static struct pcmcia_driver smc91c92_cs_driver = {
                .name   = "smc91c92_cs",
        },
        .attach         = smc91c92_attach,
+       .event          = smc91c92_event,
        .detach         = smc91c92_detach,
        .id_table       = smc91c92_ids,
 };
index 0cd225e1595c0d6e5d03ea06395e0c19cacce6f8..03d4c0c6b3fdf2b35eea69761a6d6eb61d6287a7 100644 (file)
@@ -619,11 +619,6 @@ xirc2ps_attach(void)
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.EventMask =
-       CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-       CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-       CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &xirc2ps_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     if ((err = pcmcia_register_client(&link->handle, &client_reg))) {
@@ -2016,6 +2011,7 @@ static struct pcmcia_driver xirc2ps_cs_driver = {
                .name   = "xirc2ps_cs",
        },
        .attach         = xirc2ps_attach,
+       .event          = xirc2ps_event,
        .detach         = xirc2ps_detach,
        .id_table       = xirc2ps_ids,
 };
index f10a9523034a650c9a43c9b2c330e89478db449d..fd46393e743e5dd8df27559c09f57aa35b134576 100644 (file)
@@ -210,11 +210,6 @@ static dev_link_t *airo_attach(void)
        link->next = dev_list;
        dev_list = link;
        client_reg.dev_info = &dev_info;
-       client_reg.EventMask =
-               CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-               CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-               CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-       client_reg.event_handler = &airo_event;
        client_reg.Version = 0x0210;
        client_reg.event_callback_args.client_data = link;
        ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -574,6 +569,7 @@ static struct pcmcia_driver airo_driver = {
                .name   = "airo_cs",
        },
        .attach         = airo_attach,
+       .event          = airo_event,
        .detach         = airo_detach,
        .id_table       = airo_ids,
 };
index 86379d4998ac7930d47afe98b7288eb09f938ba8..863be2995036b3e4d87da3c00c794f225036ddfb 100644 (file)
@@ -218,11 +218,6 @@ static dev_link_t *atmel_attach(void)
        link->next = dev_list;
        dev_list = link;
        client_reg.dev_info = &dev_info;
-       client_reg.EventMask =
-               CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-               CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-               CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-       client_reg.event_handler = &atmel_event;
        client_reg.Version = 0x0210;
        client_reg.event_callback_args.client_data = link;
        ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -668,12 +663,13 @@ static struct pcmcia_device_id atmel_ids[] = {
 MODULE_DEVICE_TABLE(pcmcia, atmel_ids);
 
 static struct pcmcia_driver atmel_driver = {
-        .owner          = THIS_MODULE,
-        .drv            = {
-                .name   = "atmel_cs",
+       .owner          = THIS_MODULE,
+       .drv            = {
+               .name   = "atmel_cs",
         },
-        .attach         = atmel_attach,
-        .detach         = atmel_detach,
+       .attach         = atmel_attach,
+       .event          = atmel_event,
+       .detach         = atmel_detach,
        .id_table       = atmel_ids,
 };
 
index e12bd75b269493de8fe19f800202ec42a0d96c1e..bdd3e7083d9e77049d5c8b1a3434f8637c262b10 100644 (file)
@@ -491,11 +491,6 @@ static dev_link_t *netwave_attach(void)
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.EventMask =
-       CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-       CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-       CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &netwave_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -1680,6 +1675,7 @@ static struct pcmcia_driver netwave_driver = {
                .name   = "netwave_cs",
        },
        .attach         = netwave_attach,
+       .event          = netwave_event,
        .detach         = netwave_detach,
        .id_table       = netwave_ids,
 };
index 597c4586d04931e212eb06cb550928a94a6393ae..c883404b1d5926b27e7b07fb0e4f35f91a49ba94 100644 (file)
@@ -186,11 +186,6 @@ orinoco_cs_attach(void)
        dev_list = link;
 
        client_reg.dev_info = &dev_info;
-       client_reg.EventMask =
-               CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-               CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-               CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-       client_reg.event_handler = &orinoco_cs_event;
        client_reg.Version = 0x0210; /* FIXME: what does this mean? */
        client_reg.event_callback_args.client_data = link;
 
@@ -664,6 +659,7 @@ static struct pcmcia_driver orinoco_driver = {
                .name   = DRIVER_NAME,
        },
        .attach         = orinoco_cs_attach,
+       .event          = orinoco_cs_event,
        .detach         = orinoco_cs_detach,
        .id_table       = orinoco_cs_ids,
 };
index 31652af52eac240dd093d62a3e2be025a4f39453..0643b1b94a395c175f7f8889bd2b091cdfdd9bb1 100644 (file)
@@ -393,11 +393,6 @@ static dev_link_t *ray_attach(void)
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.EventMask =
-        CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-        CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-        CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &ray_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
 
@@ -2916,6 +2911,7 @@ static struct pcmcia_driver ray_driver = {
                .name   = "ray_cs",
        },
        .attach         = ray_attach,
+       .event          = ray_event,
        .detach         = ray_detach,
        .id_table       = ray_ids,
 };
index 89532fd929415bd5226b6ffdb2770ff606887f30..f6130a53b7966fe7f9ba5d267b120c9b4f08eff5 100644 (file)
@@ -4684,12 +4684,6 @@ wavelan_attach(void)
 
   /* Register with Card Services */
   client_reg.dev_info = &dev_info;
-  client_reg.EventMask = 
-    CS_EVENT_REGISTRATION_COMPLETE |
-    CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-    CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-    CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-  client_reg.event_handler = &wavelan_event;
   client_reg.Version = 0x0210;
   client_reg.event_callback_args.client_data = link;
 
@@ -4904,6 +4898,7 @@ static struct pcmcia_driver wavelan_driver = {
                .name   = "wavelan_cs",
        },
        .attach         = wavelan_attach,
+       .event          = wavelan_event,
        .detach         = wavelan_detach,
        .id_table       = wavelan_ids,
 };
index e3a900482d920521db9356fb1251e57d59db0c83..e3aaaa5efccf497a4b17f3968e0126365a7da406 100644 (file)
@@ -2005,13 +2005,6 @@ static dev_link_t *wl3501_attach(void)
        link->next               = wl3501_dev_list;
        wl3501_dev_list          = link;
        client_reg.dev_info      = &wl3501_dev_info;
-       client_reg.EventMask     = CS_EVENT_CARD_INSERTION |
-                                  CS_EVENT_RESET_PHYSICAL |
-                                  CS_EVENT_CARD_RESET |
-                                  CS_EVENT_CARD_REMOVAL |
-                                  CS_EVENT_PM_SUSPEND |
-                                  CS_EVENT_PM_RESUME;
-       client_reg.event_handler = wl3501_event;
        client_reg.Version       = 0x0210;
        client_reg.event_callback_args.client_data = link;
        ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -2246,12 +2239,13 @@ static struct pcmcia_device_id wl3501_ids[] = {
 MODULE_DEVICE_TABLE(pcmcia, wl3501_ids);
 
 static struct pcmcia_driver wl3501_driver = {
-       .owner          = THIS_MODULE,
-       .drv            = {
-               .name   = "wl3501_cs",
+       .owner          = THIS_MODULE,
+       .drv            = {
+               .name   = "wl3501_cs",
        },
-       .attach         = wl3501_attach,
-       .detach         = wl3501_detach,
+       .attach         = wl3501_attach,
+       .event          = wl3501_event,
+       .detach         = wl3501_detach,
        .id_table       = wl3501_ids,
 };
 
index ff45662c4f7cb412f430e844de86094328413d14..ad8921a260ec182ee4dc144142f3b5df9d20a0db 100644 (file)
@@ -133,11 +133,6 @@ static dev_link_t *parport_attach(void)
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.EventMask =
-       CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-       CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-       CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &parport_event;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -386,6 +381,7 @@ static struct pcmcia_driver parport_cs_driver = {
                .name   = "parport_cs",
        },
        .attach         = parport_attach,
+       .event          = parport_event,
        .detach         = parport_detach,
        .id_table       = parport_ids,
 
index 0b4c18edfa498ef02a21bb56894e91b6a95dc3e4..e0ba4b5daa1369f595720bac4e93c3f54518eee1 100644 (file)
@@ -114,9 +114,6 @@ static inline void cs_socket_put(struct pcmcia_socket *skt)
 #define CHECK_ERASEQ(q) \
     (((q) == NULL) || ((q)->eraseq_magic != ERASEQ_MAGIC))
 
-#define EVENT(h, e, p) \
-    ((h)->event_handler((e), (p), &(h)->event_callback_args))
-
 /* In cardbus.c */
 int cb_alloc(struct pcmcia_socket *s);
 void cb_free(struct pcmcia_socket *s);
index d5afd557fe370f8a9b0a92b076cd2f4a37d4e4f3..367ebf75beeb27ceaf0533849606b60560ab82d0 100644 (file)
@@ -207,6 +207,10 @@ static void pcmcia_check_driver(struct pcmcia_driver *p_drv)
        unsigned int i;
        u32 hash;
 
+       if (!p_drv->attach || !p_drv->event || !p_drv->detach)
+               printk(KERN_DEBUG "pcmcia: %s does misses a callback function",
+                      p_drv->drv.name);
+
        while (did && did->match_flags) {
                for (i=0; i<4; i++) {
                        if (!did->prod_id[i])
@@ -914,6 +918,7 @@ struct send_event_data {
 static int send_event_callback(struct device *dev, void * _data)
 {
        struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
+       struct pcmcia_driver *p_drv;
        struct send_event_data *data = _data;
 
        /* we get called for all sockets, but may only pass the event
@@ -921,11 +926,16 @@ static int send_event_callback(struct device *dev, void * _data)
        if (p_dev->socket != data->skt)
                return 0;
 
+       p_drv = to_pcmcia_drv(p_dev->dev.driver);
+       if (!p_drv)
+               return 0;
+
        if (p_dev->client.state & (CLIENT_UNBOUND|CLIENT_STALE))
                return 0;
 
-       if (p_dev->client.EventMask & data->event)
-               return EVENT(&p_dev->client, data->event, data->priority);
+       if (p_drv->event)
+               return p_drv->event(data->event, data->priority,
+                                   &p_dev->event_callback_args);
 
        return 0;
 }
@@ -992,6 +1002,7 @@ int pcmcia_register_client(client_handle_t *handle, client_reg_t *req)
        client_t *client = NULL;
        struct pcmcia_socket *s = NULL;
        struct pcmcia_device *p_dev = NULL;
+       struct pcmcia_driver *p_drv = NULL;
 
        /* Look for unbound client with matching dev_info */
        down_read(&pcmcia_socket_list_rwsem);
@@ -1006,7 +1017,6 @@ int pcmcia_register_client(client_handle_t *handle, client_reg_t *req)
                        continue;
                spin_lock_irqsave(&pcmcia_dev_list_lock, flags);
                list_for_each_entry(p_dev, &s->devices_list, socket_device_list) {
-                       struct pcmcia_driver *p_drv;
                        p_dev = pcmcia_get_dev(p_dev);
                        if (!p_dev)
                                continue;
@@ -1036,10 +1046,9 @@ int pcmcia_register_client(client_handle_t *handle, client_reg_t *req)
        *handle = client;
        client->state &= ~CLIENT_UNBOUND;
        client->Socket = s;
-       client->EventMask = req->EventMask;
-       client->event_handler = req->event_handler;
-       client->event_callback_args = req->event_callback_args;
-       client->event_callback_args.client_handle = client;
+       p_dev->event_callback_args = req->event_callback_args;
+       p_dev->event_callback_args.client_handle = client;
+
 
        if (s->state & SOCKET_CARDBUS)
                client->state |= CLIENT_CARDBUS;
@@ -1061,12 +1070,12 @@ int pcmcia_register_client(client_handle_t *handle, client_reg_t *req)
 
        ds_dbg(1, "register_client(): client 0x%p, dev %s\n",
               client, p_dev->dev.bus_id);
-       if (client->EventMask & CS_EVENT_REGISTRATION_COMPLETE)
-               EVENT(client, CS_EVENT_REGISTRATION_COMPLETE, CS_EVENT_PRI_LOW);
 
        if ((s->state & (SOCKET_PRESENT|SOCKET_CARDBUS)) == SOCKET_PRESENT) {
-               if (client->EventMask & CS_EVENT_CARD_INSERTION)
-                       EVENT(client, CS_EVENT_CARD_INSERTION, CS_EVENT_PRI_LOW);
+               if (p_drv->event)
+                       p_drv->event(CS_EVENT_CARD_INSERTION, CS_EVENT_PRI_LOW,
+                                    &p_dev->event_callback_args);
+
        }
 
        return CS_SUCCESS;
@@ -1132,7 +1141,6 @@ int pcmcia_deregister_client(client_handle_t handle)
                pcmcia_put_dev(p_dev);
        } else {
                handle->state = CLIENT_UNBOUND;
-               handle->event_handler = NULL;
        }
 
        return CS_SUCCESS;
index f1f6bf596dc9f9206521d0b8855863c598ee489f..3dc6957bad102037938905f0f804c7c1a7616abf 100644 (file)
@@ -134,11 +134,6 @@ static dev_link_t *aha152x_attach(void)
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.event_handler = &aha152x_event;
-    client_reg.EventMask =
-       CS_EVENT_RESET_REQUEST | CS_EVENT_CARD_RESET |
-       CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-       CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -334,6 +329,7 @@ static struct pcmcia_driver aha152x_cs_driver = {
                .name   = "aha152x_cs",
        },
        .attach         = aha152x_attach,
+       .event          = aha152x_event,
        .detach         = aha152x_detach,
        .id_table       = aha152x_ids,
 };
index 853e6ee9b71a2e7acec53132ef01cae7ca3f92c0..d2281eba790d2b2af9e6f39ef07c2fac4aec661a 100644 (file)
@@ -120,11 +120,6 @@ static dev_link_t *fdomain_attach(void)
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.event_handler = &fdomain_event;
-    client_reg.EventMask =
-       CS_EVENT_RESET_REQUEST | CS_EVENT_CARD_RESET |
-       CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-       CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -314,6 +309,7 @@ static struct pcmcia_driver fdomain_cs_driver = {
                .name   = "fdomain_cs",
        },
        .attach         = fdomain_attach,
+       .event          = fdomain_event,
        .detach         = fdomain_detach,
        .id_table       = fdomain_ids,
 };
index 91b3f28e7a19ddc3dd66942124c7bd5cd2fc786c..c8755adfd917e616942c2ed1486cb6dd7b697425 100644 (file)
@@ -1642,11 +1642,6 @@ static dev_link_t *nsp_cs_attach(void)
        link->next               = dev_list;
        dev_list                 = link;
        client_reg.dev_info      = &dev_info;
-       client_reg.EventMask     =
-               CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-               CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET   |
-               CS_EVENT_PM_SUSPEND     | CS_EVENT_PM_RESUME     ;
-       client_reg.event_handler = &nsp_cs_event;
        client_reg.Version       = 0x0210;
        client_reg.event_callback_args.client_data = link;
        ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -2138,12 +2133,13 @@ static struct pcmcia_device_id nsp_cs_ids[] = {
 MODULE_DEVICE_TABLE(pcmcia, nsp_cs_ids);
 
 static struct pcmcia_driver nsp_driver = {
-       .owner          = THIS_MODULE,
-       .drv            = {
-               .name   = "nsp_cs",
+       .owner          = THIS_MODULE,
+       .drv            = {
+               .name   = "nsp_cs",
        },
-       .attach         = nsp_cs_attach,
-       .detach         = nsp_cs_detach,
+       .attach         = nsp_cs_attach,
+       .event          = nsp_cs_event,
+       .detach         = nsp_cs_detach,
        .id_table       = nsp_cs_ids,
 };
 #endif
index 0dcf41102abf0c685fc313e99b5bbdd2bbd09713..e6e496180d113f345aa91bbd54b5410b99d33d18 100644 (file)
@@ -194,8 +194,6 @@ static dev_link_t *qlogic_attach(void)
        link->next = dev_list;
        dev_list = link;
        client_reg.dev_info = &dev_info;
-       client_reg.event_handler = &qlogic_event;
-       client_reg.EventMask = CS_EVENT_RESET_REQUEST | CS_EVENT_CARD_RESET | CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL | CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
        client_reg.Version = 0x0210;
        client_reg.event_callback_args.client_data = link;
        ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -423,6 +421,7 @@ static struct pcmcia_driver qlogic_cs_driver = {
        .name           = "qlogic_cs",
        },
        .attach         = qlogic_attach,
+       .event          = qlogic_event,
        .detach         = qlogic_detach,
        .id_table       = qlogic_ids,
 };
index 7d4b16b6797dac2562431a73326b5ad8e4d6ac15..b4b3a1a8a0c7f41aebcf6e1c6939f94c01398caa 100644 (file)
@@ -979,10 +979,6 @@ SYM53C500_attach(void)
        link->next = dev_list;
        dev_list = link;
        client_reg.dev_info = &dev_info;
-       client_reg.event_handler = &SYM53C500_event;
-       client_reg.EventMask = CS_EVENT_RESET_REQUEST | CS_EVENT_CARD_RESET |
-           CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-           CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
        client_reg.Version = 0x0210;
        client_reg.event_callback_args.client_data = link;
        ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -1013,6 +1009,7 @@ static struct pcmcia_driver sym53c500_cs_driver = {
                .name   = "sym53c500_cs",
        },
        .attach         = SYM53C500_attach,
+       .event          = SYM53C500_event,
        .detach         = SYM53C500_detach,
        .id_table       = sym53c500_ids,
 };
index 73a34b18866f405ee8a5d147a42ce9e46108a83d..83bfd11a1cc4af3803eda2f74a963c021477a59e 100644 (file)
@@ -232,11 +232,6 @@ static dev_link_t *serial_attach(void)
        link->next = dev_list;
        dev_list = link;
        client_reg.dev_info = &dev_info;
-       client_reg.EventMask =
-           CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-           CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-           CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-       client_reg.event_handler = &serial_event;
        client_reg.Version = 0x0210;
        client_reg.event_callback_args.client_data = link;
        ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -883,6 +878,7 @@ static struct pcmcia_driver serial_cs_driver = {
                .name   = "serial_cs",
        },
        .attach         = serial_attach,
+       .event          = serial_event,
        .detach         = serial_detach,
        .id_table       = serial_ids,
 };
index ce5ebfe4af2b5e36e3a632aaeade29ecc9811022..2fcb4db3abc508709a44ef7259dae5c65809621f 100644 (file)
@@ -69,11 +69,6 @@ static dev_link_t *ixj_attach(void)
        link->next = dev_list;
        dev_list = link;
        client_reg.dev_info = &dev_info;
-       client_reg.EventMask =
-           CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-           CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-           CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-       client_reg.event_handler = &ixj_event;
        client_reg.Version = 0x0210;
        client_reg.event_callback_args.client_data = link;
        ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -307,6 +302,7 @@ static struct pcmcia_driver ixj_driver = {
                .name   = "ixj_cs",
        },
        .attach         = ixj_attach,
+       .event          = ixj_event,
        .detach         = ixj_detach,
        .id_table       = ixj_ids,
 };
index 269d8ef01459d7834f699eb6f5c08ebf61ad2ecc..55dfeec6fdb53c7800aaf085824ebbb176dcbfb1 100644 (file)
@@ -389,11 +389,6 @@ static dev_link_t *sl811_cs_attach(void)
        dev_list = link;
        client_reg.dev_info = (dev_info_t *) &driver_name;
        client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;
-       client_reg.EventMask =
-               CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-               CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-               CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-       client_reg.event_handler = &sl811_cs_event;
        client_reg.Version = 0x0210;
        client_reg.event_callback_args.client_data = link;
        ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -418,6 +413,7 @@ static struct pcmcia_driver sl811_cs_driver = {
                .name   = (char *)driver_name,
        },
        .attach         = sl811_cs_attach,
+       .event          = sl811_cs_event,
        .detach         = sl811_cs_detach,
        .id_table       = sl811_ids,
 };
index 2b52553f2d945d3ff7c65ecdfb838b440745b1c5..c574ff1081485b3a005bba42b1a5ebe459f35495 100644 (file)
@@ -133,6 +133,8 @@ struct pcmcia_socket;
 
 struct pcmcia_driver {
        dev_link_t              *(*attach)(void);
+       int (*event)            (event_t event, int priority,
+                                event_callback_args_t *);
        void                    (*detach)(dev_link_t *);
        struct module           *owner;
        struct pcmcia_device_id *id_table;
@@ -159,15 +161,13 @@ struct pcmcia_device {
        /* deprecated, a cleaned up version will be moved into this
           struct soon */
        dev_link_t              *instance;
+       event_callback_args_t   event_callback_args;
+
        struct client_t {
                u_short                 client_magic;
                struct pcmcia_socket    *Socket;
                u_char                  Function;
                u_int                   state;
-               event_t                 EventMask;
-               int (*event_handler)    (event_t event, int priority,
-                                        event_callback_args_t *);
-               event_callback_args_t   event_callback_args;
        }                       client;
 
        /* information about this device */
index 2d4f8e28478b037183ef34db38b49ce3d5e22571..c8622f5f7c3a5bd4933425385fc5a6408447244b 100644 (file)
@@ -171,14 +171,6 @@ static dev_link_t *snd_pdacf_attach(void)
 
        /* Register with Card Services */
        client_reg.dev_info = &dev_info;
-       client_reg.EventMask = 
-               CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL
-#ifdef CONFIG_PM
-               | CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET
-               | CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME
-#endif
-               ;
-       client_reg.event_handler = &pdacf_event;
        client_reg.Version = 0x0210;
        client_reg.event_callback_args.client_data = link;
 
@@ -387,12 +379,13 @@ static struct pcmcia_device_id snd_pdacf_ids[] = {
 MODULE_DEVICE_TABLE(pcmcia, snd_pdacf_ids);
 
 static struct pcmcia_driver pdacf_cs_driver = {
-       .owner          = THIS_MODULE,
-       .drv            = {
-               .name   = "snd-pdaudiocf",
+       .owner          = THIS_MODULE,
+       .drv            = {
+               .name   = "snd-pdaudiocf",
        },
-       .attach         = snd_pdacf_attach,
-       .detach         = snd_pdacf_detach,
+       .attach         = snd_pdacf_attach,
+       .event          = pdacf_event,
+       .detach         = snd_pdacf_detach,
        .id_table       = snd_pdacf_ids,
 };
 
index 332bbca3dfc4ff0459ca7b57526204c90e4a268c..df7a39ba9680829b3ff1ddd4ac74b600dee5b676 100644 (file)
@@ -35,7 +35,6 @@ MODULE_LICENSE("GPL");
  * prototypes
  */
 static void vxpocket_config(dev_link_t *link);
-static int vxpocket_event(event_t event, int priority, event_callback_args_t *args);
 
 
 static void vxpocket_release(dev_link_t *link)
@@ -169,14 +168,6 @@ dev_link_t *snd_vxpocket_attach(struct snd_vxp_entry *hw)
        /* Register with Card Services */
        memset(&client_reg, 0, sizeof(client_reg));
        client_reg.dev_info = hw->dev_info;
-       client_reg.EventMask = 
-               CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL
-#ifdef CONFIG_PM
-               | CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET
-               | CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME
-#endif
-               ;
-       client_reg.event_handler = &vxpocket_event;
        client_reg.Version = 0x0210;
        client_reg.event_callback_args.client_data = link;
 
@@ -321,7 +312,7 @@ failed:
 /*
  * event callback
  */
-static int vxpocket_event(event_t event, int priority, event_callback_args_t *args)
+int vxpocket_event(event_t event, int priority, event_callback_args_t *args)
 {
        dev_link_t *link = args->client_data;
        vx_core_t *chip = link->priv;
@@ -380,4 +371,5 @@ static int vxpocket_event(event_t event, int priority, event_callback_args_t *ar
  */
 EXPORT_SYMBOL(snd_vxpocket_ops);
 EXPORT_SYMBOL(snd_vxpocket_attach);
+EXPORT_SYMBOL(vxpocket_event);
 EXPORT_SYMBOL(snd_vxpocket_detach);