[PATCH 04/15] pcmcia: remove Pin, Copy configuration register access

Dominik Brodowski linux at dominikbrodowski.net
Fri Sep 3 06:57:03 EDT 2010


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.

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
 drivers/pcmcia/cs_internal.h     |    2 +-
 drivers/pcmcia/pcmcia_resource.c |   14 ++++++++------
 include/pcmcia/cs.h              |    2 +-
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h
index da055dc..9487340 100644
--- a/drivers/pcmcia/cs_internal.h
+++ b/drivers/pcmcia/cs_internal.h
@@ -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 */
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index fb28178..e431567 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -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_warn(&p_dev->dev, "invalid write to 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_warn(&p_dev->dev, "invalid write to 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);
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
index ccb8e6e..e656abe 100644
--- a/include/pcmcia/cs.h
+++ b/include/pcmcia/cs.h
@@ -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;
-- 
1.7.0.4




More information about the linux-pcmcia mailing list