summaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/dtl1_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-11-14 21:25:51 +0100
committerDominik Brodowski <linux@dominikbrodowski.net>2006-01-06 00:03:24 +0100
commitf8cfa618dccbdc6dab5297f75779566a388a98fd (patch)
treeb91e0952038dafc6e03bf8b1d8948b1fdefec031 /drivers/bluetooth/dtl1_cs.c
parentb463581154f3f3eecda27cae60df813fefcd84d3 (diff)
downloadop-kernel-dev-f8cfa618dccbdc6dab5297f75779566a388a98fd.zip
op-kernel-dev-f8cfa618dccbdc6dab5297f75779566a388a98fd.tar.gz
[PATCH] pcmcia: unify attach, EVENT_CARD_INSERTION handlers into one probe callback
Unify the EVENT_CARD_INSERTION and "attach" callbacks to one unified probe() callback. As all in-kernel drivers are changed to this new callback, there will be no temporary backwards-compatibility. Inside a probe() function, each driver _must_ set struct pcmcia_device *p_dev->instance and instance->handle correctly. With these patches, the basic driver interface for 16-bit PCMCIA drivers now has the classic four callbacks known also from other buses: int (*probe) (struct pcmcia_device *dev); void (*remove) (struct pcmcia_device *dev); int (*suspend) (struct pcmcia_device *dev); int (*resume) (struct pcmcia_device *dev); Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/bluetooth/dtl1_cs.c')
-rw-r--r--drivers/bluetooth/dtl1_cs.c45
1 files changed, 9 insertions, 36 deletions
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index c39d457..787c5eb 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -89,11 +89,7 @@ typedef struct dtl1_info_t {
static void dtl1_config(dev_link_t *link);
static void dtl1_release(dev_link_t *link);
-static int dtl1_event(event_t event, int priority, event_callback_args_t *args);
-static dev_info_t dev_info = "dtl1_cs";
-
-static dev_link_t *dtl1_attach(void);
static void dtl1_detach(struct pcmcia_device *p_dev);
@@ -559,17 +555,15 @@ static int dtl1_close(dtl1_info_t *info)
return 0;
}
-static dev_link_t *dtl1_attach(void)
+static int dtl1_attach(struct pcmcia_device *p_dev)
{
dtl1_info_t *info;
- client_reg_t client_reg;
dev_link_t *link;
- int ret;
/* Create new info device */
info = kzalloc(sizeof(*info), GFP_KERNEL);
if (!info)
- return NULL;
+ return -ENOMEM;
link = &info->link;
link->priv = info;
@@ -586,20 +580,13 @@ static dev_link_t *dtl1_attach(void)
link->conf.Vcc = 50;
link->conf.IntType = INT_MEMORY_AND_IO;
- /* 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);
- dtl1_detach(link->handle);
- return NULL;
- }
+ link->handle = p_dev;
+ p_dev->instance = link;
- return link;
+ link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
+ dtl1_config(link);
+
+ return 0;
}
@@ -764,19 +751,6 @@ static int dtl1_resume(struct pcmcia_device *dev)
return 0;
}
-static int dtl1_event(event_t event, int priority, event_callback_args_t *args)
-{
- dev_link_t *link = args->client_data;
-
- switch (event) {
- case CS_EVENT_CARD_INSERTION:
- link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- dtl1_config(link);
- break;
- }
-
- return 0;
-}
static struct pcmcia_device_id dtl1_ids[] = {
PCMCIA_DEVICE_PROD_ID12("Nokia Mobile Phones", "DTL-1", 0xe1bfdd64, 0xe168480d),
@@ -790,8 +764,7 @@ static struct pcmcia_driver dtl1_driver = {
.drv = {
.name = "dtl1_cs",
},
- .attach = dtl1_attach,
- .event = dtl1_event,
+ .probe = dtl1_attach,
.remove = dtl1_detach,
.id_table = dtl1_ids,
.suspend = dtl1_suspend,
OpenPOWER on IntegriCloud