diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-05 04:45:09 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:15:57 -0500 |
commit | fd238232cd0ff4840ae6946bb338502154096d88 (patch) | |
tree | d20e8f5871f7cff9d0867a84f6ba088fbffcbe28 /drivers/bluetooth/bluecard_cs.c | |
parent | a78f4dd331a4f6a396eb5849656a4a72a70a56d7 (diff) |
[PATCH] pcmcia: embed dev_link_t into struct pcmcia_device
Embed dev_link_t into struct pcmcia_device(), as they basically address the
same entity. The actual contents of dev_link_t will be cleaned up step by step.
This patch includes a bugfix from and signed-off-by Andrew Morton.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/bluetooth/bluecard_cs.c')
-rw-r--r-- | drivers/bluetooth/bluecard_cs.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c index 8e23f9ad3e63..b461411eab3e 100644 --- a/drivers/bluetooth/bluecard_cs.c +++ b/drivers/bluetooth/bluecard_cs.c | |||
@@ -65,7 +65,7 @@ MODULE_LICENSE("GPL"); | |||
65 | 65 | ||
66 | 66 | ||
67 | typedef struct bluecard_info_t { | 67 | typedef struct bluecard_info_t { |
68 | dev_link_t link; | 68 | struct pcmcia_device *p_dev; |
69 | dev_node_t node; | 69 | dev_node_t node; |
70 | 70 | ||
71 | struct hci_dev *hdev; | 71 | struct hci_dev *hdev; |
@@ -162,7 +162,7 @@ static void bluecard_detach(struct pcmcia_device *p_dev); | |||
162 | static void bluecard_activity_led_timeout(u_long arg) | 162 | static void bluecard_activity_led_timeout(u_long arg) |
163 | { | 163 | { |
164 | bluecard_info_t *info = (bluecard_info_t *)arg; | 164 | bluecard_info_t *info = (bluecard_info_t *)arg; |
165 | unsigned int iobase = info->link.io.BasePort1; | 165 | unsigned int iobase = info->p_dev->io.BasePort1; |
166 | 166 | ||
167 | if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) | 167 | if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) |
168 | return; | 168 | return; |
@@ -179,7 +179,7 @@ static void bluecard_activity_led_timeout(u_long arg) | |||
179 | 179 | ||
180 | static void bluecard_enable_activity_led(bluecard_info_t *info) | 180 | static void bluecard_enable_activity_led(bluecard_info_t *info) |
181 | { | 181 | { |
182 | unsigned int iobase = info->link.io.BasePort1; | 182 | unsigned int iobase = info->p_dev->io.BasePort1; |
183 | 183 | ||
184 | if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) | 184 | if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) |
185 | return; | 185 | return; |
@@ -235,7 +235,7 @@ static void bluecard_write_wakeup(bluecard_info_t *info) | |||
235 | } | 235 | } |
236 | 236 | ||
237 | do { | 237 | do { |
238 | register unsigned int iobase = info->link.io.BasePort1; | 238 | register unsigned int iobase = info->p_dev->io.BasePort1; |
239 | register unsigned int offset; | 239 | register unsigned int offset; |
240 | register unsigned char command; | 240 | register unsigned char command; |
241 | register unsigned long ready_bit; | 241 | register unsigned long ready_bit; |
@@ -244,7 +244,7 @@ static void bluecard_write_wakeup(bluecard_info_t *info) | |||
244 | 244 | ||
245 | clear_bit(XMIT_WAKEUP, &(info->tx_state)); | 245 | clear_bit(XMIT_WAKEUP, &(info->tx_state)); |
246 | 246 | ||
247 | if (!(info->link.state & DEV_PRESENT)) | 247 | if (!(info->p_dev->state & DEV_PRESENT)) |
248 | return; | 248 | return; |
249 | 249 | ||
250 | if (test_bit(XMIT_BUFFER_NUMBER, &(info->tx_state))) { | 250 | if (test_bit(XMIT_BUFFER_NUMBER, &(info->tx_state))) { |
@@ -382,7 +382,7 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset) | |||
382 | return; | 382 | return; |
383 | } | 383 | } |
384 | 384 | ||
385 | iobase = info->link.io.BasePort1; | 385 | iobase = info->p_dev->io.BasePort1; |
386 | 386 | ||
387 | if (test_bit(XMIT_SENDING_READY, &(info->tx_state))) | 387 | if (test_bit(XMIT_SENDING_READY, &(info->tx_state))) |
388 | bluecard_enable_activity_led(info); | 388 | bluecard_enable_activity_led(info); |
@@ -512,7 +512,7 @@ static irqreturn_t bluecard_interrupt(int irq, void *dev_inst, struct pt_regs *r | |||
512 | if (!test_bit(CARD_READY, &(info->hw_state))) | 512 | if (!test_bit(CARD_READY, &(info->hw_state))) |
513 | return IRQ_HANDLED; | 513 | return IRQ_HANDLED; |
514 | 514 | ||
515 | iobase = info->link.io.BasePort1; | 515 | iobase = info->p_dev->io.BasePort1; |
516 | 516 | ||
517 | spin_lock(&(info->lock)); | 517 | spin_lock(&(info->lock)); |
518 | 518 | ||
@@ -626,7 +626,7 @@ static int bluecard_hci_flush(struct hci_dev *hdev) | |||
626 | static int bluecard_hci_open(struct hci_dev *hdev) | 626 | static int bluecard_hci_open(struct hci_dev *hdev) |
627 | { | 627 | { |
628 | bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data); | 628 | bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data); |
629 | unsigned int iobase = info->link.io.BasePort1; | 629 | unsigned int iobase = info->p_dev->io.BasePort1; |
630 | 630 | ||
631 | if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) | 631 | if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) |
632 | bluecard_hci_set_baud_rate(hdev, DEFAULT_BAUD_RATE); | 632 | bluecard_hci_set_baud_rate(hdev, DEFAULT_BAUD_RATE); |
@@ -646,7 +646,7 @@ static int bluecard_hci_open(struct hci_dev *hdev) | |||
646 | static int bluecard_hci_close(struct hci_dev *hdev) | 646 | static int bluecard_hci_close(struct hci_dev *hdev) |
647 | { | 647 | { |
648 | bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data); | 648 | bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data); |
649 | unsigned int iobase = info->link.io.BasePort1; | 649 | unsigned int iobase = info->p_dev->io.BasePort1; |
650 | 650 | ||
651 | if (!test_and_clear_bit(HCI_RUNNING, &(hdev->flags))) | 651 | if (!test_and_clear_bit(HCI_RUNNING, &(hdev->flags))) |
652 | return 0; | 652 | return 0; |
@@ -713,7 +713,7 @@ static int bluecard_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned l | |||
713 | 713 | ||
714 | static int bluecard_open(bluecard_info_t *info) | 714 | static int bluecard_open(bluecard_info_t *info) |
715 | { | 715 | { |
716 | unsigned int iobase = info->link.io.BasePort1; | 716 | unsigned int iobase = info->p_dev->io.BasePort1; |
717 | struct hci_dev *hdev; | 717 | struct hci_dev *hdev; |
718 | unsigned char id; | 718 | unsigned char id; |
719 | 719 | ||
@@ -831,7 +831,7 @@ static int bluecard_open(bluecard_info_t *info) | |||
831 | 831 | ||
832 | static int bluecard_close(bluecard_info_t *info) | 832 | static int bluecard_close(bluecard_info_t *info) |
833 | { | 833 | { |
834 | unsigned int iobase = info->link.io.BasePort1; | 834 | unsigned int iobase = info->p_dev->io.BasePort1; |
835 | struct hci_dev *hdev = info->hdev; | 835 | struct hci_dev *hdev = info->hdev; |
836 | 836 | ||
837 | if (!hdev) | 837 | if (!hdev) |
@@ -859,14 +859,14 @@ static int bluecard_close(bluecard_info_t *info) | |||
859 | static int bluecard_attach(struct pcmcia_device *p_dev) | 859 | static int bluecard_attach(struct pcmcia_device *p_dev) |
860 | { | 860 | { |
861 | bluecard_info_t *info; | 861 | bluecard_info_t *info; |
862 | dev_link_t *link; | 862 | dev_link_t *link = dev_to_instance(p_dev); |
863 | 863 | ||
864 | /* Create new info device */ | 864 | /* Create new info device */ |
865 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 865 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
866 | if (!info) | 866 | if (!info) |
867 | return -ENOMEM; | 867 | return -ENOMEM; |
868 | 868 | ||
869 | link = &info->link; | 869 | info->p_dev = p_dev; |
870 | link->priv = info; | 870 | link->priv = info; |
871 | 871 | ||
872 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 872 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; |
@@ -880,9 +880,6 @@ static int bluecard_attach(struct pcmcia_device *p_dev) | |||
880 | link->conf.Attributes = CONF_ENABLE_IRQ; | 880 | link->conf.Attributes = CONF_ENABLE_IRQ; |
881 | link->conf.IntType = INT_MEMORY_AND_IO; | 881 | link->conf.IntType = INT_MEMORY_AND_IO; |
882 | 882 | ||
883 | link->handle = p_dev; | ||
884 | p_dev->instance = link; | ||
885 | |||
886 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 883 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
887 | bluecard_config(link); | 884 | bluecard_config(link); |
888 | 885 | ||
@@ -976,7 +973,7 @@ static void bluecard_config(dev_link_t *link) | |||
976 | goto failed; | 973 | goto failed; |
977 | 974 | ||
978 | strcpy(info->node.dev_name, info->hdev->name); | 975 | strcpy(info->node.dev_name, info->hdev->name); |
979 | link->dev = &info->node; | 976 | link->dev_node = &info->node; |
980 | link->state &= ~DEV_CONFIG_PENDING; | 977 | link->state &= ~DEV_CONFIG_PENDING; |
981 | 978 | ||
982 | return; | 979 | return; |