aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2006-09-24 23:30:51 -0400
committerStephen Rothwell <sfr@canb.auug.org.au>2006-09-24 23:30:51 -0400
commitde0138da0f8cf406c096daec7494a5cbebce2e5c (patch)
tree337c9cf8b3ada88ac6bf9aecfa36c8ad759ea4bd /drivers
parentef26a46f8c501f6888cc78bcc4a2dc1efea1e733 (diff)
[POWERPC] The two vio HVC backends clash
Make sure only one of them actually registers as a driver. Also, remove cast from get_property(). Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/hvc_iseries.c8
-rw-r--r--drivers/char/hvc_vio.c4
2 files changed, 10 insertions, 2 deletions
diff --git a/drivers/char/hvc_iseries.c b/drivers/char/hvc_iseries.c
index 4747729459c7..ea362011bd5b 100644
--- a/drivers/char/hvc_iseries.c
+++ b/drivers/char/hvc_iseries.c
@@ -29,6 +29,7 @@
29#include <asm/hvconsole.h> 29#include <asm/hvconsole.h>
30#include <asm/vio.h> 30#include <asm/vio.h>
31#include <asm/prom.h> 31#include <asm/prom.h>
32#include <asm/firmware.h>
32#include <asm/iseries/vio.h> 33#include <asm/iseries/vio.h>
33#include <asm/iseries/hv_call.h> 34#include <asm/iseries/hv_call.h>
34#include <asm/iseries/hv_lp_config.h> 35#include <asm/iseries/hv_lp_config.h>
@@ -493,6 +494,9 @@ static int hvc_vio_init(void)
493 atomic_t wait_flag; 494 atomic_t wait_flag;
494 int rc; 495 int rc;
495 496
497 if (!firmware_has_feature(FW_FEATURE_ISERIES))
498 return -EIO;
499
496 /* +2 for fudge */ 500 /* +2 for fudge */
497 rc = viopath_open(HvLpConfig_getPrimaryLpIndex(), 501 rc = viopath_open(HvLpConfig_getPrimaryLpIndex(),
498 viomajorsubtype_chario, VIOCHAR_WINDOW + 2); 502 viomajorsubtype_chario, VIOCHAR_WINDOW + 2);
@@ -567,7 +571,7 @@ static int hvc_find_vtys(void)
567 571
568 for (vty = of_find_node_by_name(NULL, "vty"); vty != NULL; 572 for (vty = of_find_node_by_name(NULL, "vty"); vty != NULL;
569 vty = of_find_node_by_name(vty, "vty")) { 573 vty = of_find_node_by_name(vty, "vty")) {
570 uint32_t *vtermno; 574 const uint32_t *vtermno;
571 575
572 /* We have statically defined space for only a certain number 576 /* We have statically defined space for only a certain number
573 * of console adapters. 577 * of console adapters.
@@ -576,7 +580,7 @@ static int hvc_find_vtys(void)
576 (num_found >= VTTY_PORTS)) 580 (num_found >= VTTY_PORTS))
577 break; 581 break;
578 582
579 vtermno = (uint32_t *)get_property(vty, "reg", NULL); 583 vtermno = get_property(vty, "reg", NULL);
580 if (!vtermno) 584 if (!vtermno)
581 continue; 585 continue;
582 586
diff --git a/drivers/char/hvc_vio.c b/drivers/char/hvc_vio.c
index cc95941148fb..f9c00844d2bf 100644
--- a/drivers/char/hvc_vio.c
+++ b/drivers/char/hvc_vio.c
@@ -35,6 +35,7 @@
35#include <asm/hvconsole.h> 35#include <asm/hvconsole.h>
36#include <asm/vio.h> 36#include <asm/vio.h>
37#include <asm/prom.h> 37#include <asm/prom.h>
38#include <asm/firmware.h>
38 39
39#include "hvc_console.h" 40#include "hvc_console.h"
40 41
@@ -120,6 +121,9 @@ static int hvc_vio_init(void)
120{ 121{
121 int rc; 122 int rc;
122 123
124 if (firmware_has_feature(FW_FEATURE_ISERIES))
125 return -EIO;
126
123 /* Register as a vio device to receive callbacks */ 127 /* Register as a vio device to receive callbacks */
124 rc = vio_register_driver(&hvc_vio_driver); 128 rc = vio_register_driver(&hvc_vio_driver);
125 129