From fb8b50078458ba74c3d3f7bf05f5ddc27b88f051 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Fri, 15 Dec 2006 15:40:08 +1100 Subject: [POWERPC] iSeries: fix viodasd init Don't initialise viodasd except on legacy iSeries. Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- drivers/block/viodasd.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers') diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c index e19ba4ebcd4e..68592c336011 100644 --- a/drivers/block/viodasd.c +++ b/drivers/block/viodasd.c @@ -49,6 +49,7 @@ #include #include #include +#include MODULE_DESCRIPTION("iSeries Virtual DASD"); MODULE_AUTHOR("Dave Boutcher"); @@ -769,6 +770,11 @@ static int __init viodasd_init(void) { int rc; + if (!firmware_has_feature(FW_FEATURE_ISERIES)) { + rc = -ENODEV; + goto early_fail; + } + /* Try to open to our host lp */ if (viopath_hostLp == HvLpIndexInvalid) vio_set_hostlp(); -- cgit v1.2.3 From fd38451f1512fd5230e3c5dcc66d1ca867af879b Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Fri, 15 Dec 2006 15:41:43 +1100 Subject: [POWERPC] iSeries: fix viotape init Only initialise viotape on legacy iSeries. Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- drivers/char/viotape.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c index 94d79cb8ce8d..9438512b17f1 100644 --- a/drivers/char/viotape.c +++ b/drivers/char/viotape.c @@ -49,7 +49,7 @@ #include #include - +#include #include #include #include @@ -997,6 +997,9 @@ int __init viotap_init(void) int ret; struct proc_dir_entry *e; + if (!firmware_has_feature(FW_FEATURE_ISERIES)) + return -ENODEV; + op_struct_list = NULL; if ((ret = add_op_structs(VIOTAPE_MAXREQ)) < 0) { printk(VIOTAPE_KERN_WARN "couldn't allocate op structs\n"); -- cgit v1.2.3 From 687d18abed09315a531470a0edcae977ef6a7f9e Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Fri, 15 Dec 2006 15:42:50 +1100 Subject: [POWERPC] iSeries: fix iseries_veth init Only initialise iseries_veth on legacy iSeries. Make the init and exit routines static. Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- drivers/net/iseries_veth.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c index d6f4f185bf37..2194b567239f 100644 --- a/drivers/net/iseries_veth.c +++ b/drivers/net/iseries_veth.c @@ -73,7 +73,7 @@ #include #include #include - +#include #include #include #include @@ -1668,7 +1668,7 @@ static struct vio_driver veth_driver = { * Module initialization/cleanup */ -void __exit veth_module_cleanup(void) +static void __exit veth_module_cleanup(void) { int i; struct veth_lpar_connection *cnx; @@ -1697,11 +1697,14 @@ void __exit veth_module_cleanup(void) } module_exit(veth_module_cleanup); -int __init veth_module_init(void) +static int __init veth_module_init(void) { int i; int rc; + if (!firmware_has_feature(FW_FEATURE_ISERIES)) + return -ENODEV; + this_lp = HvLpConfig_getLpIndex_outline(); for (i = 0; i < HVMAXARCHITECTEDLPS; ++i) { -- cgit v1.2.3 From 31c72ad0d10b561e7e5f843747e7d0c1abf4d6f7 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Fri, 15 Dec 2006 15:44:04 +1100 Subject: [POWERPC] iSeries: fix viocd init Only initialise viocd on legacy iSeries. Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- drivers/cdrom/viocd.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers') diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c index 54ca931e19ea..93fbf84dcc4a 100644 --- a/drivers/cdrom/viocd.c +++ b/drivers/cdrom/viocd.c @@ -47,6 +47,7 @@ #include #include #include +#include #define VIOCD_DEVICE "iseries/vcd" @@ -748,6 +749,9 @@ static int __init viocd_init(void) struct proc_dir_entry *e; int ret = 0; + if (!firmware_has_feature(FW_FEATURE_ISERIES)) + return -ENODEV; + if (viopath_hostLp == HvLpIndexInvalid) { vio_set_hostlp(); /* If we don't have a host, bail out */ -- cgit v1.2.3 From 94c8f9f974f2ad29b90b2830b189d74a633fef49 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Fri, 15 Dec 2006 15:45:13 +1100 Subject: [POWERPC] iSeries: fix viocons init Only initialise viocons on legacy iSeries. Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- drivers/char/viocons.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers') diff --git a/drivers/char/viocons.c b/drivers/char/viocons.c index 0e0da443cbd5..8de6b95aeb84 100644 --- a/drivers/char/viocons.c +++ b/drivers/char/viocons.c @@ -42,6 +42,7 @@ #include #include +#include #include #include #include @@ -1060,6 +1061,9 @@ static int __init viocons_init2(void) atomic_t wait_flag; int rc; + if (!firmware_has_feature(FW_FEATURE_ISERIES)) + return -ENODEV; + /* +2 for fudge */ rc = viopath_open(HvLpConfig_getPrimaryLpIndex(), viomajorsubtype_chario, VIOCHAR_WINDOW + 2); @@ -1145,6 +1149,9 @@ static int __init viocons_init(void) { int i; + if (!firmware_has_feature(FW_FEATURE_ISERIES)) + return -ENODEV; + printk(VIOCONS_KERN_INFO "registering console\n"); for (i = 0; i < VTTY_PORTS; i++) { port_info[i].lp = HvLpIndexInvalid; -- cgit v1.2.3