aboutsummaryrefslogtreecommitdiff
path: root/drivers/telephony
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/telephony')
-rw-r--r--drivers/telephony/ixj_pcmcia.c48
1 files changed, 13 insertions, 35 deletions
diff --git a/drivers/telephony/ixj_pcmcia.c b/drivers/telephony/ixj_pcmcia.c
index 6b992985d78..d3a7b0c3d38 100644
--- a/drivers/telephony/ixj_pcmcia.c
+++ b/drivers/telephony/ixj_pcmcia.c
@@ -34,23 +34,19 @@ typedef struct ixj_info_t {
struct ixj *port;
} ixj_info_t;
-static dev_link_t *ixj_attach(void);
static void ixj_detach(struct pcmcia_device *p_dev);
static void ixj_config(dev_link_t * link);
static void ixj_cs_release(dev_link_t * link);
-static int ixj_event(event_t event, int priority, event_callback_args_t * args);
-static dev_info_t dev_info = "ixj_cs";
-static dev_link_t *ixj_attach(void)
+static int ixj_attach(struct pcmcia_device *p_dev)
{
- client_reg_t client_reg;
dev_link_t *link;
- int ret;
+
DEBUG(0, "ixj_attach()\n");
/* Create new ixj device */
link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL);
if (!link)
- return NULL;
+ return -ENOMEM;
memset(link, 0, sizeof(struct dev_link_t));
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
@@ -60,21 +56,17 @@ static dev_link_t *ixj_attach(void)
link->priv = kmalloc(sizeof(struct ixj_info_t), GFP_KERNEL);
if (!link->priv) {
kfree(link);
- return NULL;
+ return -ENOMEM;
}
memset(link->priv, 0, sizeof(struct ixj_info_t));
- /* Register with Card Services */
- link->next = NULL;
- client_reg.dev_info = &dev_info;
- client_reg.Version = 0x0210;
- client_reg.event_callback_args.client_data = link;
- ret = pcmcia_register_client(&link->handle, &client_reg);
- if (ret != CS_SUCCESS) {
- cs_error(link->handle, RegisterClient, ret);
- ixj_detach(link->handle);
- return NULL;
- }
- return link;
+
+ link->handle = p_dev;
+ p_dev->instance = link;
+
+ link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
+ ixj_config(link);
+
+ return 0;
}
static void ixj_detach(struct pcmcia_device *p_dev)
@@ -265,19 +257,6 @@ static int ixj_resume(struct pcmcia_device *dev)
return 0;
}
-static int ixj_event(event_t event, int priority, event_callback_args_t * args)
-{
- dev_link_t *link = args->client_data;
- DEBUG(1, "ixj_event(0x%06x)\n", event);
- switch (event) {
- case CS_EVENT_CARD_INSERTION:
- link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- ixj_config(link);
- break;
- }
- return 0;
-}
-
static struct pcmcia_device_id ixj_ids[] = {
PCMCIA_DEVICE_MANF_CARD(0x0257, 0x0600),
PCMCIA_DEVICE_NULL
@@ -289,8 +268,7 @@ static struct pcmcia_driver ixj_driver = {
.drv = {
.name = "ixj_cs",
},
- .attach = ixj_attach,
- .event = ixj_event,
+ .probe = ixj_attach,
.remove = ixj_detach,
.id_table = ixj_ids,
.suspend = ixj_suspend,