Browse Source

[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>
imx_3.10.17_1.0.0_ga
Dominik Brodowski 15 years ago
parent
commit
fd238232cd
52 changed files with 446 additions and 729 deletions
  1. +14
    -17
      drivers/bluetooth/bluecard_cs.c
  2. +10
    -16
      drivers/bluetooth/bt3c_cs.c
  3. +11
    -14
      drivers/bluetooth/btuart_cs.c
  4. +11
    -14
      drivers/bluetooth/dtl1_cs.c
  5. +13
    -16
      drivers/char/pcmcia/cm4000_cs.c
  6. +13
    -16
      drivers/char/pcmcia/cm4040_cs.c
  7. +9
    -12
      drivers/char/pcmcia/synclink_cs.c
  8. +6
    -7
      drivers/ide/legacy/ide-cs.c
  9. +16
    -29
      drivers/isdn/hardware/avm/avm_cs.c
  10. +18
    -30
      drivers/isdn/hisax/avma1_cs.c
  11. +7
    -7
      drivers/isdn/hisax/elsa_cs.c
  12. +7
    -9
      drivers/isdn/hisax/sedlbauer_cs.c
  13. +6
    -7
      drivers/isdn/hisax/teles_cs.c
  14. +9
    -13
      drivers/mtd/maps/pcmciamtd.c
  15. +8
    -11
      drivers/net/pcmcia/3c574_cs.c
  16. +10
    -13
      drivers/net/pcmcia/3c589_cs.c
  17. +8
    -11
      drivers/net/pcmcia/axnet_cs.c
  18. +15
    -24
      drivers/net/pcmcia/com20020_cs.c
  19. +8
    -11
      drivers/net/pcmcia/fmvj18x_cs.c
  20. +7
    -10
      drivers/net/pcmcia/ibmtr_cs.c
  21. +9
    -12
      drivers/net/pcmcia/nmclan_cs.c
  22. +9
    -12
      drivers/net/pcmcia/pcnet_cs.c
  23. +8
    -11
      drivers/net/pcmcia/smc91c92_cs.c
  24. +8
    -11
      drivers/net/pcmcia/xirc2ps_cs.c
  25. +10
    -23
      drivers/net/wireless/airo_cs.c
  26. +10
    -23
      drivers/net/wireless/atmel_cs.c
  27. +4
    -16
      drivers/net/wireless/hostap/hostap_cs.c
  28. +8
    -11
      drivers/net/wireless/netwave_cs.c
  29. +8
    -14
      drivers/net/wireless/orinoco_cs.c
  30. +33
    -65
      drivers/net/wireless/ray_cs.c
  31. +9
    -12
      drivers/net/wireless/spectrum_cs.c
  32. +16
    -30
      drivers/net/wireless/wavelan_cs.c
  33. +1
    -0
      drivers/net/wireless/wl3501.h
  34. +9
    -52
      drivers/net/wireless/wl3501_cs.c
  35. +5
    -7
      drivers/parport/parport_cs.c
  36. +8
    -11
      drivers/pcmcia/ds.c
  37. +4
    -5
      drivers/pcmcia/pcmcia_ioctl.c
  38. +5
    -8
      drivers/pcmcia/pcmcia_resource.c
  39. +5
    -16
      drivers/scsi/pcmcia/aha152x_stub.c
  40. +5
    -7
      drivers/scsi/pcmcia/fdomain_stub.c
  41. +5
    -8
      drivers/scsi/pcmcia/nsp_cs.c
  42. +1
    -1
      drivers/scsi/pcmcia/nsp_cs.h
  43. +4
    -7
      drivers/scsi/pcmcia/qlogic_stub.c
  44. +4
    -7
      drivers/scsi/pcmcia/sym53c500_cs.c
  45. +7
    -9
      drivers/serial/serial_cs.c
  46. +10
    -21
      drivers/telephony/ixj_pcmcia.c
  47. +4
    -7
      drivers/usb/host/sl811_cs.c
  48. +14
    -17
      include/pcmcia/ds.h
  49. +5
    -7
      sound/pcmcia/pdaudiocf/pdaudiocf.c
  50. +1
    -1
      sound/pcmcia/pdaudiocf/pdaudiocf.h
  51. +10
    -10
      sound/pcmcia/vx/vxpocket.c
  52. +1
    -1
      sound/pcmcia/vx/vxpocket.h

+ 14
- 17
drivers/bluetooth/bluecard_cs.c View File

@ -65,7 +65,7 @@ MODULE_LICENSE("GPL");
typedef struct bluecard_info_t {
dev_link_t link;
struct pcmcia_device *p_dev;
dev_node_t node;
struct hci_dev *hdev;
@ -162,7 +162,7 @@ static void bluecard_detach(struct pcmcia_device *p_dev);
static void bluecard_activity_led_timeout(u_long arg)
{
bluecard_info_t *info = (bluecard_info_t *)arg;
unsigned int iobase = info->link.io.BasePort1;
unsigned int iobase = info->p_dev->io.BasePort1;
if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
return;
@ -179,7 +179,7 @@ static void bluecard_activity_led_timeout(u_long arg)
static void bluecard_enable_activity_led(bluecard_info_t *info)
{
unsigned int iobase = info->link.io.BasePort1;
unsigned int iobase = info->p_dev->io.BasePort1;
if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
return;
@ -235,7 +235,7 @@ static void bluecard_write_wakeup(bluecard_info_t *info)
}
do {
register unsigned int iobase = info->link.io.BasePort1;
register unsigned int iobase = info->p_dev->io.BasePort1;
register unsigned int offset;
register unsigned char command;
register unsigned long ready_bit;
@ -244,7 +244,7 @@ static void bluecard_write_wakeup(bluecard_info_t *info)
clear_bit(XMIT_WAKEUP, &(info->tx_state));
if (!(info->link.state & DEV_PRESENT))
if (!(info->p_dev->state & DEV_PRESENT))
return;
if (test_bit(XMIT_BUFFER_NUMBER, &(info->tx_state))) {
@ -382,7 +382,7 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset)
return;
}
iobase = info->link.io.BasePort1;
iobase = info->p_dev->io.BasePort1;
if (test_bit(XMIT_SENDING_READY, &(info->tx_state)))
bluecard_enable_activity_led(info);
@ -512,7 +512,7 @@ static irqreturn_t bluecard_interrupt(int irq, void *dev_inst, struct pt_regs *r
if (!test_bit(CARD_READY, &(info->hw_state)))
return IRQ_HANDLED;
iobase = info->link.io.BasePort1;
iobase = info->p_dev->io.BasePort1;
spin_lock(&(info->lock));
@ -626,7 +626,7 @@ static int bluecard_hci_flush(struct hci_dev *hdev)
static int bluecard_hci_open(struct hci_dev *hdev)
{
bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data);
unsigned int iobase = info->link.io.BasePort1;
unsigned int iobase = info->p_dev->io.BasePort1;
if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
bluecard_hci_set_baud_rate(hdev, DEFAULT_BAUD_RATE);
@ -646,7 +646,7 @@ static int bluecard_hci_open(struct hci_dev *hdev)
static int bluecard_hci_close(struct hci_dev *hdev)
{
bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data);
unsigned int iobase = info->link.io.BasePort1;
unsigned int iobase = info->p_dev->io.BasePort1;
if (!test_and_clear_bit(HCI_RUNNING, &(hdev->flags)))
return 0;
@ -713,7 +713,7 @@ static int bluecard_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned l
static int bluecard_open(bluecard_info_t *info)
{
unsigned int iobase = info->link.io.BasePort1;
unsigned int iobase = info->p_dev->io.BasePort1;
struct hci_dev *hdev;
unsigned char id;
@ -831,7 +831,7 @@ static int bluecard_open(bluecard_info_t *info)
static int bluecard_close(bluecard_info_t *info)
{
unsigned int iobase = info->link.io.BasePort1;
unsigned int iobase = info->p_dev->io.BasePort1;
struct hci_dev *hdev = info->hdev;
if (!hdev)
@ -859,14 +859,14 @@ static int bluecard_close(bluecard_info_t *info)
static int bluecard_attach(struct pcmcia_device *p_dev)
{
bluecard_info_t *info;
dev_link_t *link;
dev_link_t *link = dev_to_instance(p_dev);
/* Create new info device */
info = kzalloc(sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
link = &info->link;
info->p_dev = p_dev;
link->priv = info;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
@ -880,9 +880,6 @@ static int bluecard_attach(struct pcmcia_device *p_dev)
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
link->handle = p_dev;
p_dev->instance = link;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
bluecard_config(link);
@ -976,7 +973,7 @@ static void bluecard_config(dev_link_t *link)
goto failed;
strcpy(info->node.dev_name, info->hdev->name);
link->dev = &info->node;
link->dev_node = &info->node;
link->state &= ~DEV_CONFIG_PENDING;
return;


+ 10
- 16
drivers/bluetooth/bt3c_cs.c View File

@ -72,7 +72,7 @@ MODULE_LICENSE("GPL");
typedef struct bt3c_info_t {
dev_link_t link;
struct pcmcia_device *p_dev;
dev_node_t node;
struct hci_dev *hdev;
@ -191,11 +191,11 @@ static void bt3c_write_wakeup(bt3c_info_t *info)
return;
do {
register unsigned int iobase = info->link.io.BasePort1;
register unsigned int iobase = info->p_dev->io.BasePort1;
register struct sk_buff *skb;
register int len;
if (!(info->link.state & DEV_PRESENT))
if (!(info->p_dev->state & DEV_PRESENT))
break;
@ -229,7 +229,7 @@ static void bt3c_receive(bt3c_info_t *info)
return;
}
iobase = info->link.io.BasePort1;
iobase = info->p_dev->io.BasePort1;
avail = bt3c_read(iobase, 0x7006);
//printk("bt3c_cs: receiving %d bytes\n", avail);
@ -350,7 +350,7 @@ static irqreturn_t bt3c_interrupt(int irq, void *dev_inst, struct pt_regs *regs)
return IRQ_NONE;
}
iobase = info->link.io.BasePort1;
iobase = info->p_dev->io.BasePort1;
spin_lock(&(info->lock));
@ -481,7 +481,7 @@ static int bt3c_load_firmware(bt3c_info_t *info, unsigned char *firmware, int co
unsigned int iobase, size, addr, fcs, tmp;
int i, err = 0;
iobase = info->link.io.BasePort1;
iobase = info->p_dev->io.BasePort1;
/* Reset */
bt3c_io_write(iobase, 0x8040, 0x0404);
@ -562,7 +562,6 @@ static int bt3c_open(bt3c_info_t *info)
{
const struct firmware *firmware;
struct hci_dev *hdev;
client_handle_t handle;
int err;
spin_lock_init(&(info->lock));
@ -594,10 +593,8 @@ static int bt3c_open(bt3c_info_t *info)
hdev->owner = THIS_MODULE;
handle = info->link.handle;
/* Load firmware */
err = request_firmware(&firmware, "BT3CPCC.bin", &handle_to_dev(handle));
err = request_firmware(&firmware, "BT3CPCC.bin", &info->p_dev->dev);
if (err < 0) {
BT_ERR("Firmware request failed");
goto error;
@ -651,14 +648,14 @@ static int bt3c_close(bt3c_info_t *info)
static int bt3c_attach(struct pcmcia_device *p_dev)
{
bt3c_info_t *info;
dev_link_t *link;
dev_link_t *link = dev_to_instance(p_dev);
/* Create new info device */
info = kzalloc(sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
link = &info->link;
info->p_dev = p_dev;
link->priv = info;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
@ -672,9 +669,6 @@ static int bt3c_attach(struct pcmcia_device *p_dev)
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
link->handle = p_dev;
p_dev->instance = link;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
bt3c_config(link);
@ -815,7 +809,7 @@ found_port:
goto failed;
strcpy(info->node.dev_name, info->hdev->name);
link->dev = &info->node;
link->dev_node = &info->node;
link->state &= ~DEV_CONFIG_PENDING;
return;


+ 11
- 14
drivers/bluetooth/btuart_cs.c View File

@ -68,7 +68,7 @@ MODULE_LICENSE("GPL");
typedef struct btuart_info_t {
dev_link_t link;
struct pcmcia_device *p_dev;
dev_node_t node;
struct hci_dev *hdev;
@ -146,13 +146,13 @@ static void btuart_write_wakeup(btuart_info_t *info)
}
do {
register unsigned int iobase = info->link.io.BasePort1;
register unsigned int iobase = info->p_dev->io.BasePort1;
register struct sk_buff *skb;
register int len;
clear_bit(XMIT_WAKEUP, &(info->tx_state));
if (!(info->link.state & DEV_PRESENT))
if (!(info->p_dev->state & DEV_PRESENT))
return;
if (!(skb = skb_dequeue(&(info->txq))))
@ -187,7 +187,7 @@ static void btuart_receive(btuart_info_t *info)
return;
}
iobase = info->link.io.BasePort1;
iobase = info->p_dev->io.BasePort1;
do {
info->hdev->stat.byte_rx++;
@ -301,7 +301,7 @@ static irqreturn_t btuart_interrupt(int irq, void *dev_inst, struct pt_regs *reg
return IRQ_NONE;
}
iobase = info->link.io.BasePort1;
iobase = info->p_dev->io.BasePort1;
spin_lock(&(info->lock));
@ -357,7 +357,7 @@ static void btuart_change_speed(btuart_info_t *info, unsigned int speed)
return;
}
iobase = info->link.io.BasePort1;
iobase = info->p_dev->io.BasePort1;
spin_lock_irqsave(&(info->lock), flags);
@ -481,7 +481,7 @@ static int btuart_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned lon
static int btuart_open(btuart_info_t *info)
{
unsigned long flags;
unsigned int iobase = info->link.io.BasePort1;
unsigned int iobase = info->p_dev->io.BasePort1;
struct hci_dev *hdev;
spin_lock_init(&(info->lock));
@ -550,7 +550,7 @@ static int btuart_open(btuart_info_t *info)
static int btuart_close(btuart_info_t *info)
{
unsigned long flags;
unsigned int iobase = info->link.io.BasePort1;
unsigned int iobase = info->p_dev->io.BasePort1;
struct hci_dev *hdev = info->hdev;
if (!hdev)
@ -579,14 +579,14 @@ static int btuart_close(btuart_info_t *info)
static int btuart_attach(struct pcmcia_device *p_dev)
{
btuart_info_t *info;
dev_link_t *link;
dev_link_t *link = dev_to_instance(p_dev);
/* Create new info device */
info = kzalloc(sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
link = &info->link;
info->p_dev = p_dev;
link->priv = info;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
@ -600,9 +600,6 @@ static int btuart_attach(struct pcmcia_device *p_dev)
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
link->handle = p_dev;
p_dev->instance = link;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
btuart_config(link);
@ -744,7 +741,7 @@ found_port:
goto failed;
strcpy(info->node.dev_name, info->hdev->name);
link->dev = &info->node;
link->dev_node = &info->node;
link->state &= ~DEV_CONFIG_PENDING;
return;


+ 11
- 14
drivers/bluetooth/dtl1_cs.c View File

@ -68,7 +68,7 @@ MODULE_LICENSE("GPL");
typedef struct dtl1_info_t {
dev_link_t link;
struct pcmcia_device *p_dev;
dev_node_t node;
struct hci_dev *hdev;
@ -153,13 +153,13 @@ static void dtl1_write_wakeup(dtl1_info_t *info)
}
do {
register unsigned int iobase = info->link.io.BasePort1;
register unsigned int iobase = info->p_dev->io.BasePort1;
register struct sk_buff *skb;
register int len;
clear_bit(XMIT_WAKEUP, &(info->tx_state));
if (!(info->link.state & DEV_PRESENT))
if (!(info->p_dev->state & DEV_PRESENT))
return;
if (!(skb = skb_dequeue(&(info->txq))))
@ -218,7 +218,7 @@ static void dtl1_receive(dtl1_info_t *info)
return;
}
iobase = info->link.io.BasePort1;
iobase = info->p_dev->io.BasePort1;
do {
info->hdev->stat.byte_rx++;
@ -305,7 +305,7 @@ static irqreturn_t dtl1_interrupt(int irq, void *dev_inst, struct pt_regs *regs)
return IRQ_NONE;
}
iobase = info->link.io.BasePort1;
iobase = info->p_dev->io.BasePort1;
spin_lock(&(info->lock));
@ -458,7 +458,7 @@ static int dtl1_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long
static int dtl1_open(dtl1_info_t *info)
{
unsigned long flags;
unsigned int iobase = info->link.io.BasePort1;
unsigned int iobase = info->p_dev->io.BasePort1;
struct hci_dev *hdev;
spin_lock_init(&(info->lock));
@ -504,7 +504,7 @@ static int dtl1_open(dtl1_info_t *info)
outb(UART_LCR_WLEN8, iobase + UART_LCR); /* Reset DLAB */
outb((UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2), iobase + UART_MCR);
info->ri_latch = inb(info->link.io.BasePort1 + UART_MSR) & UART_MSR_RI;
info->ri_latch = inb(info->p_dev->io.BasePort1 + UART_MSR) & UART_MSR_RI;
/* Turn on interrupts */
outb(UART_IER_RLSI | UART_IER_RDI | UART_IER_THRI, iobase + UART_IER);
@ -529,7 +529,7 @@ static int dtl1_open(dtl1_info_t *info)
static int dtl1_close(dtl1_info_t *info)
{
unsigned long flags;
unsigned int iobase = info->link.io.BasePort1;
unsigned int iobase = info->p_dev->io.BasePort1;
struct hci_dev *hdev = info->hdev;
if (!hdev)
@ -558,14 +558,14 @@ static int dtl1_close(dtl1_info_t *info)
static int dtl1_attach(struct pcmcia_device *p_dev)
{
dtl1_info_t *info;
dev_link_t *link;
dev_link_t *link = dev_to_instance(p_dev);
/* Create new info device */
info = kzalloc(sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
link = &info->link;
info->p_dev = p_dev;
link->priv = info;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
@ -579,9 +579,6 @@ static int dtl1_attach(struct pcmcia_device *p_dev)
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
link->handle = p_dev;
p_dev->instance = link;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
dtl1_config(link);
@ -696,7 +693,7 @@ static void dtl1_config(dev_link_t *link)
goto failed;
strcpy(info->node.dev_name, info->hdev->name);
link->dev = &info->node;
link->dev_node = &info->node;
link->state &= ~DEV_CONFIG_PENDING;
return;


+ 13
- 16
drivers/char/pcmcia/cm4000_cs.c View File

@ -46,7 +46,7 @@
/* #define ATR_CSUM */
#ifdef PCMCIA_DEBUG
#define reader_to_dev(x) (&handle_to_dev(x->link.handle))
#define reader_to_dev(x) (&handle_to_dev(x->p_dev->handle))
static int pc_debug = PCMCIA_DEBUG;
module_param(pc_debug, int, 0600);
#define DEBUGP(n, rdr, x, args...) do { \
@ -106,7 +106,7 @@ static int major; /* major number we get from the kernel */
#define REG_STOPBITS(x) (x + 7)
struct cm4000_dev {
dev_link_t link; /* pcmcia link */
struct pcmcia_device *p_dev;
dev_node_t node; /* OS node (major,minor) */
unsigned char atr[MAX_ATR];
@ -454,7 +454,7 @@ static struct card_fixup card_fixups[] = {
static void set_cardparameter(struct cm4000_dev *dev)
{
int i;
ioaddr_t iobase = dev->link.io.BasePort1;
ioaddr_t iobase = dev->p_dev->io.BasePort1;
u_int8_t stopbits = 0x02; /* ISO default */
DEBUGP(3, dev, "-> set_cardparameter\n");
@ -487,7 +487,7 @@ static int set_protocol(struct cm4000_dev *dev, struct ptsreq *ptsreq)
unsigned short num_bytes_read;
unsigned char pts_reply[4];
ssize_t rc;
ioaddr_t iobase = dev->link.io.BasePort1;
ioaddr_t iobase = dev->p_dev->io.BasePort1;
rc = 0;
@ -699,7 +699,7 @@ static void terminate_monitor(struct cm4000_dev *dev)
static void monitor_card(unsigned long p)
{
struct cm4000_dev *dev = (struct cm4000_dev *) p;
ioaddr_t iobase = dev->link.io.BasePort1;
ioaddr_t iobase = dev->p_dev->io.BasePort1;
unsigned short s;
struct ptsreq ptsreq;
int i, atrc;
@ -962,7 +962,7 @@ static ssize_t cmm_read(struct file *filp, __user char *buf, size_t count,
loff_t *ppos)
{
struct cm4000_dev *dev = filp->private_data;
ioaddr_t iobase = dev->link.io.BasePort1;
ioaddr_t iobase = dev->p_dev->io.BasePort1;
ssize_t rc;
int i, j, k;
@ -971,7 +971,7 @@ static ssize_t cmm_read(struct file *filp, __user char *buf, size_t count,
if (count == 0) /* according to manpage */
return 0;
if ((dev->link.state & DEV_PRESENT) == 0 || /* socket removed */
if ((dev->p_dev->state & DEV_PRESENT) == 0 || /* socket removed */
test_bit(IS_CMM_ABSENT, &dev->flags))
return -ENODEV;
@ -1083,7 +1083,7 @@ static ssize_t cmm_write(struct file *filp, const char __user *buf,
size_t count, loff_t *ppos)
{
struct cm4000_dev *dev = (struct cm4000_dev *) filp->private_data;
ioaddr_t iobase = dev->link.io.BasePort1;
ioaddr_t iobase = dev->p_dev->io.BasePort1;
unsigned short s;
unsigned char tmp;
unsigned char infolen;
@ -1108,7 +1108,7 @@ static ssize_t cmm_write(struct file *filp, const char __user *buf,
sendT0 = dev->proto ? 0 : nr > 5 ? 0x08 : 0;
if ((dev->link.state & DEV_PRESENT) == 0 || /* socket removed */
if ((dev->p_dev->state & DEV_PRESENT) == 0 || /* socket removed */
test_bit(IS_CMM_ABSENT, &dev->flags))
return -ENODEV;
@ -1440,7 +1440,7 @@ static int cmm_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long arg)
{
struct cm4000_dev *dev = filp->private_data;
ioaddr_t iobase = dev->link.io.BasePort1;
ioaddr_t iobase = dev->p_dev->io.BasePort1;
dev_link_t *link;
int size;
int rc;
@ -1844,7 +1844,7 @@ static void cm4000_config(dev_link_t * link, int devno)
dev->node.major = major;
dev->node.minor = devno;
dev->node.next = NULL;
link->dev = &dev->node;
link->dev_node = &dev->node;
link->state &= ~DEV_CONFIG_PENDING;
return;
@ -1889,8 +1889,8 @@ static void cm4000_release(dev_link_t *link)
static int cm4000_attach(struct pcmcia_device *p_dev)
{
struct cm4000_dev *dev;
dev_link_t *link;
int i;
dev_link_t *link = dev_to_instance(p_dev);
for (i = 0; i < CM4000_MAX_DEV; i++)
if (dev_table[i] == NULL)
@ -1906,7 +1906,7 @@ static int cm4000_attach(struct pcmcia_device *p_dev)
if (dev == NULL)
return -ENOMEM;
link = &dev->link;
dev->p_dev = p_dev;
link->priv = dev;
link->conf.IntType = INT_MEMORY_AND_IO;
dev_table[i] = link;
@ -1916,9 +1916,6 @@ static int cm4000_attach(struct pcmcia_device *p_dev)
init_waitqueue_head(&dev->atrq);
init_waitqueue_head(&dev->readq);
link->handle = p_dev;
p_dev->instance = link;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
cm4000_config(link, i);


+ 13
- 16
drivers/char/pcmcia/cm4040_cs.c View File

@ -41,7 +41,7 @@
#ifdef PCMCIA_DEBUG
#define reader_to_dev(x) (&handle_to_dev(x->link.handle))
#define reader_to_dev(x) (&handle_to_dev(x->p_dev->handle))
static int pc_debug = PCMCIA_DEBUG;
module_param(pc_debug, int, 0600);
#define DEBUGP(n, rdr, x, args...) do { \
@ -74,7 +74,7 @@ static struct class *cmx_class;
#define BS_WRITABLE 0x02
struct reader_dev {
dev_link_t link;
struct pcmcia_device *p_dev;
dev_node_t node;
wait_queue_head_t devq;
wait_queue_head_t poll_wait;
@ -116,7 +116,7 @@ static inline unsigned char xinb(unsigned short port)
static void cm4040_do_poll(unsigned long dummy)
{
struct reader_dev *dev = (struct reader_dev *) dummy;
unsigned int obs = xinb(dev->link.io.BasePort1
unsigned int obs = xinb(dev->p_dev->io.BasePort1
+ REG_OFFSET_BUFFER_STATUS);
if ((obs & BSR_BULK_IN_FULL)) {
@ -147,7 +147,7 @@ static void cm4040_stop_poll(struct reader_dev *dev)
static int wait_for_bulk_out_ready(struct reader_dev *dev)
{
int i, rc;
int iobase = dev->link.io.BasePort1;
int iobase = dev->p_dev->io.BasePort1;
for (i = 0; i < POLL_LOOP_COUNT; i++) {
if ((xinb(iobase + REG_OFFSET_BUFFER_STATUS)
@ -177,7 +177,7 @@ static int wait_for_bulk_out_ready(struct reader_dev *dev)
/* Write to Sync Control Register */
static int write_sync_reg(unsigned char val, struct reader_dev *dev)
{
int iobase = dev->link.io.BasePort1;
int iobase = dev->p_dev->io.BasePort1;
int rc;
rc = wait_for_bulk_out_ready(dev);
@ -195,7 +195,7 @@ static int write_sync_reg(unsigned char val, struct reader_dev *dev)
static int wait_for_bulk_in_ready(struct reader_dev *dev)
{
int i, rc;
int iobase = dev->link.io.BasePort1;
int iobase = dev->p_dev->io.BasePort1;
for (i = 0; i < POLL_LOOP_COUNT; i++) {
if ((xinb(iobase + REG_OFFSET_BUFFER_STATUS)
@ -225,7 +225,7 @@ static ssize_t cm4040_read(struct file *filp, char __user *buf,
size_t count, loff_t *ppos)
{
struct reader_dev *dev = filp->private_data;
int iobase = dev->link.io.BasePort1;
int iobase = dev->p_dev->io.BasePort1;
size_t bytes_to_read;
unsigned long i;
size_t min_bytes_to_read;
@ -246,7 +246,7 @@ static ssize_t cm4040_read(struct file *filp, char __user *buf,
return -EAGAIN;
}
if ((dev->link.state & DEV_PRESENT)==0)
if ((dev->p_dev->state & DEV_PRESENT)==0)
return -ENODEV;
for (i = 0; i < 5; i++) {
@ -328,7 +328,7 @@ static ssize_t cm4040_write(struct file *filp, const char __user *buf,
size_t count, loff_t *ppos)
{
struct reader_dev *dev = filp->private_data;
int iobase = dev->link.io.BasePort1;
int iobase = dev->p_dev->io.BasePort1;
ssize_t rc;
int i;
unsigned int bytes_to_write;
@ -351,7 +351,7 @@ static ssize_t cm4040_write(struct file *filp, const char __user *buf,
return -EAGAIN;
}
if ((dev->link.state & DEV_PRESENT) == 0)
if ((dev->p_dev->state & DEV_PRESENT) == 0)
return -ENODEV;
bytes_to_write = count;
@ -606,7 +606,7 @@ static void reader_config(dev_link_t *link, int devno)
dev->node.major = major;
dev->node.minor = devno;
dev->node.next = NULL;
link->dev = &dev->node;
link->dev_node = &dev->node;
link->state &= ~DEV_CONFIG_PENDING;
DEBUGP(2, dev, "device " DEVICE_NAME "%d at 0x%.4x-0x%.4x\n", devno,
@ -631,8 +631,8 @@ static void reader_release(dev_link_t *link)
static int reader_attach(struct pcmcia_device *p_dev)
{
struct reader_dev *dev;
dev_link_t *link;
int i;
dev_link_t *link = dev_to_instance(p_dev);
for (i = 0; i < CM_MAX_DEV; i++) {
if (dev_table[i] == NULL)
@ -649,8 +649,8 @@ static int reader_attach(struct pcmcia_device *p_dev)
dev->timeout = CCID_DRIVER_MINIMUM_TIMEOUT;
dev->buffer_status = 0;
link = &dev->link;
link->priv = dev;
dev->p_dev = p_dev;
link->conf.IntType = INT_MEMORY_AND_IO;
dev_table[i] = link;
@ -662,9 +662,6 @@ static int reader_attach(struct pcmcia_device *p_dev)
init_timer(&dev->poll_timer);
dev->poll_timer.function = &cm4040_do_poll;
link->handle = p_dev;
p_dev->instance = link;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
reader_config(link, i);


+ 9
- 12
drivers/char/pcmcia/synclink_cs.c View File

@ -228,7 +228,7 @@ typedef struct _mgslpc_info {
struct _input_signal_events input_signal_events;
/* PCMCIA support */
dev_link_t link;
struct pcmcia_device *p_dev;
dev_node_t node;
int stop;
@ -536,11 +536,11 @@ static void ldisc_receive_buf(struct tty_struct *tty,
static int mgslpc_attach(struct pcmcia_device *p_dev)
{
MGSLPC_INFO *info;
dev_link_t *link;
dev_link_t *link = dev_to_instance(p_dev);
if (debug_level >= DEBUG_LEVEL_INFO)
printk("mgslpc_attach\n");
info = (MGSLPC_INFO *)kmalloc(sizeof(MGSLPC_INFO), GFP_KERNEL);
if (!info) {
printk("Error can't allocate device instance data\n");
@ -565,22 +565,19 @@ static int mgslpc_attach(struct pcmcia_device *p_dev)
info->imrb_value = 0xffff;
info->pim_value = 0xff;
link = &info->link;
info->p_dev = p_dev;
link->priv = info;
/* Initialize the dev_link_t structure */
/* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
link->irq.IRQInfo1 = IRQ_LEVEL_ID;
link->irq.Handler = NULL;
link->conf.Attributes = 0;
link->conf.IntType = INT_MEMORY_AND_IO;
link->handle = p_dev;
p_dev->instance = link;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
mgslpc_config(link);
@ -673,7 +670,7 @@ static void mgslpc_config(dev_link_t *link)
/* add to linked list of devices */
sprintf(info->node.dev_name, "mgslpc0");
info->node.major = info->node.minor = 0;
link->dev = &info->node;
link->dev_node = &info->node;
printk(KERN_INFO "%s: index 0x%02x:",
info->node.dev_name, link->conf.ConfigIndex);
@ -1259,7 +1256,7 @@ static irqreturn_t mgslpc_isr(int irq, void *dev_id, struct pt_regs * regs)
if (!info)
return IRQ_NONE;
if (!(info->link.state & DEV_CONFIG))
if (!(info->p_dev->state & DEV_CONFIG))
return IRQ_HANDLED;
spin_lock(&info->lock);


+ 6
- 7
drivers/ide/legacy/ide-cs.c View File

@ -81,7 +81,7 @@ static const char ide_major[] = {
};
typedef struct ide_info_t {
dev_link_t link;
struct pcmcia_device *p_dev;
int ndev;
dev_node_t node;
int hd;
@ -106,7 +106,7 @@ static void ide_detach(struct pcmcia_device *p_dev);
static int ide_attach(struct pcmcia_device *p_dev)
{
ide_info_t *info;
dev_link_t *link;
dev_link_t *link = dev_to_instance(p_dev);
DEBUG(0, "ide_attach()\n");
@ -114,7 +114,9 @@ static int ide_attach(struct pcmcia_device *p_dev)
info = kzalloc(sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
link = &info->link; link->priv = info;
info->p_dev = p_dev;
link->priv = info;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
@ -124,9 +126,6 @@ static int ide_attach(struct pcmcia_device *p_dev)
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
link->handle = p_dev;
p_dev->instance = link;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
ide_config(link);
@ -326,7 +325,7 @@ static void ide_config(dev_link_t *link)
info->node.major = ide_major[hd];
info->node.minor = 0;
info->hd = hd;
link->dev = &info->node;
link->dev_node = &info->node;
printk(KERN_INFO "ide-cs: %s: Vpp = %d.%d\n",
info->node.dev_name, link->conf.Vpp / 10, link->conf.Vpp % 10);


+ 16
- 29
drivers/isdn/hardware/avm/avm_cs.c View File

@ -101,49 +101,37 @@ typedef struct local_info_t {
static int avmcs_attach(struct pcmcia_device *p_dev)
{
dev_link_t *link;
local_info_t *local;
/* Initialize the dev_link_t structure */
link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL);
if (!link)
goto err;
memset(link, 0, sizeof(struct dev_link_t));
/* The io structure describes IO port mapping */
link->io.NumPorts1 = 16;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts2 = 0;
p_dev->io.NumPorts1 = 16;
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
p_dev->io.NumPorts2 = 0;
/* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
p_dev->irq.IRQInfo1 = IRQ_LEVEL_ID;
link->irq.IRQInfo1 = IRQ_LEVEL_ID;
/* General socket configuration */
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.ConfigIndex = 1;
link->conf.Present = PRESENT_OPTION;
p_dev->conf.Attributes = CONF_ENABLE_IRQ;
p_dev->conf.IntType = INT_MEMORY_AND_IO;
p_dev->conf.ConfigIndex = 1;
p_dev->conf.Present = PRESENT_OPTION;
/* Allocate space for private device-specific data */
local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
if (!local)
goto err_kfree;
goto err;
memset(local, 0, sizeof(local_info_t));
link->priv = local;
link->handle = p_dev;
p_dev->instance = link;
p_dev->priv = local;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
avmcs_config(link);
p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
avmcs_config(p_dev);
return 0;
err_kfree:
kfree(link);
err:
return -EINVAL;
} /* avmcs_attach */
@ -165,7 +153,6 @@ static void avmcs_detach(struct pcmcia_device *p_dev)
avmcs_release(link);
kfree(link->priv);
kfree(link);
} /* avmcs_detach */
/*======================================================================
@ -330,7 +317,7 @@ found_port:
dev->node.major = 64;
dev->node.minor = 0;
link->dev = &dev->node;
link->dev_node = &dev->node;
link->state &= ~DEV_CONFIG_PENDING;
/* If any step failed, release any partially configured state */


+ 18
- 30
drivers/isdn/hisax/avma1_cs.c View File

@ -118,50 +118,39 @@ typedef struct local_info_t {
static int avma1cs_attach(struct pcmcia_device *p_dev)
{
dev_link_t *link;
local_info_t *local;
DEBUG(0, "avma1cs_attach()\n");
/* Initialize the dev_link_t structure */
link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL);
if (!link)
return -ENOMEM;
memset(link, 0, sizeof(struct dev_link_t));
/* Allocate space for private device-specific data */
local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
if (!local) {
kfree(link);
if (!local)
return -ENOMEM;
}
memset(local, 0, sizeof(local_info_t));
link->priv = local;
p_dev->priv = local;
/* The io structure describes IO port mapping */
link->io.NumPorts1 = 16;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts2 = 16;
link->io.Attributes2 = IO_DATA_PATH_WIDTH_16;
link->io.IOAddrLines = 5;
p_dev->io.NumPorts1 = 16;
p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
p_dev->io.NumPorts2 = 16;
p_dev->io.Attributes2 = IO_DATA_PATH_WIDTH_16;
p_dev->io.IOAddrLines = 5;
/* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
link->irq.IRQInfo1 = IRQ_LEVEL_ID;
p_dev->irq.IRQInfo1 = IRQ_LEVEL_ID;
/* General socket configuration */
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.ConfigIndex = 1;
link->conf.Present = PRESENT_OPTION;
link->handle = p_dev;
p_dev->instance = link;
p_dev->conf.Attributes = CONF_ENABLE_IRQ;
p_dev->conf.IntType = INT_MEMORY_AND_IO;
p_dev->conf.ConfigIndex = 1;
p_dev->conf.Present = PRESENT_OPTION;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
avma1cs_config(link);
p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
avma1cs_config(p_dev);
return 0;
} /* avma1cs_attach */
@ -185,7 +174,6 @@ static void avma1cs_detach(struct pcmcia_device *p_dev)
avma1cs_release(link);
kfree(link->priv);
kfree(link);
} /* avma1cs_detach */
/*======================================================================
@ -335,7 +323,7 @@ found_port:
strcpy(dev->node.dev_name, "A1");
dev->node.major = 45;
dev->node.minor = 0;
link->dev = &dev->node;
link->dev_node = &dev->node;
link->state &= ~DEV_CONFIG_PENDING;
/* If any step failed, release any partially configured state */


+ 7
- 7
drivers/isdn/hisax/elsa_cs.c View File

@ -121,7 +121,7 @@ static void elsa_cs_detach(struct pcmcia_device *p_dev);
*/
typedef struct local_info_t {
dev_link_t link;
struct pcmcia_device *p_dev;
dev_node_t node;
int busy;
int cardnr;
@ -141,8 +141,8 @@ typedef struct local_info_t {
static int elsa_cs_attach(struct pcmcia_device *p_dev)
{
dev_link_t *link;
local_info_t *local;
dev_link_t *link = dev_to_instance(p_dev);
DEBUG(0, "elsa_cs_attach()\n");
@ -150,8 +150,11 @@ static int elsa_cs_attach(struct pcmcia_device *p_dev)
local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
if (!local) return -ENOMEM;
memset(local, 0, sizeof(local_info_t));
local->p_dev = p_dev;
link->priv = local;
local->cardnr = -1;
link = &local->link; link->priv = local;
/* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
@ -172,9 +175,6 @@ static int elsa_cs_attach(struct pcmcia_device *p_dev)
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
link->handle = p_dev;
p_dev->instance = link;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
elsa_cs_config(link);
@ -320,7 +320,7 @@ static void elsa_cs_config(dev_link_t *link)
sprintf(dev->node.dev_name, "elsa");
dev->node.major = dev->node.minor = 0x0;
link->dev = &dev->node;
link->dev_node = &dev->node;
/* Finally, report what we've done */
printk(KERN_INFO "%s: index 0x%02x: ",


+ 7
- 9
drivers/isdn/hisax/sedlbauer_cs.c View File

@ -130,7 +130,7 @@ static void sedlbauer_detach(struct pcmcia_device *p_dev);
*/
typedef struct local_info_t {
dev_link_t link;
struct pcmcia_device *p_dev;
dev_node_t node;
int stop;
int cardnr;
@ -151,7 +151,7 @@ typedef struct local_info_t {
static int sedlbauer_attach(struct pcmcia_device *p_dev)
{
local_info_t *local;
dev_link_t *link;
dev_link_t *link = dev_to_instance(p_dev);
DEBUG(0, "sedlbauer_attach()\n");
@ -160,8 +160,10 @@ static int sedlbauer_attach(struct pcmcia_device *p_dev)
if (!local) return -ENOMEM;
memset(local, 0, sizeof(local_info_t));
local->cardnr = -1;
link = &local->link; link->priv = local;
local->p_dev = p_dev;
link->priv = local;
/* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
link->irq.IRQInfo1 = IRQ_LEVEL_ID;
@ -182,13 +184,9 @@ static int sedlbauer_attach(struct pcmcia_device *p_dev)
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.IOAddrLines = 3;
link->conf.Attributes = 0;
link->conf.IntType = INT_MEMORY_AND_IO;
link->handle = p_dev;
p_dev->instance = link;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
sedlbauer_config(link);
@ -397,7 +395,7 @@ static void sedlbauer_config(dev_link_t *link)
*/
sprintf(dev->node.dev_name, "sedlbauer");
dev->node.major = dev->node.minor = 0;
link->dev = &dev->node;
link->dev_node = &dev->node;
/* Finally, report what we've done */
printk(KERN_INFO "%s: index 0x%02x:",


+ 6
- 7
drivers/isdn/hisax/teles_cs.c View File

@ -112,7 +112,7 @@ static void teles_detach(struct pcmcia_device *p_dev);
*/
typedef struct local_info_t {
dev_link_t link;
struct pcmcia_device *p_dev;
dev_node_t node;
int busy;
int cardnr;
@ -132,8 +132,8 @@ typedef struct local_info_t {
static int teles_attach(struct pcmcia_device *p_dev)
{
dev_link_t *link;
local_info_t *local;
dev_link_t *link = dev_to_instance(p_dev);
DEBUG(0, "teles_attach()\n");
@ -142,7 +142,9 @@ static int teles_attach(struct pcmcia_device *p_dev)
if (!local) return -ENOMEM;
memset(local, 0, sizeof(local_info_t));
local->cardnr = -1;
link = &local->link; link->priv = local;
local->p_dev = p_dev;
link->priv = local;
/* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
@ -163,9 +165,6 @@ static int teles_attach(struct pcmcia_device *p_dev)
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
link->handle = p_dev;
p_dev->instance = link;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
teles_cs_config(link);
@ -311,7 +310,7 @@ static void teles_cs_config(dev_link_t *link)
sprintf(dev->node.dev_name, "teles");
dev->node.major = dev->node.minor = 0x0;
link->dev = &dev->node;
link->dev_node = &dev->node;
/* Finally, report what we've done */
printk(KERN_INFO "%s: index 0x%02x:",


+ 9
- 13
drivers/mtd/maps/pcmciamtd.c View File

@ -54,7 +54,7 @@ static const int debug = 0;
#define MAX_PCMCIA_ADDR 0x4000000
struct pcmciamtd_dev {
dev_link_t link; /* PCMCIA link */
struct pcmcia_device *p_dev;
dev_node_t node; /* device node */
caddr_t win_base; /* ioremapped address of PCMCIA window */
unsigned int win_size; /* size of window */
@ -111,8 +111,8 @@ static caddr_t remap_window(struct map_info *map, unsigned long to)
memreq_t mrq;
int ret;
if(!(dev->link.state & DEV_PRESENT)) {
DEBUG(1, "device removed state = 0x%4.4X", dev->link.state);
if(!(dev->p_dev->state & DEV_PRESENT)) {
DEBUG(1, "device removed state = 0x%4.4X", dev->p_dev->state);
return 0;
}
@ -122,7 +122,7 @@ static caddr_t remap_window(struct map_info *map, unsigned long to)
dev->offset, mrq.CardOffset);
mrq.Page = 0;
if( (ret = pcmcia_map_mem_page(win, &mrq)) != CS_SUCCESS) {
cs_error(dev->link.handle, MapMemPage, ret);
cs_error(dev->p_dev->handle, MapMemPage, ret);
return NULL;
}
dev->offset = mrq.CardOffset;
@ -319,7 +319,7 @@ static void pcmcia_copy_to(struct map_info *map, unsigned long to, const void *f
static void pcmciamtd_set_vpp(struct map_info *map, int on)
{
struct pcmciamtd_dev *dev = (struct pcmciamtd_dev *)map->map_priv_1;
dev_link_t *link = &dev->link;
dev_link_t *link = dev->p_dev;
modconf_t mod;
int ret;
@ -650,7 +650,7 @@ static void pcmciamtd_config(dev_link_t *link)
use the faster non-remapping read/write functions */
if(mtd->size <= dev->win_size) {
DEBUG(1, "Using non remapping memory functions");
dev->pcmcia_map.map_priv_1 = (unsigned long)&(dev->link.state);
dev->pcmcia_map.map_priv_1 = (unsigned long)&(dev->p_dev->state);
dev->pcmcia_map.map_priv_2 = (unsigned long)dev->win_base;
if (dev->pcmcia_map.bankwidth == 1) {
dev->pcmcia_map.read = pcmcia_read8;
@ -673,7 +673,7 @@ static void pcmciamtd_config(dev_link_t *link)
snprintf(dev->node.dev_name, sizeof(dev->node.dev_name), "mtd%d", mtd->index);
info("mtd%d: %s", mtd->index, mtd->name);
link->state &= ~DEV_CONFIG_PENDING;
link->dev = &dev->node;
link->dev_node = &dev->node;
return;
cs_failed:
@ -735,7 +735,7 @@ static void pcmciamtd_detach(struct pcmcia_device *p_dev)
static int pcmciamtd_attach(struct pcmcia_device *p_dev)
{
struct pcmciamtd_dev *dev;
dev_link_t *link;
dev_link_t *link = dev_to_instance(p_dev);
/* Create new memory card device */
dev = kmalloc(sizeof(*dev), GFP_KERNEL);
@ -743,16 +743,12 @@ static int pcmciamtd_attach(struct pcmcia_device *p_dev)
DEBUG(1, "dev=0x%p", dev);
memset(dev, 0, sizeof(*dev));
link = &dev->link;
dev->p_dev = p_dev;
link->priv = dev;
link->conf.Attributes = 0;
link->conf.IntType = INT_MEMORY;
link->next = NULL;
link->handle = p_dev;
p_dev->instance = link;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
pcmciamtd_config(link);


+ 8
- 11
drivers/net/pcmcia/3c574_cs.c View File

@ -204,7 +204,7 @@ enum Window4 { /* Window 4: Xcvr/media bits. */
#define MEDIA_TP 0x00C0 /* Enable link beat and jabber for 10baseT. */
struct el3_private {
dev_link_t link;
struct pcmcia_device *p_dev;
dev_node_t node;