All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ARM: orion5x: ts78xx misc cleanups
@ 2012-04-14 18:00 Alexander Clouter
  2012-04-14 18:00 ` [PATCH 1/3] ARM: orion5x: ts78xx whitespace cleanups Alexander Clouter
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alexander Clouter @ 2012-04-14 18:00 UTC (permalink / raw)
  To: linux-arm-kernel

General cleanup of some of the ts78xx board codebase.

Alexander Clouter (3):
  ARM: orion5x: ts78xx whitespace cleanups
  ARM: orion5x: ts78xx fix NAND resource off by one
  ARM: orion5x: ts78xx debugging changes

 arch/arm/mach-orion5x/ts78xx-fpga.h  |    6 +++---
 arch/arm/mach-orion5x/ts78xx-setup.c |   38 ++++++++++++++++++----------------
 2 files changed, 23 insertions(+), 21 deletions(-)

-- 
1.7.10

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] ARM: orion5x: ts78xx whitespace cleanups
  2012-04-14 18:00 [PATCH 0/3] ARM: orion5x: ts78xx misc cleanups Alexander Clouter
@ 2012-04-14 18:00 ` Alexander Clouter
  2012-04-14 18:00 ` [PATCH 2/3] ARM: orion5x: ts78xx fix NAND resource off by one Alexander Clouter
  2012-04-14 18:00 ` [PATCH 3/3] ARM: orion5x: ts78xx debugging changes Alexander Clouter
  2 siblings, 0 replies; 6+ messages in thread
From: Alexander Clouter @ 2012-04-14 18:00 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Alexander Clouter <alex@digriz.org.uk>
---
 arch/arm/mach-orion5x/ts78xx-fpga.h  |    6 +++---
 arch/arm/mach-orion5x/ts78xx-setup.c |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-orion5x/ts78xx-fpga.h b/arch/arm/mach-orion5x/ts78xx-fpga.h
index 151e89e..97c393d 100644
--- a/arch/arm/mach-orion5x/ts78xx-fpga.h
+++ b/arch/arm/mach-orion5x/ts78xx-fpga.h
@@ -28,9 +28,9 @@ struct fpga_device {
 
 struct fpga_devices {
 	/* Technologic Systems */
-	struct fpga_device 	ts_rtc;
-	struct fpga_device 	ts_nand;
-	struct fpga_device 	ts_rng;
+	struct fpga_device	ts_rtc;
+	struct fpga_device	ts_nand;
+	struct fpga_device	ts_rng;
 };
 
 struct ts78xx_fpga_data {
diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c
index c96f374..c41f27b 100644
--- a/arch/arm/mach-orion5x/ts78xx-setup.c
+++ b/arch/arm/mach-orion5x/ts78xx-setup.c
@@ -115,7 +115,7 @@ static struct platform_device ts78xx_ts_rtc_device = {
  * I've used the method TS use in their rtc7800.c example for the detection
  *
  * TODO: track down a guinea pig without an RTC to see if we can work out a
- * 		better RTC detection routine
+ *		better RTC detection routine
  */
 static int ts78xx_ts_rtc_load(void)
 {
-- 
1.7.10

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] ARM: orion5x: ts78xx fix NAND resource off by one
  2012-04-14 18:00 [PATCH 0/3] ARM: orion5x: ts78xx misc cleanups Alexander Clouter
  2012-04-14 18:00 ` [PATCH 1/3] ARM: orion5x: ts78xx whitespace cleanups Alexander Clouter
@ 2012-04-14 18:00 ` Alexander Clouter
  2012-04-16 16:46   ` H Hartley Sweeten
  2012-04-14 18:00 ` [PATCH 3/3] ARM: orion5x: ts78xx debugging changes Alexander Clouter
  2 siblings, 1 reply; 6+ messages in thread
From: Alexander Clouter @ 2012-04-14 18:00 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Alexander Clouter <alex@digriz.org.uk>
---
 arch/arm/mach-orion5x/ts78xx-setup.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c
index c41f27b..4ae822b 100644
--- a/arch/arm/mach-orion5x/ts78xx-setup.c
+++ b/arch/arm/mach-orion5x/ts78xx-setup.c
@@ -294,7 +294,7 @@ static struct platform_nand_data ts78xx_ts_nand_data = {
 
 static struct resource ts78xx_ts_nand_resources = {
 	.start		= TS_NAND_DATA,
-	.end		= TS_NAND_DATA + 4,
+	.end		= TS_NAND_DATA + 4 - 1,
 	.flags		= IORESOURCE_MEM,
 };
 
-- 
1.7.10

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] ARM: orion5x: ts78xx debugging changes
  2012-04-14 18:00 [PATCH 0/3] ARM: orion5x: ts78xx misc cleanups Alexander Clouter
  2012-04-14 18:00 ` [PATCH 1/3] ARM: orion5x: ts78xx whitespace cleanups Alexander Clouter
  2012-04-14 18:00 ` [PATCH 2/3] ARM: orion5x: ts78xx fix NAND resource off by one Alexander Clouter
@ 2012-04-14 18:00 ` Alexander Clouter
  2012-04-16 16:40   ` H Hartley Sweeten
  2 siblings, 1 reply; 6+ messages in thread
From: Alexander Clouter @ 2012-04-14 18:00 UTC (permalink / raw)
  To: linux-arm-kernel

Moved to using a redefined pr_fmt to spare having to manually
prefix every message line with 'ts78xx'.

Signed-off-by: Alexander Clouter <alex@digriz.org.uk>
---
 arch/arm/mach-orion5x/ts78xx-setup.c |   34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c
index 4ae822b..f6d1232 100644
--- a/arch/arm/mach-orion5x/ts78xx-setup.c
+++ b/arch/arm/mach-orion5x/ts78xx-setup.c
@@ -26,6 +26,9 @@
 #include "mpp.h"
 #include "ts78xx-fpga.h"
 
+#undef pr_fmt
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 /*****************************************************************************
  * TS-78xx Info
  ****************************************************************************/
@@ -141,10 +144,13 @@ static int ts78xx_ts_rtc_load(void)
 			} else
 				rc = platform_device_add(&ts78xx_ts_rtc_device);
 
+			if (rc)
+				pr_info("RTC could not be registered: %d\n", rc);
 			return rc;
 		}
 	}
 
+	pr_info("RTC not found\n");
 	return -ENODEV;
 };
 
@@ -319,6 +325,8 @@ static int ts78xx_ts_nand_load(void)
 	} else
 		rc = platform_device_add(&ts78xx_ts_nand_device);
 
+	if (rc)
+		pr_info("NAND could not be registered: %d\n", rc);
 	return rc;
 };
 
@@ -363,6 +371,8 @@ static int ts78xx_ts_rng_load(void)
 	} else
 		rc = platform_device_add(&ts78xx_ts_rng_device);
 
+	if (rc)
+		pr_info("RNG could not be registered: %d\n", rc);
 	return rc;
 };
 
@@ -402,7 +412,7 @@ static void ts78xx_fpga_supports(void)
 		/* enable devices if magic matches */
 		switch ((ts78xx_fpga.id >> 8) & 0xffffff) {
 		case TS7800_FPGA_MAGIC:
-			pr_warning("TS-7800 FPGA: unrecognized revision 0x%.2x\n",
+			pr_warning("unrecognised FPGA revision 0x%.2x\n",
 					ts78xx_fpga.id & 0xff);
 			ts78xx_fpga.supports.ts_rtc.present = 1;
 			ts78xx_fpga.supports.ts_nand.present = 1;
@@ -422,26 +432,20 @@ static int ts78xx_fpga_load_devices(void)
 
 	if (ts78xx_fpga.supports.ts_rtc.present == 1) {
 		tmp = ts78xx_ts_rtc_load();
-		if (tmp) {
-			pr_info("TS-78xx: RTC not registered\n");
+		if (tmp)
 			ts78xx_fpga.supports.ts_rtc.present = 0;
-		}
 		ret |= tmp;
 	}
 	if (ts78xx_fpga.supports.ts_nand.present == 1) {
 		tmp = ts78xx_ts_nand_load();
-		if (tmp) {
-			pr_info("TS-78xx: NAND not registered\n");
+		if (tmp)
 			ts78xx_fpga.supports.ts_nand.present = 0;
-		}
 		ret |= tmp;
 	}
 	if (ts78xx_fpga.supports.ts_rng.present == 1) {
 		tmp = ts78xx_ts_rng_load();
-		if (tmp) {
-			pr_info("TS-78xx: RNG not registered\n");
+		if (tmp)
 			ts78xx_fpga.supports.ts_rng.present = 0;
-		}
 		ret |= tmp;
 	}
 
@@ -466,7 +470,7 @@ static int ts78xx_fpga_load(void)
 {
 	ts78xx_fpga.id = readl(TS78XX_FPGA_REGS_VIRT_BASE);
 
-	pr_info("TS-78xx FPGA: magic=0x%.6x, rev=0x%.2x\n",
+	pr_info("FPGA magic=0x%.6x, rev=0x%.2x\n",
 			(ts78xx_fpga.id >> 8) & 0xffffff,
 			ts78xx_fpga.id & 0xff);
 
@@ -494,7 +498,7 @@ static int ts78xx_fpga_unload(void)
 	 * UrJTAG SVN since r1381 can be used to reprogram the FPGA
 	 */
 	if (ts78xx_fpga.id != fpga_id) {
-		pr_err("TS-78xx FPGA: magic/rev mismatch\n"
+		pr_err("FPGA magic/rev mismatch\n"
 			"TS-78xx FPGA: was 0x%.6x/%.2x but now 0x%.6x/%.2x\n",
 			(ts78xx_fpga.id >> 8) & 0xffffff, ts78xx_fpga.id & 0xff,
 			(fpga_id >> 8) & 0xffffff, fpga_id & 0xff);
@@ -525,7 +529,7 @@ static ssize_t ts78xx_fpga_store(struct kobject *kobj,
 	int value, ret;
 
 	if (ts78xx_fpga.state < 0) {
-		pr_err("TS-78xx FPGA: borked, you must powercycle asap\n");
+		pr_err("FPGA borked, you must powercycle ASAP\n");
 		return -EBUSY;
 	}
 
@@ -533,10 +537,8 @@ static ssize_t ts78xx_fpga_store(struct kobject *kobj,
 		value = 1;
 	else if (strncmp(buf, "offline", sizeof("offline") - 1) == 0)
 		value = 0;
-	else {
-		pr_err("ts78xx_fpga_store: Invalid value\n");
+	else
 		return -EINVAL;
-	}
 
 	if (ts78xx_fpga.state == value)
 		return n;
-- 
1.7.10

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] ARM: orion5x: ts78xx debugging changes
  2012-04-14 18:00 ` [PATCH 3/3] ARM: orion5x: ts78xx debugging changes Alexander Clouter
@ 2012-04-16 16:40   ` H Hartley Sweeten
  0 siblings, 0 replies; 6+ messages in thread
From: H Hartley Sweeten @ 2012-04-16 16:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Saturday, April 14, 2012 11:01 AM, Alexander Clouter wrote:
> Moved to using a redefined pr_fmt to spare having to manually
> prefix every message line with 'ts78xx'.
>
> Signed-off-by: Alexander Clouter <alex@digriz.org.uk>
> ---
>  arch/arm/mach-orion5x/ts78xx-setup.c |   34 ++++++++++++++++++----------------
>  1 file changed, 18 insertions(+), 16 deletions(-)
>
> diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c
> index 4ae822b..f6d1232 100644
> --- a/arch/arm/mach-orion5x/ts78xx-setup.c
> +++ b/arch/arm/mach-orion5x/ts78xx-setup.c
> @@ -26,6 +26,9 @@
>  #include "mpp.h"
>  #include "ts78xx-fpga.h"
>  
> +#undef pr_fmt
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

Put the #define pr_fmt line in front of  the #includes and you will not need
the #undef.

Regards,
Hartley

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/3] ARM: orion5x: ts78xx fix NAND resource off by one
  2012-04-14 18:00 ` [PATCH 2/3] ARM: orion5x: ts78xx fix NAND resource off by one Alexander Clouter
@ 2012-04-16 16:46   ` H Hartley Sweeten
  0 siblings, 0 replies; 6+ messages in thread
From: H Hartley Sweeten @ 2012-04-16 16:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Saturday, April 14, 2012 11:01 AM, Alexander Clouter wrote:
>
> Signed-off-by: Alexander Clouter <alex@digriz.org.uk>
> ---
>  arch/arm/mach-orion5x/ts78xx-setup.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c
> index c41f27b..4ae822b 100644
> --- a/arch/arm/mach-orion5x/ts78xx-setup.c
> +++ b/arch/arm/mach-orion5x/ts78xx-setup.c
> @@ -294,7 +294,7 @@ static struct platform_nand_data ts78xx_ts_nand_data = {
>  
>  static struct resource ts78xx_ts_nand_resources = {
>  	.start		= TS_NAND_DATA,
> -	.end		= TS_NAND_DATA + 4,
> +	.end		= TS_NAND_DATA + 4 - 1,
>  	.flags		= IORESOURCE_MEM,
>  };

Just use the DEFINE_RES_MEM macro:

static struct resource ts78xx_ts_nand_resources =
	DEFINE_RES_MEM(TS_NAND_DATA, 4);

Regards,
Hartley

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-04-16 16:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-14 18:00 [PATCH 0/3] ARM: orion5x: ts78xx misc cleanups Alexander Clouter
2012-04-14 18:00 ` [PATCH 1/3] ARM: orion5x: ts78xx whitespace cleanups Alexander Clouter
2012-04-14 18:00 ` [PATCH 2/3] ARM: orion5x: ts78xx fix NAND resource off by one Alexander Clouter
2012-04-16 16:46   ` H Hartley Sweeten
2012-04-14 18:00 ` [PATCH 3/3] ARM: orion5x: ts78xx debugging changes Alexander Clouter
2012-04-16 16:40   ` H Hartley Sweeten

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.