Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a017a91 authored by Dominik Brodowski's avatar Dominik Brodowski
Browse files

pcmcia: do not use io_req_t after call to pcmcia_request_io()



After pcmcia_request_io(), do not make use of the values stored in
io_req_t, but instead use those found in struct pcmcia_device->resource[].

CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-ide@vger.kernel.org
CC: linux-usb@vger.kernel.org
CC: laforge@gnumonks.org
CC: linux-mtd@lists.infradead.org
CC: alsa-devel@alsa-project.org
CC: linux-serial@vger.kernel.org
Acked-by: Marcel Holtmann <marcel@holtmann.org> (for drivers/bluetooth/)
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent 2ce4905e
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -210,13 +210,13 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev,
			pdev->io.NumPorts2 = (stk->is_kme) ? 2 : 1;
			if (pcmcia_request_io(pdev, &pdev->io) != 0)
				return -ENODEV;
			stk->ctl_base = pdev->io.BasePort2;
			stk->ctl_base = pdev->resource[1]->start;
		} else if ((io->nwin == 1) && (io->win[0].len >= 16)) {
			pdev->io.NumPorts1 = io->win[0].len;
			pdev->io.NumPorts2 = 0;
			if (pcmcia_request_io(pdev, &pdev->io) != 0)
				return -ENODEV;
			stk->ctl_base = pdev->io.BasePort1 + 0x0e;
			stk->ctl_base = pdev->resource[0]->start + 0x0e;
		} else
			return -ENODEV;
		/* If we've got this far, we're done */
@@ -270,7 +270,7 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
		if (pcmcia_loop_config(pdev, pcmcia_check_one_config, stk))
			goto failed; /* No suitable config found */
	}
	io_base = pdev->io.BasePort1;
	io_base = pdev->resource[0]->start;
	ctl_base = stk->ctl_base;
	if (!pdev->irq)
		goto failed;
@@ -293,7 +293,7 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)

	/* FIXME: Could be more ports at base + 0x10 but we only deal with
	   one right now */
	if (pdev->io.NumPorts1 >= 0x20)
	if (resource_size(pdev->resource[0]) >= 0x20)
		n_ports = 2;

	if (pdev->manf_id == 0x0097 && pdev->card_id == 0x1620)
+9 −9
Original line number Diff line number Diff line
@@ -159,7 +159,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->p_dev->io.BasePort1;
	unsigned int iobase = info->p_dev->resource[0]->start;

	if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
		return;
@@ -176,7 +176,7 @@ static void bluecard_activity_led_timeout(u_long arg)

static void bluecard_enable_activity_led(bluecard_info_t *info)
{
	unsigned int iobase = info->p_dev->io.BasePort1;
	unsigned int iobase = info->p_dev->resource[0]->start;

	if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
		return;
@@ -232,7 +232,7 @@ static void bluecard_write_wakeup(bluecard_info_t *info)
	}

	do {
		register unsigned int iobase = info->p_dev->io.BasePort1;
		register unsigned int iobase = info->p_dev->resource[0]->start;
		register unsigned int offset;
		register unsigned char command;
		register unsigned long ready_bit;
@@ -379,7 +379,7 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset)
		return;
	}

	iobase = info->p_dev->io.BasePort1;
	iobase = info->p_dev->resource[0]->start;

	if (test_bit(XMIT_SENDING_READY, &(info->tx_state)))
		bluecard_enable_activity_led(info);
@@ -508,7 +508,7 @@ static irqreturn_t bluecard_interrupt(int irq, void *dev_inst)
	if (!test_bit(CARD_READY, &(info->hw_state)))
		return IRQ_HANDLED;

	iobase = info->p_dev->io.BasePort1;
	iobase = info->p_dev->resource[0]->start;

	spin_lock(&(info->lock));

@@ -622,7 +622,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->p_dev->io.BasePort1;
	unsigned int iobase = info->p_dev->resource[0]->start;

	if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
		bluecard_hci_set_baud_rate(hdev, DEFAULT_BAUD_RATE);
@@ -642,7 +642,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->p_dev->io.BasePort1;
	unsigned int iobase = info->p_dev->resource[0]->start;

	if (!test_and_clear_bit(HCI_RUNNING, &(hdev->flags)))
		return 0;
@@ -709,7 +709,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->p_dev->io.BasePort1;
	unsigned int iobase = info->p_dev->resource[0]->start;
	struct hci_dev *hdev;
	unsigned char id;

@@ -828,7 +828,7 @@ static int bluecard_open(bluecard_info_t *info)

static int bluecard_close(bluecard_info_t *info)
{
	unsigned int iobase = info->p_dev->io.BasePort1;
	unsigned int iobase = info->p_dev->resource[0]->start;
	struct hci_dev *hdev = info->hdev;

	if (!hdev)
+4 −4
Original line number Diff line number Diff line
@@ -188,7 +188,7 @@ static void bt3c_write_wakeup(bt3c_info_t *info)
		return;

	do {
		register unsigned int iobase = info->p_dev->io.BasePort1;
		register unsigned int iobase = info->p_dev->resource[0]->start;
		register struct sk_buff *skb;
		register int len;

@@ -226,7 +226,7 @@ static void bt3c_receive(bt3c_info_t *info)
		return;
	}

	iobase = info->p_dev->io.BasePort1;
	iobase = info->p_dev->resource[0]->start;

	avail = bt3c_read(iobase, 0x7006);
	//printk("bt3c_cs: receiving %d bytes\n", avail);
@@ -347,7 +347,7 @@ static irqreturn_t bt3c_interrupt(int irq, void *dev_inst)
		/* our irq handler is shared */
		return IRQ_NONE;

	iobase = info->p_dev->io.BasePort1;
	iobase = info->p_dev->resource[0]->start;

	spin_lock(&(info->lock));

@@ -480,7 +480,7 @@ static int bt3c_load_firmware(bt3c_info_t *info, const unsigned char *firmware,
	unsigned int iobase, size, addr, fcs, tmp;
	int i, err = 0;

	iobase = info->p_dev->io.BasePort1;
	iobase = info->p_dev->resource[0]->start;

	/* Reset */
	bt3c_io_write(iobase, 0x8040, 0x0404);
+6 −6
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ static void btuart_write_wakeup(btuart_info_t *info)
	}

	do {
		register unsigned int iobase = info->p_dev->io.BasePort1;
		register unsigned int iobase = info->p_dev->resource[0]->start;
		register struct sk_buff *skb;
		register int len;

@@ -183,7 +183,7 @@ static void btuart_receive(btuart_info_t *info)
		return;
	}

	iobase = info->p_dev->io.BasePort1;
	iobase = info->p_dev->resource[0]->start;

	do {
		info->hdev->stat.byte_rx++;
@@ -297,7 +297,7 @@ static irqreturn_t btuart_interrupt(int irq, void *dev_inst)
		/* our irq handler is shared */
		return IRQ_NONE;

	iobase = info->p_dev->io.BasePort1;
	iobase = info->p_dev->resource[0]->start;

	spin_lock(&(info->lock));

@@ -354,7 +354,7 @@ static void btuart_change_speed(btuart_info_t *info, unsigned int speed)
		return;
	}

	iobase = info->p_dev->io.BasePort1;
	iobase = info->p_dev->resource[0]->start;

	spin_lock_irqsave(&(info->lock), flags);

@@ -478,7 +478,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->p_dev->io.BasePort1;
	unsigned int iobase = info->p_dev->resource[0]->start;
	struct hci_dev *hdev;

	spin_lock_init(&(info->lock));
@@ -548,7 +548,7 @@ static int btuart_open(btuart_info_t *info)
static int btuart_close(btuart_info_t *info)
{
	unsigned long flags;
	unsigned int iobase = info->p_dev->io.BasePort1;
	unsigned int iobase = info->p_dev->resource[0]->start;
	struct hci_dev *hdev = info->hdev;

	if (!hdev)
+7 −6
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ static void dtl1_write_wakeup(dtl1_info_t *info)
	}

	do {
		register unsigned int iobase = info->p_dev->io.BasePort1;
		register unsigned int iobase = info->p_dev->resource[0]->start;
		register struct sk_buff *skb;
		register int len;

@@ -214,7 +214,7 @@ static void dtl1_receive(dtl1_info_t *info)
		return;
	}

	iobase = info->p_dev->io.BasePort1;
	iobase = info->p_dev->resource[0]->start;

	do {
		info->hdev->stat.byte_rx++;
@@ -301,7 +301,7 @@ static irqreturn_t dtl1_interrupt(int irq, void *dev_inst)
		/* our irq handler is shared */
		return IRQ_NONE;

	iobase = info->p_dev->io.BasePort1;
	iobase = info->p_dev->resource[0]->start;

	spin_lock(&(info->lock));

@@ -461,7 +461,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->p_dev->io.BasePort1;
	unsigned int iobase = info->p_dev->resource[0]->start;
	struct hci_dev *hdev;

	spin_lock_init(&(info->lock));
@@ -508,7 +508,8 @@ 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->p_dev->io.BasePort1 + UART_MSR) & UART_MSR_RI;
	info->ri_latch = inb(info->p_dev->resource[0]->start + UART_MSR)
				& UART_MSR_RI;

	/* Turn on interrupts */
	outb(UART_IER_RLSI | UART_IER_RDI | UART_IER_THRI, iobase + UART_IER);
@@ -533,7 +534,7 @@ static int dtl1_open(dtl1_info_t *info)
static int dtl1_close(dtl1_info_t *info)
{
	unsigned long flags;
	unsigned int iobase = info->p_dev->io.BasePort1;
	unsigned int iobase = info->p_dev->resource[0]->start;
	struct hci_dev *hdev = info->hdev;

	if (!hdev)
Loading