diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/viodasd.c | 6 | ||||
-rw-r--r-- | drivers/cdrom/viocd.c | 4 | ||||
-rw-r--r-- | drivers/char/viocons.c | 7 | ||||
-rw-r--r-- | drivers/char/viotape.c | 5 | ||||
-rw-r--r-- | drivers/net/iseries_veth.c | 9 |
5 files changed, 27 insertions, 4 deletions
diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c index e19ba4ebcd4..68592c33601 100644 --- a/drivers/block/viodasd.c +++ b/drivers/block/viodasd.c @@ -49,6 +49,7 @@ #include <asm/iseries/hv_lp_event.h> #include <asm/iseries/hv_lp_config.h> #include <asm/iseries/vio.h> +#include <asm/firmware.h> 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(); diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c index 54ca931e19e..93fbf84dcc4 100644 --- a/drivers/cdrom/viocd.c +++ b/drivers/cdrom/viocd.c @@ -47,6 +47,7 @@ #include <asm/iseries/hv_types.h> #include <asm/iseries/hv_lp_event.h> #include <asm/iseries/vio.h> +#include <asm/firmware.h> #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 */ diff --git a/drivers/char/viocons.c b/drivers/char/viocons.c index 0e0da443cbd..8de6b95aeb8 100644 --- a/drivers/char/viocons.c +++ b/drivers/char/viocons.c @@ -42,6 +42,7 @@ #include <linux/tty_flip.h> #include <linux/sysrq.h> +#include <asm/firmware.h> #include <asm/iseries/vio.h> #include <asm/iseries/hv_lp_event.h> #include <asm/iseries/hv_call_event.h> @@ -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; diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c index 94d79cb8ce8..9438512b17f 100644 --- a/drivers/char/viotape.c +++ b/drivers/char/viotape.c @@ -49,7 +49,7 @@ #include <asm/uaccess.h> #include <asm/ioctls.h> - +#include <asm/firmware.h> #include <asm/vio.h> #include <asm/iseries/vio.h> #include <asm/iseries/hv_lp_event.h> @@ -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"); diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c index d6f4f185bf3..2194b567239 100644 --- a/drivers/net/iseries_veth.c +++ b/drivers/net/iseries_veth.c @@ -73,7 +73,7 @@ #include <asm/abs_addr.h> #include <asm/iseries/mf.h> #include <asm/uaccess.h> - +#include <asm/firmware.h> #include <asm/iseries/hv_lp_config.h> #include <asm/iseries/hv_types.h> #include <asm/iseries/hv_lp_event.h> @@ -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) { |