[U-Boot] [PATCH 08/17] Misc ti_pci1410a fixups

Graeme Russ graeme.russ at gmail.com
Sun Aug 23 04:59:52 CEST 2009


Removed do_pinit() - now declared in cmd_pcmcia.c

Added #define CONFIG_CMD_PCMCIA around pcmcia_off() in line with other
PCMCIA drivers

signed/unsigned type fixups

Added semi-colon after default: label as required by newer gcc

The only board that appears to use this driver is the sc520_spunk which
is very old and very likely very broken anyway. I do not have one to test
whether this patch breaks anything functionaly, I have can only check
that it compiles without warning or error

Signed-off-by: Graeme Russ <graeme.russ at gmail.com>
---
 drivers/pcmcia/ti_pci1410a.c |   62 ++++++++++++-----------------------------
 1 files changed, 18 insertions(+), 44 deletions(-)

diff --git a/drivers/pcmcia/ti_pci1410a.c b/drivers/pcmcia/ti_pci1410a.c
index 6ab9759..4ac2e0f 100644
--- a/drivers/pcmcia/ti_pci1410a.c
+++ b/drivers/pcmcia/ti_pci1410a.c
@@ -68,13 +68,12 @@
 
 int pcmcia_on(int ide_base_bus);
 
-static int  pcmcia_off(void);
 static int  hardware_disable(int slot);
 static int  hardware_enable(int slot);
 static int  voltage_set(int slot, int vcc, int vpp);
 static void print_funcid(int func);
-static void print_fixed(volatile uchar *p);
-static int  identify(volatile uchar *p);
+static void print_fixed(volatile char *p);
+static int  identify(volatile char *p);
 static int  check_ide_device(int slot, int ide_base_bus);
 
 
@@ -86,33 +85,6 @@ const char *indent = "\t   ";
 /* ------------------------------------------------------------------------- */
 
 
-int do_pinit(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
-#ifndef CONFIG_SYS_FIRST_PCMCIA_BUS
-# define CONFIG_SYS_FIRST_PCMCIA_BUS 0
-#endif
-
-	int rcode = 0;
-
-	if (argc != 2) {
-		printf ("Usage: pinit {on | off}\n");
-		return 1;
-	}
-	if (strcmp(argv[1],"on") == 0) {
-		rcode = pcmcia_on(CONFIG_SYS_FIRST_PCMCIA_BUS);
-	} else if (strcmp(argv[1],"off") == 0) {
-		rcode = pcmcia_off();
-	} else {
-		printf ("Usage: pinit {on | off}\n");
-		return 1;
-	}
-
-	return rcode;
-}
-
-/* ------------------------------------------------------------------------- */
-
-
 static struct pci_device_id supported[] = {
 	{ PCI_VENDOR_ID_TI, 0xac50 }, /* Ti PCI1410A */
 	{ PCI_VENDOR_ID_TI, 0xac56 }, /* Ti PCI1510 */
@@ -245,7 +217,8 @@ int pcmcia_on(int ide_base_bus)
 /* ------------------------------------------------------------------------- */
 
 
-static int pcmcia_off (void)
+#if defined(CONFIG_CMD_PCMCIA)
+int pcmcia_off (void)
 {
 	int slot = 0;
 
@@ -285,6 +258,7 @@ static int pcmcia_off (void)
 	return 0;
 }
 
+#endif
 
 /* ------------------------------------------------------------------------- */
 
@@ -294,9 +268,9 @@ static int pcmcia_off (void)
 int ide_devices_found;
 static int check_ide_device(int slot, int ide_base_bus)
 {
-	volatile uchar *ident = NULL;
-	volatile uchar *feature_p[MAX_FEATURES];
-	volatile uchar *p, *start;
+	volatile char *ident = NULL;
+	volatile char *feature_p[MAX_FEATURES];
+	volatile char *p, *start;
 	int n_features = 0;
 	uchar func_id = ~0;
 	uchar code, len;
@@ -314,7 +288,7 @@ static int check_ide_device(int slot, int ide_base_bus)
 		return 1;
 	}
 
-	start = p = (volatile uchar *) pcmcia_cis_ptr;
+	start = p = (volatile char *) pcmcia_cis_ptr;
 
 	while ((p - start) < MAX_TUPEL_SZ) {
 
@@ -417,7 +391,7 @@ static int voltage_set(int slot, int vcc, int vpp)
 		socket_control |= 0x30;
 		break;
 	case 0:
-	default:
+	default: ;
 	}
 
 	switch (vpp) {
@@ -431,7 +405,7 @@ static int voltage_set(int slot, int vcc, int vpp)
 		socket_control |= 0x3;
 		break;
 	case 0:
-	default:
+	default: ;
 	}
 
 	writel(socket_control, reg);
@@ -537,7 +511,7 @@ static void print_funcid(int func)
 
 /* ------------------------------------------------------------------------- */
 
-static void print_fixed(volatile uchar *p)
+static void print_fixed(volatile char *p)
 {
 	if (p == NULL)
 		return;
@@ -605,17 +579,17 @@ static void print_fixed(volatile uchar *p)
 #define MAX_IDENT_CHARS		64
 #define	MAX_IDENT_FIELDS	4
 
-static uchar *known_cards[] = {
+static char *known_cards[] = {
 	"ARGOSY PnPIDE D5",
 	NULL
 };
 
-static int identify(volatile uchar *p)
+static int identify(volatile char *p)
 {
-	uchar id_str[MAX_IDENT_CHARS];
-	uchar data;
-	uchar *t;
-	uchar **card;
+	char id_str[MAX_IDENT_CHARS];
+	char data;
+	char *t;
+	char **card;
 	int i, done;
 
 	if (p == NULL)
-- 
1.6.0.2.GIT



More information about the U-Boot mailing list