From: Greg Edwards Date: Wed, 28 Sep 2005 22:05:19 +0000 (-0500) Subject: [IA64] mbcs_init() should give up unless running on sn2 X-Git-Tag: v2.6.14-rc5~61^2^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=96f339c6b95344942fe5fce012ff4f2a3b2cb80d;p=linux-2.6-omap-h63xx.git [IA64] mbcs_init() should give up unless running on sn2 CONFIG_SGI_MBCS is enabled in generic kernels, but the driver may oops some other platforms. Check whether we are running on sn2 and bail out if we are not before doing anything dangerous. Acked-by: Bruce Losure Signed-off-by: Greg Edwards Signed-off-by: Tony Luck --- diff --git a/drivers/char/mbcs.c b/drivers/char/mbcs.c index 3fa64c63110..c268ee04b2a 100644 --- a/drivers/char/mbcs.c +++ b/drivers/char/mbcs.c @@ -830,6 +830,9 @@ static int __init mbcs_init(void) { int rv; + if (!ia64_platform_is("sn2")) + return -ENODEV; + // Put driver into chrdevs[]. Get major number. rv = register_chrdev(mbcs_major, DEVICE_NAME, &mbcs_ops); if (rv < 0) {