diff options
author | Alexander Clouter <alex@digriz.org.uk> | 2012-05-12 10:17:00 -0400 |
---|---|---|
committer | Andrew Lunn <andrew@lunn.ch> | 2012-05-14 12:13:05 -0400 |
commit | 4d72cef17bb71a63526b6219bc06b7f31d86dde1 (patch) | |
tree | 33ac637ee42970427fbf22dd5396d22d3e629d72 /arch/arm/mach-orion5x | |
parent | 4f8cf6106dcf77b9b60af23cbb35fd537b1c9c1d (diff) |
ARM: orion5x: ts78xx debugging changes
Move to using a refined pr_fmt to avoid having to manually
prefix every message line with 'ts78xx'.
Changelog:
v2: moved pr_fmt define ahead of includes as suggested by
Hartley Sweeten to avoid use of leading undef
v1: initial release
Signed-off-by: Alexander Clouter <alex@digriz.org.uk>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Diffstat (limited to 'arch/arm/mach-orion5x')
-rw-r--r-- | arch/arm/mach-orion5x/ts78xx-setup.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c index 1e1436363b8..a74f3cf54cc 100644 --- a/arch/arm/mach-orion5x/ts78xx-setup.c +++ b/arch/arm/mach-orion5x/ts78xx-setup.c | |||
@@ -8,6 +8,8 @@ | |||
8 | * warranty of any kind, whether express or implied. | 8 | * warranty of any kind, whether express or implied. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
12 | |||
11 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
12 | #include <linux/init.h> | 14 | #include <linux/init.h> |
13 | #include <linux/sysfs.h> | 15 | #include <linux/sysfs.h> |
@@ -141,10 +143,14 @@ static int ts78xx_ts_rtc_load(void) | |||
141 | } else | 143 | } else |
142 | rc = platform_device_add(&ts78xx_ts_rtc_device); | 144 | rc = platform_device_add(&ts78xx_ts_rtc_device); |
143 | 145 | ||
146 | if (rc) | ||
147 | pr_info("RTC could not be registered: %d\n", | ||
148 | rc); | ||
144 | return rc; | 149 | return rc; |
145 | } | 150 | } |
146 | } | 151 | } |
147 | 152 | ||
153 | pr_info("RTC not found\n"); | ||
148 | return -ENODEV; | 154 | return -ENODEV; |
149 | }; | 155 | }; |
150 | 156 | ||
@@ -316,6 +322,8 @@ static int ts78xx_ts_nand_load(void) | |||
316 | } else | 322 | } else |
317 | rc = platform_device_add(&ts78xx_ts_nand_device); | 323 | rc = platform_device_add(&ts78xx_ts_nand_device); |
318 | 324 | ||
325 | if (rc) | ||
326 | pr_info("NAND could not be registered: %d\n", rc); | ||
319 | return rc; | 327 | return rc; |
320 | }; | 328 | }; |
321 | 329 | ||
@@ -357,6 +365,8 @@ static int ts78xx_ts_rng_load(void) | |||
357 | } else | 365 | } else |
358 | rc = platform_device_add(&ts78xx_ts_rng_device); | 366 | rc = platform_device_add(&ts78xx_ts_rng_device); |
359 | 367 | ||
368 | if (rc) | ||
369 | pr_info("RNG could not be registered: %d\n", rc); | ||
360 | return rc; | 370 | return rc; |
361 | }; | 371 | }; |
362 | 372 | ||
@@ -396,7 +406,7 @@ static void ts78xx_fpga_supports(void) | |||
396 | /* enable devices if magic matches */ | 406 | /* enable devices if magic matches */ |
397 | switch ((ts78xx_fpga.id >> 8) & 0xffffff) { | 407 | switch ((ts78xx_fpga.id >> 8) & 0xffffff) { |
398 | case TS7800_FPGA_MAGIC: | 408 | case TS7800_FPGA_MAGIC: |
399 | pr_warning("TS-7800 FPGA: unrecognized revision 0x%.2x\n", | 409 | pr_warning("unrecognised FPGA revision 0x%.2x\n", |
400 | ts78xx_fpga.id & 0xff); | 410 | ts78xx_fpga.id & 0xff); |
401 | ts78xx_fpga.supports.ts_rtc.present = 1; | 411 | ts78xx_fpga.supports.ts_rtc.present = 1; |
402 | ts78xx_fpga.supports.ts_nand.present = 1; | 412 | ts78xx_fpga.supports.ts_nand.present = 1; |
@@ -416,26 +426,20 @@ static int ts78xx_fpga_load_devices(void) | |||
416 | 426 | ||
417 | if (ts78xx_fpga.supports.ts_rtc.present == 1) { | 427 | if (ts78xx_fpga.supports.ts_rtc.present == 1) { |
418 | tmp = ts78xx_ts_rtc_load(); | 428 | tmp = ts78xx_ts_rtc_load(); |
419 | if (tmp) { | 429 | if (tmp) |
420 | pr_info("TS-78xx: RTC not registered\n"); | ||
421 | ts78xx_fpga.supports.ts_rtc.present = 0; | 430 | ts78xx_fpga.supports.ts_rtc.present = 0; |
422 | } | ||
423 | ret |= tmp; | 431 | ret |= tmp; |
424 | } | 432 | } |
425 | if (ts78xx_fpga.supports.ts_nand.present == 1) { | 433 | if (ts78xx_fpga.supports.ts_nand.present == 1) { |
426 | tmp = ts78xx_ts_nand_load(); | 434 | tmp = ts78xx_ts_nand_load(); |
427 | if (tmp) { | 435 | if (tmp) |
428 | pr_info("TS-78xx: NAND not registered\n"); | ||
429 | ts78xx_fpga.supports.ts_nand.present = 0; | 436 | ts78xx_fpga.supports.ts_nand.present = 0; |
430 | } | ||
431 | ret |= tmp; | 437 | ret |= tmp; |
432 | } | 438 | } |
433 | if (ts78xx_fpga.supports.ts_rng.present == 1) { | 439 | if (ts78xx_fpga.supports.ts_rng.present == 1) { |
434 | tmp = ts78xx_ts_rng_load(); | 440 | tmp = ts78xx_ts_rng_load(); |
435 | if (tmp) { | 441 | if (tmp) |
436 | pr_info("TS-78xx: RNG not registered\n"); | ||
437 | ts78xx_fpga.supports.ts_rng.present = 0; | 442 | ts78xx_fpga.supports.ts_rng.present = 0; |
438 | } | ||
439 | ret |= tmp; | 443 | ret |= tmp; |
440 | } | 444 | } |
441 | 445 | ||
@@ -460,7 +464,7 @@ static int ts78xx_fpga_load(void) | |||
460 | { | 464 | { |
461 | ts78xx_fpga.id = readl(TS78XX_FPGA_REGS_VIRT_BASE); | 465 | ts78xx_fpga.id = readl(TS78XX_FPGA_REGS_VIRT_BASE); |
462 | 466 | ||
463 | pr_info("TS-78xx FPGA: magic=0x%.6x, rev=0x%.2x\n", | 467 | pr_info("FPGA magic=0x%.6x, rev=0x%.2x\n", |
464 | (ts78xx_fpga.id >> 8) & 0xffffff, | 468 | (ts78xx_fpga.id >> 8) & 0xffffff, |
465 | ts78xx_fpga.id & 0xff); | 469 | ts78xx_fpga.id & 0xff); |
466 | 470 | ||
@@ -488,7 +492,7 @@ static int ts78xx_fpga_unload(void) | |||
488 | * UrJTAG SVN since r1381 can be used to reprogram the FPGA | 492 | * UrJTAG SVN since r1381 can be used to reprogram the FPGA |
489 | */ | 493 | */ |
490 | if (ts78xx_fpga.id != fpga_id) { | 494 | if (ts78xx_fpga.id != fpga_id) { |
491 | pr_err("TS-78xx FPGA: magic/rev mismatch\n" | 495 | pr_err("FPGA magic/rev mismatch\n" |
492 | "TS-78xx FPGA: was 0x%.6x/%.2x but now 0x%.6x/%.2x\n", | 496 | "TS-78xx FPGA: was 0x%.6x/%.2x but now 0x%.6x/%.2x\n", |
493 | (ts78xx_fpga.id >> 8) & 0xffffff, ts78xx_fpga.id & 0xff, | 497 | (ts78xx_fpga.id >> 8) & 0xffffff, ts78xx_fpga.id & 0xff, |
494 | (fpga_id >> 8) & 0xffffff, fpga_id & 0xff); | 498 | (fpga_id >> 8) & 0xffffff, fpga_id & 0xff); |
@@ -519,7 +523,7 @@ static ssize_t ts78xx_fpga_store(struct kobject *kobj, | |||
519 | int value, ret; | 523 | int value, ret; |
520 | 524 | ||
521 | if (ts78xx_fpga.state < 0) { | 525 | if (ts78xx_fpga.state < 0) { |
522 | pr_err("TS-78xx FPGA: borked, you must powercycle asap\n"); | 526 | pr_err("FPGA borked, you must powercycle ASAP\n"); |
523 | return -EBUSY; | 527 | return -EBUSY; |
524 | } | 528 | } |
525 | 529 | ||
@@ -527,10 +531,8 @@ static ssize_t ts78xx_fpga_store(struct kobject *kobj, | |||
527 | value = 1; | 531 | value = 1; |
528 | else if (strncmp(buf, "offline", sizeof("offline") - 1) == 0) | 532 | else if (strncmp(buf, "offline", sizeof("offline") - 1) == 0) |
529 | value = 0; | 533 | value = 0; |
530 | else { | 534 | else |
531 | pr_err("ts78xx_fpga_store: Invalid value\n"); | ||
532 | return -EINVAL; | 535 | return -EINVAL; |
533 | } | ||
534 | 536 | ||
535 | if (ts78xx_fpga.state == value) | 537 | if (ts78xx_fpga.state == value) |
536 | return n; | 538 | return n; |