diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-07-24 09:58:54 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-08-03 03:03:59 -0400 |
commit | 9a017a910346afd88ec2e065989903bf211a7d37 (patch) | |
tree | b407945c6e762f252bb81ae0fd64c745bba2ad11 /drivers/char/pcmcia | |
parent | 2ce4905e4da9f512b38f56a53ece9da2072dd164 (diff) |
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: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/char/pcmcia')
-rw-r--r-- | drivers/char/pcmcia/cm4000_cs.c | 12 | ||||
-rw-r--r-- | drivers/char/pcmcia/cm4040_cs.c | 16 | ||||
-rw-r--r-- | drivers/char/pcmcia/ipwireless/main.c | 10 | ||||
-rw-r--r-- | drivers/char/pcmcia/synclink_cs.c | 7 |
4 files changed, 21 insertions, 24 deletions
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index a8be2a7906e0..18484edc1259 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c | |||
@@ -421,7 +421,7 @@ static struct card_fixup card_fixups[] = { | |||
421 | static void set_cardparameter(struct cm4000_dev *dev) | 421 | static void set_cardparameter(struct cm4000_dev *dev) |
422 | { | 422 | { |
423 | int i; | 423 | int i; |
424 | unsigned int iobase = dev->p_dev->io.BasePort1; | 424 | unsigned int iobase = dev->p_dev->resource[0]->start; |
425 | u_int8_t stopbits = 0x02; /* ISO default */ | 425 | u_int8_t stopbits = 0x02; /* ISO default */ |
426 | 426 | ||
427 | DEBUGP(3, dev, "-> set_cardparameter\n"); | 427 | DEBUGP(3, dev, "-> set_cardparameter\n"); |
@@ -454,7 +454,7 @@ static int set_protocol(struct cm4000_dev *dev, struct ptsreq *ptsreq) | |||
454 | unsigned short num_bytes_read; | 454 | unsigned short num_bytes_read; |
455 | unsigned char pts_reply[4]; | 455 | unsigned char pts_reply[4]; |
456 | ssize_t rc; | 456 | ssize_t rc; |
457 | unsigned int iobase = dev->p_dev->io.BasePort1; | 457 | unsigned int iobase = dev->p_dev->resource[0]->start; |
458 | 458 | ||
459 | rc = 0; | 459 | rc = 0; |
460 | 460 | ||
@@ -663,7 +663,7 @@ static void terminate_monitor(struct cm4000_dev *dev) | |||
663 | static void monitor_card(unsigned long p) | 663 | static void monitor_card(unsigned long p) |
664 | { | 664 | { |
665 | struct cm4000_dev *dev = (struct cm4000_dev *) p; | 665 | struct cm4000_dev *dev = (struct cm4000_dev *) p; |
666 | unsigned int iobase = dev->p_dev->io.BasePort1; | 666 | unsigned int iobase = dev->p_dev->resource[0]->start; |
667 | unsigned short s; | 667 | unsigned short s; |
668 | struct ptsreq ptsreq; | 668 | struct ptsreq ptsreq; |
669 | int i, atrc; | 669 | int i, atrc; |
@@ -924,7 +924,7 @@ static ssize_t cmm_read(struct file *filp, __user char *buf, size_t count, | |||
924 | loff_t *ppos) | 924 | loff_t *ppos) |
925 | { | 925 | { |
926 | struct cm4000_dev *dev = filp->private_data; | 926 | struct cm4000_dev *dev = filp->private_data; |
927 | unsigned int iobase = dev->p_dev->io.BasePort1; | 927 | unsigned int iobase = dev->p_dev->resource[0]->start; |
928 | ssize_t rc; | 928 | ssize_t rc; |
929 | int i, j, k; | 929 | int i, j, k; |
930 | 930 | ||
@@ -1047,7 +1047,7 @@ static ssize_t cmm_write(struct file *filp, const char __user *buf, | |||
1047 | size_t count, loff_t *ppos) | 1047 | size_t count, loff_t *ppos) |
1048 | { | 1048 | { |
1049 | struct cm4000_dev *dev = filp->private_data; | 1049 | struct cm4000_dev *dev = filp->private_data; |
1050 | unsigned int iobase = dev->p_dev->io.BasePort1; | 1050 | unsigned int iobase = dev->p_dev->resource[0]->start; |
1051 | unsigned short s; | 1051 | unsigned short s; |
1052 | unsigned char tmp; | 1052 | unsigned char tmp; |
1053 | unsigned char infolen; | 1053 | unsigned char infolen; |
@@ -1400,7 +1400,7 @@ static void stop_monitor(struct cm4000_dev *dev) | |||
1400 | static long cmm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 1400 | static long cmm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
1401 | { | 1401 | { |
1402 | struct cm4000_dev *dev = filp->private_data; | 1402 | struct cm4000_dev *dev = filp->private_data; |
1403 | unsigned int iobase = dev->p_dev->io.BasePort1; | 1403 | unsigned int iobase = dev->p_dev->resource[0]->start; |
1404 | struct inode *inode = filp->f_path.dentry->d_inode; | 1404 | struct inode *inode = filp->f_path.dentry->d_inode; |
1405 | struct pcmcia_device *link; | 1405 | struct pcmcia_device *link; |
1406 | int size; | 1406 | int size; |
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c index 44adae98c576..a6bbf199dde9 100644 --- a/drivers/char/pcmcia/cm4040_cs.c +++ b/drivers/char/pcmcia/cm4040_cs.c | |||
@@ -109,7 +109,7 @@ static inline unsigned char xinb(unsigned short port) | |||
109 | static void cm4040_do_poll(unsigned long dummy) | 109 | static void cm4040_do_poll(unsigned long dummy) |
110 | { | 110 | { |
111 | struct reader_dev *dev = (struct reader_dev *) dummy; | 111 | struct reader_dev *dev = (struct reader_dev *) dummy; |
112 | unsigned int obs = xinb(dev->p_dev->io.BasePort1 | 112 | unsigned int obs = xinb(dev->p_dev->resource[0]->start |
113 | + REG_OFFSET_BUFFER_STATUS); | 113 | + REG_OFFSET_BUFFER_STATUS); |
114 | 114 | ||
115 | if ((obs & BSR_BULK_IN_FULL)) { | 115 | if ((obs & BSR_BULK_IN_FULL)) { |
@@ -140,7 +140,7 @@ static void cm4040_stop_poll(struct reader_dev *dev) | |||
140 | static int wait_for_bulk_out_ready(struct reader_dev *dev) | 140 | static int wait_for_bulk_out_ready(struct reader_dev *dev) |
141 | { | 141 | { |
142 | int i, rc; | 142 | int i, rc; |
143 | int iobase = dev->p_dev->io.BasePort1; | 143 | int iobase = dev->p_dev->resource[0]->start; |
144 | 144 | ||
145 | for (i = 0; i < POLL_LOOP_COUNT; i++) { | 145 | for (i = 0; i < POLL_LOOP_COUNT; i++) { |
146 | if ((xinb(iobase + REG_OFFSET_BUFFER_STATUS) | 146 | if ((xinb(iobase + REG_OFFSET_BUFFER_STATUS) |
@@ -170,7 +170,7 @@ static int wait_for_bulk_out_ready(struct reader_dev *dev) | |||
170 | /* Write to Sync Control Register */ | 170 | /* Write to Sync Control Register */ |
171 | static int write_sync_reg(unsigned char val, struct reader_dev *dev) | 171 | static int write_sync_reg(unsigned char val, struct reader_dev *dev) |
172 | { | 172 | { |
173 | int iobase = dev->p_dev->io.BasePort1; | 173 | int iobase = dev->p_dev->resource[0]->start; |
174 | int rc; | 174 | int rc; |
175 | 175 | ||
176 | rc = wait_for_bulk_out_ready(dev); | 176 | rc = wait_for_bulk_out_ready(dev); |
@@ -188,7 +188,7 @@ static int write_sync_reg(unsigned char val, struct reader_dev *dev) | |||
188 | static int wait_for_bulk_in_ready(struct reader_dev *dev) | 188 | static int wait_for_bulk_in_ready(struct reader_dev *dev) |
189 | { | 189 | { |
190 | int i, rc; | 190 | int i, rc; |
191 | int iobase = dev->p_dev->io.BasePort1; | 191 | int iobase = dev->p_dev->resource[0]->start; |
192 | 192 | ||
193 | for (i = 0; i < POLL_LOOP_COUNT; i++) { | 193 | for (i = 0; i < POLL_LOOP_COUNT; i++) { |
194 | if ((xinb(iobase + REG_OFFSET_BUFFER_STATUS) | 194 | if ((xinb(iobase + REG_OFFSET_BUFFER_STATUS) |
@@ -218,7 +218,7 @@ static ssize_t cm4040_read(struct file *filp, char __user *buf, | |||
218 | size_t count, loff_t *ppos) | 218 | size_t count, loff_t *ppos) |
219 | { | 219 | { |
220 | struct reader_dev *dev = filp->private_data; | 220 | struct reader_dev *dev = filp->private_data; |
221 | int iobase = dev->p_dev->io.BasePort1; | 221 | int iobase = dev->p_dev->resource[0]->start; |
222 | size_t bytes_to_read; | 222 | size_t bytes_to_read; |
223 | unsigned long i; | 223 | unsigned long i; |
224 | size_t min_bytes_to_read; | 224 | size_t min_bytes_to_read; |
@@ -320,7 +320,7 @@ static ssize_t cm4040_write(struct file *filp, const char __user *buf, | |||
320 | size_t count, loff_t *ppos) | 320 | size_t count, loff_t *ppos) |
321 | { | 321 | { |
322 | struct reader_dev *dev = filp->private_data; | 322 | struct reader_dev *dev = filp->private_data; |
323 | int iobase = dev->p_dev->io.BasePort1; | 323 | int iobase = dev->p_dev->resource[0]->start; |
324 | ssize_t rc; | 324 | ssize_t rc; |
325 | int i; | 325 | int i; |
326 | unsigned int bytes_to_write; | 326 | unsigned int bytes_to_write; |
@@ -567,8 +567,8 @@ static int reader_config(struct pcmcia_device *link, int devno) | |||
567 | 567 | ||
568 | dev = link->priv; | 568 | dev = link->priv; |
569 | 569 | ||
570 | DEBUGP(2, dev, "device " DEVICE_NAME "%d at 0x%.4x-0x%.4x\n", devno, | 570 | DEBUGP(2, dev, "device " DEVICE_NAME "%d at %pR\n", devno, |
571 | link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1); | 571 | link->resource[0]); |
572 | DEBUGP(2, dev, "<- reader_config (succ)\n"); | 572 | DEBUGP(2, dev, "<- reader_config (succ)\n"); |
573 | 573 | ||
574 | return 0; | 574 | return 0; |
diff --git a/drivers/char/pcmcia/ipwireless/main.c b/drivers/char/pcmcia/ipwireless/main.c index 63c32e3f23ba..9467994d556f 100644 --- a/drivers/char/pcmcia/ipwireless/main.c +++ b/drivers/char/pcmcia/ipwireless/main.c | |||
@@ -100,7 +100,8 @@ static int ipwireless_probe(struct pcmcia_device *p_dev, | |||
100 | if (ret) | 100 | if (ret) |
101 | return ret; | 101 | return ret; |
102 | 102 | ||
103 | io_resource = request_region(p_dev->io.BasePort1, p_dev->io.NumPorts1, | 103 | io_resource = request_region(p_dev->resource[0]->start, |
104 | resource_size(p_dev->resource[0]), | ||
104 | IPWIRELESS_PCCARD_NAME); | 105 | IPWIRELESS_PCCARD_NAME); |
105 | 106 | ||
106 | if (cfg->mem.nwin == 0) | 107 | if (cfg->mem.nwin == 0) |
@@ -197,7 +198,7 @@ static int config_ipwireless(struct ipw_dev *ipw) | |||
197 | 198 | ||
198 | INIT_WORK(&ipw->work_reboot, signalled_reboot_work); | 199 | INIT_WORK(&ipw->work_reboot, signalled_reboot_work); |
199 | 200 | ||
200 | ipwireless_init_hardware_v1(ipw->hardware, link->io.BasePort1, | 201 | ipwireless_init_hardware_v1(ipw->hardware, link->resource[0]->start, |
201 | ipw->attr_memory, ipw->common_memory, | 202 | ipw->attr_memory, ipw->common_memory, |
202 | ipw->is_v2_card, signalled_reboot_callback, | 203 | ipw->is_v2_card, signalled_reboot_callback, |
203 | ipw); | 204 | ipw); |
@@ -209,10 +210,7 @@ static int config_ipwireless(struct ipw_dev *ipw) | |||
209 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME ": Card type %s\n", | 210 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME ": Card type %s\n", |
210 | ipw->is_v2_card ? "V2/V3" : "V1"); | 211 | ipw->is_v2_card ? "V2/V3" : "V1"); |
211 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME | 212 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME |
212 | ": I/O ports 0x%04x-0x%04x, irq %d\n", | 213 | ": I/O ports %pR, irq %d\n", link->resource[0], |
213 | (unsigned int) link->io.BasePort1, | ||
214 | (unsigned int) (link->io.BasePort1 + | ||
215 | link->io.NumPorts1 - 1), | ||
216 | (unsigned int) link->irq); | 214 | (unsigned int) link->irq); |
217 | if (ipw->attr_memory && ipw->common_memory) | 215 | if (ipw->attr_memory && ipw->common_memory) |
218 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME | 216 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME |
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 522992ed6e49..8ded9b02b9b9 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c | |||
@@ -609,16 +609,15 @@ static int mgslpc_config(struct pcmcia_device *link) | |||
609 | if (ret) | 609 | if (ret) |
610 | goto failed; | 610 | goto failed; |
611 | 611 | ||
612 | info->io_base = link->io.BasePort1; | 612 | info->io_base = link->resource[0]->start; |
613 | info->irq_level = link->irq; | 613 | info->irq_level = link->irq; |
614 | 614 | ||
615 | dev_info(&link->dev, "index 0x%02x:", | 615 | dev_info(&link->dev, "index 0x%02x:", |
616 | link->conf.ConfigIndex); | 616 | link->conf.ConfigIndex); |
617 | if (link->conf.Attributes & CONF_ENABLE_IRQ) | 617 | if (link->conf.Attributes & CONF_ENABLE_IRQ) |
618 | printk(", irq %d", link->irq); | 618 | printk(", irq %d", link->irq); |
619 | if (link->io.NumPorts1) | 619 | if (link->resource[0]) |
620 | printk(", io 0x%04x-0x%04x", link->io.BasePort1, | 620 | printk(", io %pR", link->resource[0]); |
621 | link->io.BasePort1+link->io.NumPorts1-1); | ||
622 | printk("\n"); | 621 | printk("\n"); |
623 | return 0; | 622 | return 0; |
624 | 623 | ||