[IA64] add platform check to snsc driver init
authorGreg Edwards <edwardsg@sgi.com>
Fri, 28 Jul 2006 15:03:55 +0000 (10:03 -0500)
committerTony Luck <tony.luck@intel.com>
Wed, 2 Aug 2006 23:07:55 +0000 (16:07 -0700)
Add a platform check to the snsc driver init function, to prevent
loading on non-sn2 systems.

Signed-off-by: Greg Edwards <edwardsg@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
drivers/char/snsc.c

index afc6eda602f7f6fa45ed1b70af620bf8810ed4fc..07e0b75f2338b59a6ca2b9c76917115afd935526 100644 (file)
@@ -374,7 +374,12 @@ scdrv_init(void)
        struct sysctl_data_s *scd;
        void *salbuf;
        dev_t first_dev, dev;
-       nasid_t event_nasid = ia64_sn_get_console_nasid();
+       nasid_t event_nasid;
+
+       if (!ia64_platform_is("sn2"))
+               return -ENODEV;
+
+       event_nasid = ia64_sn_get_console_nasid();
 
        if (alloc_chrdev_region(&first_dev, 0, num_cnodes,
                                SYSCTL_BASENAME) < 0) {