aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/pcmcia/cm4040_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-07-24 09:58:54 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2010-08-03 03:03:59 -0400
commit9a017a910346afd88ec2e065989903bf211a7d37 (patch)
treeb407945c6e762f252bb81ae0fd64c745bba2ad11 /drivers/char/pcmcia/cm4040_cs.c
parent2ce4905e4da9f512b38f56a53ece9da2072dd164 (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/cm4040_cs.c')
-rw-r--r--drivers/char/pcmcia/cm4040_cs.c16
1 files changed, 8 insertions, 8 deletions
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)
109static void cm4040_do_poll(unsigned long dummy) 109static 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)
140static int wait_for_bulk_out_ready(struct reader_dev *dev) 140static 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 */
171static int write_sync_reg(unsigned char val, struct reader_dev *dev) 171static 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)
188static int wait_for_bulk_in_ready(struct reader_dev *dev) 188static 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;