提交 de0138da 编写于 作者: S Stephen Rothwell

[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: NStephen Rothwell <sfr@canb.auug.org.au>
上级 ef26a46f
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <asm/hvconsole.h> #include <asm/hvconsole.h>
#include <asm/vio.h> #include <asm/vio.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/firmware.h>
#include <asm/iseries/vio.h> #include <asm/iseries/vio.h>
#include <asm/iseries/hv_call.h> #include <asm/iseries/hv_call.h>
#include <asm/iseries/hv_lp_config.h> #include <asm/iseries/hv_lp_config.h>
...@@ -493,6 +494,9 @@ static int hvc_vio_init(void) ...@@ -493,6 +494,9 @@ static int hvc_vio_init(void)
atomic_t wait_flag; atomic_t wait_flag;
int rc; int rc;
if (!firmware_has_feature(FW_FEATURE_ISERIES))
return -EIO;
/* +2 for fudge */ /* +2 for fudge */
rc = viopath_open(HvLpConfig_getPrimaryLpIndex(), rc = viopath_open(HvLpConfig_getPrimaryLpIndex(),
viomajorsubtype_chario, VIOCHAR_WINDOW + 2); viomajorsubtype_chario, VIOCHAR_WINDOW + 2);
...@@ -567,7 +571,7 @@ static int hvc_find_vtys(void) ...@@ -567,7 +571,7 @@ static int hvc_find_vtys(void)
for (vty = of_find_node_by_name(NULL, "vty"); vty != NULL; for (vty = of_find_node_by_name(NULL, "vty"); vty != NULL;
vty = of_find_node_by_name(vty, "vty")) { vty = of_find_node_by_name(vty, "vty")) {
uint32_t *vtermno; const uint32_t *vtermno;
/* We have statically defined space for only a certain number /* We have statically defined space for only a certain number
* of console adapters. * of console adapters.
...@@ -576,7 +580,7 @@ static int hvc_find_vtys(void) ...@@ -576,7 +580,7 @@ static int hvc_find_vtys(void)
(num_found >= VTTY_PORTS)) (num_found >= VTTY_PORTS))
break; break;
vtermno = (uint32_t *)get_property(vty, "reg", NULL); vtermno = get_property(vty, "reg", NULL);
if (!vtermno) if (!vtermno)
continue; continue;
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <asm/hvconsole.h> #include <asm/hvconsole.h>
#include <asm/vio.h> #include <asm/vio.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/firmware.h>
#include "hvc_console.h" #include "hvc_console.h"
...@@ -120,6 +121,9 @@ static int hvc_vio_init(void) ...@@ -120,6 +121,9 @@ static int hvc_vio_init(void)
{ {
int rc; int rc;
if (firmware_has_feature(FW_FEATURE_ISERIES))
return -EIO;
/* Register as a vio device to receive callbacks */ /* Register as a vio device to receive callbacks */
rc = vio_register_driver(&hvc_vio_driver); rc = vio_register_driver(&hvc_vio_driver);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册