ns558 = kcalloc(1, sizeof(struct ns558), GFP_KERNEL); 
ns558 = kzalloc(sizeof(struct ns558), GFP_KERNEL); 
static int ns558_isa_probe(int io){	int i, j, b;	unsigned char c, u, v;	struct ns558 *ns558;	struct gameport *port;/* * No one should be using this address. */	if (!request_region(io, 1, "ns558-isa"))		return -EBUSY;/* * We must not be able to write arbitrary values to the port. * The lower two axis bits must be 1 after a write. */	c = inb(io);	outb(~c & ~3, io);	if (~(u = v = inb(io)) & 3) {		outb(c, io);		release_region(io, 1);		return -ENODEV;	}/* * After a trigger, there must be at least some bits changing. */	for (i = 0; i < 1000; i++) v &= inb(io);	if (u == v) {		outb(c, io);		release_region(io, 1);		return -ENODEV;	}	msleep(3);/* * After some time (4ms) the axes shouldn't change anymore. */	u = inb(io);	for (i = 0; i < 1000; i++)		if ((u ^ inb(io)) & 0xf) {			outb(c, io);			release_region(io, 1);			return -ENODEV;		}/* * And now find the number of mirrors of the port. */	for (i = 1; i < 5; i++) {		release_region(io & (-1 << (i - 1)), (1 << (i - 1)));		if (!request_region(io & (-1 << i), (1 << i), "ns558-isa"))			break;				/* Don't disturb anyone */		outb(0xff, io & (-1 << i));		for (j = b = 0; j < 1000; j++)			if (inb(io & (-1 << i)) != inb((io & (-1 << i)) + (1 << i) - 1)) b++;		msleep(3);		if (b > 300) {				/* We allow 30% difference */			release_region(io & (-1 << i), (1 << i));			break;		}	}	i--;	if (i != 4) {		if (!request_region(io & (-1 << i), (1 << i), "ns558-isa"))			return -EBUSY;	}	ns558 = kcalloc(1, sizeof(struct ns558), GFP_KERNEL);	port = gameport_allocate_port();	if (!ns558 || !port) {		printk(KERN_ERR "ns558: Memory allocation failed.\n");		release_region(io & (-1 << i), (1 << i));		kfree(ns558);		gameport_free_port(port);		return -ENOMEM;	}	memset(ns558, 0, sizeof(struct ns558));	ns558->io = io;	ns558->size = 1 << i;	ns558->gameport = port;	port->io = io;	gameport_set_name(port, "NS558 ISA Gameport");	gameport_set_phys(port, "isa%04x/gameport0", io & (-1 << i));	gameport_register_port(port);	list_add(&ns558->node, &ns558_list);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/a97e148a8b8da8b04bc3e18ceb824a8f5f56d567/ns558.c/clean/drivers/input/gameport/ns558.c