aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/dtl1_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-01 18:09:29 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:26:33 -0500
commite2d4096365e06b9a3799afbadc28b4519c0b3526 (patch)
tree90ec691d71f9c0309048714e359b8ba351b533f7 /drivers/bluetooth/dtl1_cs.c
parentf6fbe01ac976f3ec618cd5fb71ad9ce2cfa7ab2b (diff)
[PATCH] pcmcia: use bitfield instead of p_state and state
Instead of the two status values struct pcmcia_device->p_state and state, use descriptive bitfields. Most value-checking in drivers was invalid, as the core now only calls the ->remove() (a.k.a. detach) function in case the attachement _and_ configuration was successful. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/bluetooth/dtl1_cs.c')
-rw-r--r--drivers/bluetooth/dtl1_cs.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index 0ec7fd4c9214..a71a240611e0 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -159,7 +159,7 @@ static void dtl1_write_wakeup(dtl1_info_t *info)
159 159
160 clear_bit(XMIT_WAKEUP, &(info->tx_state)); 160 clear_bit(XMIT_WAKEUP, &(info->tx_state));
161 161
162 if (!(info->p_dev->state & DEV_PRESENT)) 162 if (!pcmcia_dev_present(info->p_dev))
163 return; 163 return;
164 164
165 if (!(skb = skb_dequeue(&(info->txq)))) 165 if (!(skb = skb_dequeue(&(info->txq))))
@@ -578,7 +578,6 @@ static int dtl1_probe(struct pcmcia_device *link)
578 link->conf.Attributes = CONF_ENABLE_IRQ; 578 link->conf.Attributes = CONF_ENABLE_IRQ;
579 link->conf.IntType = INT_MEMORY_AND_IO; 579 link->conf.IntType = INT_MEMORY_AND_IO;
580 580
581 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
582 return dtl1_config(link); 581 return dtl1_config(link);
583} 582}
584 583
@@ -587,8 +586,7 @@ static void dtl1_detach(struct pcmcia_device *link)
587{ 586{
588 dtl1_info_t *info = link->priv; 587 dtl1_info_t *info = link->priv;
589 588
590 if (link->state & DEV_CONFIG) 589 dtl1_release(link);
591 dtl1_release(link);
592 590
593 kfree(info); 591 kfree(info);
594} 592}
@@ -642,9 +640,6 @@ static int dtl1_config(struct pcmcia_device *link)
642 link->conf.ConfigBase = parse.config.base; 640 link->conf.ConfigBase = parse.config.base;
643 link->conf.Present = parse.config.rmask[0]; 641 link->conf.Present = parse.config.rmask[0];
644 642
645 /* Configure card */
646 link->state |= DEV_CONFIG;
647
648 tuple.TupleData = (cisdata_t *)buf; 643 tuple.TupleData = (cisdata_t *)buf;
649 tuple.TupleOffset = 0; 644 tuple.TupleOffset = 0;
650 tuple.TupleDataMax = 255; 645 tuple.TupleDataMax = 255;
@@ -689,7 +684,6 @@ static int dtl1_config(struct pcmcia_device *link)
689 684
690 strcpy(info->node.dev_name, info->hdev->name); 685 strcpy(info->node.dev_name, info->hdev->name);
691 link->dev_node = &info->node; 686 link->dev_node = &info->node;
692 link->state &= ~DEV_CONFIG_PENDING;
693 687
694 return 0; 688 return 0;
695 689
@@ -706,8 +700,7 @@ static void dtl1_release(struct pcmcia_device *link)
706{ 700{
707 dtl1_info_t *info = link->priv; 701 dtl1_info_t *info = link->priv;
708 702
709 if (link->state & DEV_PRESENT) 703 dtl1_close(info);
710 dtl1_close(info);
711 704
712 pcmcia_disable_device(link); 705 pcmcia_disable_device(link);
713} 706}