[U-Boot-Users] [PATCH 12/17] ti_pci1410a: Fix multiple warnings and errors

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Sun May 18 19:09:54 CEST 2008


ti_pci1410a.c: In function 'voltage_set':
ti_pci1410a.c:421: error: label at end of compound statement
ti_pci1410a.c:435: error: label at end of compound statement
cc1: warnings being treated as errors
ti_pci1410a.c: At top level:
ti_pci1410a.c:609: warning: pointer targets in initialization differ in signedness
ti_pci1410a.c: In function 'identify':
ti_pci1410a.c:651: warning: pointer targets in passing argument 1 of 'puts' differ in signedness
ti_pci1410a.c:656: warning: pointer targets in passing argument 1 of 'strcmp' differ in signedness
ti_pci1410a.c:656: warning: pointer targets in passing argument 2 of 'strcmp' differ in signedness

remove do_pinit allready implement in cmd_pcmcia.c
Fix pcmcia_{on,off} protoptype and add it in definition to pcmcia.h

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 drivers/pcmcia/ti_pci1410a.c |   61 +++++++++--------------------------------
 include/pcmcia.h             |    2 +
 2 files changed, 16 insertions(+), 47 deletions(-)

diff --git a/drivers/pcmcia/ti_pci1410a.c b/drivers/pcmcia/ti_pci1410a.c
index c876d0c..d37e5a8 100644
--- a/drivers/pcmcia/ti_pci1410a.c
+++ b/drivers/pcmcia/ti_pci1410a.c
@@ -62,13 +62,10 @@
 #include <pci.h>
 #include <asm/io.h>
 
-#include <pcmcia.h>
-
 #if defined(CONFIG_CMD_PCMCIA)
 
-int pcmcia_on(int ide_base_bus);
+#include <pcmcia.h>
 
-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);
@@ -77,42 +74,13 @@ static void print_fixed(volatile uchar *p);
 static int  identify(volatile uchar *p);
 static int  check_ide_device(int slot, int ide_base_bus);
 
-
 /* ------------------------------------------------------------------------- */
 
-
 const char *indent = "\t   ";
 
 /* ------------------------------------------------------------------------- */
 
 
-int do_pinit(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
-#ifndef CFG_FIRST_PCMCIA_BUS
-# define CFG_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(CFG_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 */
@@ -123,15 +91,18 @@ static pci_dev_t devbusfn;
 static u32 socket_base;
 static u32 pcmcia_cis_ptr;
 
-int pcmcia_on(int ide_base_bus)
+int pcmcia_on(void)
 {
+#ifndef CFG_FIRST_PCMCIA_BUS
+# define CFG_FIRST_PCMCIA_BUS 0
+#endif
 	u16 dev_id;
 	u32 socket_status;
 	int slot = 0;
 	int cis_len;
 	u16 io_base;
 	u16 io_len;
-
+	int ide_base_bus = CFG_FIRST_PCMCIA_BUS;
 	/*
 	 * Find the CardBus PCI device(s).
 	 */
@@ -244,8 +215,7 @@ int pcmcia_on(int ide_base_bus)
 
 /* ------------------------------------------------------------------------- */
 
-
-static int pcmcia_off (void)
+int pcmcia_off (void)
 {
 	int slot = 0;
 
@@ -285,10 +255,8 @@ static int pcmcia_off (void)
 	return 0;
 }
 
-
 /* ------------------------------------------------------------------------- */
 
-
 #define	MAX_TUPEL_SZ	512
 #define MAX_FEATURES	4
 int ide_devices_found;
@@ -392,7 +360,6 @@ static int check_ide_device(int slot, int ide_base_bus)
 	return 0;
 }
 
-
 static int voltage_set(int slot, int vcc, int vpp)
 {
 	u32 socket_control;
@@ -418,6 +385,7 @@ static int voltage_set(int slot, int vcc, int vpp)
 		break;
 	case 0:
 	default:
+		break;
 	}
 
 	switch (vpp) {
@@ -432,6 +400,7 @@ static int voltage_set(int slot, int vcc, int vpp)
 		break;
 	case 0:
 	default:
+		break;
 	}
 
 	writel(socket_control, reg);
@@ -443,7 +412,6 @@ static int voltage_set(int slot, int vcc, int vpp)
 	return 0;
 }
 
-
 static int hardware_enable(int slot)
 {
 	u32 socket_status;
@@ -490,7 +458,6 @@ static int hardware_enable(int slot)
 	return ((readb(socket_base+0x801)&0x6c)==0x6c)?0:1;
 }
 
-
 static int hardware_disable(int slot)
 {
 	voltage_set(slot, 0, 0);
@@ -605,17 +572,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)
 {
-	uchar id_str[MAX_IDENT_CHARS];
+	char id_str[MAX_IDENT_CHARS];
 	uchar data;
-	uchar *t;
-	uchar **card;
+	char *t;
+	char **card;
 	int i, done;
 
 	if (p == NULL)
@@ -648,7 +615,7 @@ static int identify(volatile uchar *p)
 			break;
 		}
 	}
-	puts(id_str);
+	puts((char*)id_str);
 	putc('\n');
 
 	for (card=known_cards; *card; ++card) {
diff --git a/include/pcmcia.h b/include/pcmcia.h
index 7305805..cc4c78c 100644
--- a/include/pcmcia.h
+++ b/include/pcmcia.h
@@ -318,4 +318,6 @@ extern u_int *pcmcia_pgcrx[];
 extern int check_ide_device(int slot);
 #endif
 
+int pcmcia_off(void);
+int pcmcia_on(void);
 #endif /* _PCMCIA_H */
-- 
1.5.5.1





More information about the U-Boot mailing list