Re: [PATCH] add platform check to a couple sn2-only drivers

From: Greg Edwards <edwardsg_at_sgi.com>
Date: 2006-07-29 01:03:55
On Fri, Jul 28, 2006 at 03:50:22PM +0100, Christoph Hellwig wrote:
| On Fri, Jul 28, 2006 at 09:36:26AM -0500, Greg Edwards wrote:
| > -	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();
| 
| this one is okay and required.
| 
| >  static int __devinit
| >  ioc4_init(void)
| >  {
| > +	if (!ia64_platform_is("sn2"))
| > +		return -ENODEV;
| > +
| 
| this one not.  The pci id matching will take care of things. 

Ok, thanks Christoph.  Brent brought that up, too, but we had been
burned by thinking we had it covered before on other drivers.
Tony, revised patch below.

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>

---
 drivers/char/snsc.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Index: git-linus/drivers/char/snsc.c
===================================================================
--- git-linus.orig/drivers/char/snsc.c	2006-07-28 09:58:08.167283230 -0500
+++ git-linus/drivers/char/snsc.c	2006-07-28 09:58:45.095703646 -0500
@@ -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) {
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Sat Jul 29 01:04:36 2006

This archive was generated by hypermail 2.1.8 : 2006-07-29 01:04:45 EST