Patchwork [U-Boot,07/10] move CPC45 ide_led to the same file as other IDE hooks

login
register
mail settings
Submitter Pavel Herrmann
Date Oct. 7, 2012, 3:56 p.m.
Message ID <1349625374-12391-8-git-send-email-morpheus.ibis@gmail.com>
Download mbox | patch
Permalink /patch/189851/
State Changes Requested
Delegated to: Tom Rini
Headers show

Comments

Pavel Herrmann - Oct. 7, 2012, 3:56 p.m.
Keep all IDE-related hooks and overrides in a single file, to avoid confusion.

Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
---
 board/cpc45/cpc45.c | 15 ---------------
 board/cpc45/ide.c   | 15 +++++++++++++++
 2 files changed, 15 insertions(+), 15 deletions(-)
Marek Vasut - Oct. 7, 2012, 6:21 p.m.
Dear Pavel Herrmann,

> Keep all IDE-related hooks and overrides in a single file, to avoid
> confusion.
> 
> Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
> ---
[...]

> +
> +void ide_led(uchar led, uchar status)
> +{
> +	u_char	val;
> +	/* We have one PCMCIA slot and use LED H4 for the IDE Interface */
> +	val = readb(BCSR_BASE + 0x04);
> +	if (status) {				/* led on */
> +		val |= B_CTRL_LED0;
> +	} else {
> +		val &= ~B_CTRL_LED0;
> +	}

Remove these {} for conditions with single line expression

> +	writeb(val, BCSR_BASE + 0x04);
> +}
> +

Best regards,
Marek Vasut

Patch

diff --git a/board/cpc45/cpc45.c b/board/cpc45/cpc45.c
index 1178822..2200806 100644
--- a/board/cpc45/cpc45.c
+++ b/board/cpc45/cpc45.c
@@ -260,21 +260,6 @@  int pcmcia_init(void)
 
 #endif
 
-# ifdef CONFIG_IDE_LED
-void ide_led (uchar led, uchar status)
-{
-	u_char  val;
-	/* We have one PCMCIA slot and use LED H4 for the IDE Interface */
-	val = readb(BCSR_BASE + 0x04);
-	if (status) {				/* led on */
-		val |= B_CTRL_LED0;
-	} else {
-		val &= ~B_CTRL_LED0;
-	}
-	writeb(val, BCSR_BASE + 0x04);
-}
-# endif
-
 int board_eth_init(bd_t *bis)
 {
 	return pci_eth_init(bis);
diff --git a/board/cpc45/ide.c b/board/cpc45/ide.c
index 7b7237b..aafe127 100644
--- a/board/cpc45/ide.c
+++ b/board/cpc45/ide.c
@@ -27,6 +27,7 @@ 
 #include <common.h>
 #include <ide.h>
 #include <ata.h>
+#include <asm/io.h>
 
 #define EIEIO		__asm__ volatile ("eieio")
 #define SYNC		__asm__ volatile ("sync")
@@ -128,3 +129,17 @@  void ide_output_data_shorts(int dev, ushort *sect_buf, int shorts)
 		*pbuf_odd = *dbuf++;
 	}
 }
+
+void ide_led(uchar led, uchar status)
+{
+	u_char	val;
+	/* We have one PCMCIA slot and use LED H4 for the IDE Interface */
+	val = readb(BCSR_BASE + 0x04);
+	if (status) {				/* led on */
+		val |= B_CTRL_LED0;
+	} else {
+		val &= ~B_CTRL_LED0;
+	}
+	writeb(val, BCSR_BASE + 0x04);
+}
+