pcmcia: remove Pin, Copy configuration register access
authorDominik Brodowski <linux@dominikbrodowski.net>
Thu, 29 Jul 2010 13:54:54 +0000 (15:54 +0200)
committerDominik Brodowski <linux@dominikbrodowski.net>
Wed, 29 Sep 2010 15:20:21 +0000 (17:20 +0200)
The "Pin" and "Copy" configuration registers (CISREG_SCR, CISREG_PPR)
do not seem to be utilized anywhere. If a device would request a
write to these registers, "0" would be written. Continue to do so, but
warn of unexpected behavior -- and remove the "Pin" and "Copy" entries
from config_req_t.

Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
drivers/pcmcia/cs_internal.h
drivers/pcmcia/pcmcia_resource.c
include/pcmcia/cs.h

index da055dc14d98a2933953e206d9544d33cc74cb17..9487340deaf00b03d4e474f2ad0a6772f78d72f2 100644 (file)
@@ -36,7 +36,7 @@ typedef struct config_t {
        unsigned int    Attributes;
        unsigned int    IntType;
        unsigned int    ConfigBase;
-       unsigned char   Status, Pin, Copy, Option, ExtStatus;
+       unsigned char   Status, Option, ExtStatus;
        unsigned int    CardValues;
 
        struct resource io[MAX_IO_WIN]; /* io ports */
index 817d00adfc89731c41e0b4a2180794ce831ab626..28717eea7c574e8830af10d219e166d0a5f4d0cf 100644 (file)
@@ -489,8 +489,14 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
        base = c->ConfigBase = req->ConfigBase;
        c->CardValues = req->Present;
        if (req->Present & PRESENT_COPY) {
-               c->Copy = req->Copy;
-               pcmcia_write_cis_mem(s, 1, (base + CISREG_SCR)>>1, 1, &c->Copy);
+               u16 tmp = 0;
+               dev_dbg(&p_dev->dev, "clearing CISREG_SCR\n");
+               pcmcia_write_cis_mem(s, 1, (base + CISREG_SCR)>>1, 1, &tmp);
+       }
+       if (req->Present & PRESENT_PIN_REPLACE) {
+               u16 tmp = 0;
+               dev_dbg(&p_dev->dev, "clearing CISREG_PRR\n");
+               pcmcia_write_cis_mem(s, 1, (base + CISREG_PRR)>>1, 1, &tmp);
        }
        if (req->Present & PRESENT_OPTION) {
                if (s->functions == 1) {
@@ -511,10 +517,6 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
                c->Status = req->Status;
                pcmcia_write_cis_mem(s, 1, (base + CISREG_CCSR)>>1, 1, &c->Status);
        }
-       if (req->Present & PRESENT_PIN_REPLACE) {
-               c->Pin = req->Pin;
-               pcmcia_write_cis_mem(s, 1, (base + CISREG_PRR)>>1, 1, &c->Pin);
-       }
        if (req->Present & PRESENT_EXT_STATUS) {
                c->ExtStatus = req->ExtStatus;
                pcmcia_write_cis_mem(s, 1, (base + CISREG_ESR)>>1, 1, &c->ExtStatus);
index ccb8e6e0dd6b6cd0621f5f5717d197caf22e0d38..e656abee1741e8c181f27e1fc977648b5134530d 100644 (file)
@@ -24,7 +24,7 @@ typedef struct config_req_t {
     u_int      Attributes;
     u_int      IntType;
     u_int      ConfigBase;
-    u_char     Status, Pin, Copy, ExtStatus;
+    u_char     Status, ExtStatus;
     u_char     ConfigIndex;
     u_int      Present;
 } config_req_t;