Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * sim710.c - Copyright (C) 1999 Richard Hirst <richard@sleepie.demon.co.uk>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *----------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *----------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  * MCA card detection code by Trent McNair. (now deleted)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  * Fixes to not explicitly nul bss data from Xavier Bestel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  * Some multiboard fixes from Rolf Eike Beer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11)  * Auto probing of EISA config space from Trevor Hemsley.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13)  * Rewritten to use 53c700.c by James.Bottomley@SteelEye.com
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <linux/blkdev.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include <linux/device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #include <linux/eisa.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #include <linux/interrupt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #include <scsi/scsi_host.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #include <scsi/scsi_device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #include <scsi/scsi_transport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #include <scsi/scsi_transport_spi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) #include "53c700.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) /* Must be enough for EISA */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) #define MAX_SLOTS 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) static __u8 __initdata id_array[MAX_SLOTS] = { [0 ... MAX_SLOTS-1] = 7 };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) static char *sim710;		/* command line passed by insmod */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) MODULE_AUTHOR("Richard Hirst");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) MODULE_DESCRIPTION("Simple NCR53C710 driver");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) MODULE_LICENSE("GPL");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) module_param(sim710, charp, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) #ifdef MODULE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) #define ARG_SEP ' '
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) #define ARG_SEP ','
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) static __init int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) param_setup(char *str)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	char *pos = str, *next;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	int slot = -1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	while(pos != NULL && (next = strchr(pos, ':')) != NULL) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 		int val = (int)simple_strtoul(++next, NULL, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 		if(!strncmp(pos, "slot:", 5))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 			slot = val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 		else if(!strncmp(pos, "id:", 3)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 			if(slot == -1) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 				printk(KERN_WARNING "sim710: Must specify slot for id parameter\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 			} else if(slot >= MAX_SLOTS) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 				printk(KERN_WARNING "sim710: Illegal slot %d for id %d\n", slot, val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 			} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 				id_array[slot] = val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 		if((pos = strchr(pos, ARG_SEP)) != NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 			pos++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	return 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) __setup("sim710=", param_setup);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) static struct scsi_host_template sim710_driver_template = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	.name			= "LSI (Symbios) 710 EISA",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	.proc_name		= "sim710",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	.this_id		= 7,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	.module			= THIS_MODULE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) static int sim710_probe_common(struct device *dev, unsigned long base_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 			       int irq, int clock, int differential,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 			       int scsi_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	struct Scsi_Host * host = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	struct NCR_700_Host_Parameters *hostdata =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 		kzalloc(sizeof(struct NCR_700_Host_Parameters),	GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	printk(KERN_NOTICE "sim710: %s\n", dev_name(dev));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	printk(KERN_NOTICE "sim710: irq = %d, clock = %d, base = 0x%lx, scsi_id = %d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	       irq, clock, base_addr, scsi_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	if(hostdata == NULL) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 		printk(KERN_ERR "sim710: Failed to allocate host data\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	if(request_region(base_addr, 64, "sim710") == NULL) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 		printk(KERN_ERR "sim710: Failed to reserve IO region 0x%lx\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 		       base_addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 		goto out_free;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	/* Fill in the three required pieces of hostdata */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	hostdata->base = ioport_map(base_addr, 64);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	hostdata->differential = differential;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	hostdata->clock = clock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	hostdata->chip710 = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	hostdata->burst_length = 8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	/* and register the chip */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	if((host = NCR_700_detect(&sim710_driver_template, hostdata, dev))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	   == NULL) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 		printk(KERN_ERR "sim710: No host detected; card configuration problem?\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 		goto out_release;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	host->this_id = scsi_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	host->base = base_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	host->irq = irq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	if (request_irq(irq, NCR_700_intr, IRQF_SHARED, "sim710", host)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 		printk(KERN_ERR "sim710: request_irq failed\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 		goto out_put_host;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	dev_set_drvdata(dev, host);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	scsi_scan_host(host);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)  out_put_host:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	scsi_host_put(host);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)  out_release:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	release_region(base_addr, 64);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)  out_free:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	kfree(hostdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)  out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	return -ENODEV;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) static int sim710_device_remove(struct device *dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	struct Scsi_Host *host = dev_get_drvdata(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	struct NCR_700_Host_Parameters *hostdata =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 		(struct NCR_700_Host_Parameters *)host->hostdata[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	scsi_remove_host(host);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	NCR_700_release(host);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	kfree(hostdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	free_irq(host->irq, host);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	release_region(host->base, 64);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) #ifdef CONFIG_EISA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) static struct eisa_device_id sim710_eisa_ids[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	{ "CPQ4410" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	{ "CPQ4411" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	{ "HWP0C80" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	{ "" }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) MODULE_DEVICE_TABLE(eisa, sim710_eisa_ids);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) static int sim710_eisa_probe(struct device *dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	struct eisa_device *edev = to_eisa_device(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	unsigned long io_addr = edev->base_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	char eisa_cpq_irqs[] = { 11, 14, 15, 10, 9, 0 };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	char eisa_hwp_irqs[] = { 3, 4, 5, 7, 12, 10, 11, 0};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	char *eisa_irqs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	unsigned char irq_index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	unsigned char irq, differential = 0, scsi_id = 7;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	if(strcmp(edev->id.sig, "HWP0C80") == 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 		__u8 val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 		eisa_irqs =  eisa_hwp_irqs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 		irq_index = (inb(io_addr + 0xc85) & 0x7) - 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 		val = inb(io_addr + 0x4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 		scsi_id = ffs(val) - 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 		if(scsi_id > 7 || (val & ~(1<<scsi_id)) != 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 			printk(KERN_ERR "sim710.c, EISA card %s has incorrect scsi_id, setting to 7\n", dev_name(dev));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 			scsi_id = 7;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 		eisa_irqs = eisa_cpq_irqs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 		irq_index = inb(io_addr + 0xc88) & 0x07;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	if(irq_index >= strlen(eisa_irqs)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 		printk("sim710.c: irq nasty\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 		return -ENODEV;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	irq = eisa_irqs[irq_index];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 		
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	return sim710_probe_common(dev, io_addr, irq, 50,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 				   differential, scsi_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) static struct eisa_driver sim710_eisa_driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	.id_table		= sim710_eisa_ids,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	.driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 		.name		= "sim710",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 		.probe		= sim710_eisa_probe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 		.remove		= sim710_device_remove,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) #endif /* CONFIG_EISA */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) static int __init sim710_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	int err = -ENODEV;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) #ifdef MODULE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	if (sim710)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 		param_setup(sim710);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) #ifdef CONFIG_EISA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	err = eisa_driver_register(&sim710_eisa_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	/* FIXME: what we'd really like to return here is -ENODEV if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	 * no devices have actually been found.  Instead, the err
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	 * above actually only reports problems with kobject_register,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	 * so for the moment return success */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) static void __exit sim710_exit(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) #ifdef CONFIG_EISA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	eisa_driver_unregister(&sim710_eisa_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) module_init(sim710_init);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) module_exit(sim710_exit);