memset(dev, 0, sizeof(struct dio_dev)); 
static int __init dio_init(void){	int scode;	mm_segment_t fs;	int i;	struct dio_dev *dev;	if (!MACH_IS_HP300)		return 0;        printk(KERN_INFO "Scanning for DIO devices...\n");	/* Initialize the DIO bus */ 	INIT_LIST_HEAD(&dio_bus.devices);	strcpy(dio_bus.dev.bus_id, "dio");	device_register(&dio_bus.dev);	/* Request all resources */	dio_bus.num_resources = (hp300_model == HP_320 ? 1 : 2);	for (i = 0; i < dio_bus.num_resources; i++)		request_resource(&iomem_resource, &dio_bus.resources[i]);	/* Register all devices */        for (scode = 0; scode < DIO_SCMAX; ++scode)        {                u_char prid, secid = 0;        /* primary, secondary ID bytes */                u_char *va;		unsigned long pa;                                if (DIO_SCINHOLE(scode))                        continue;		pa = dio_scodetophysaddr(scode);		if (!pa)			continue;		if (scode < DIOII_SCBASE)			va = (void *)(pa + DIO_VIRADDRBASE);		else			va = ioremap(pa, PAGE_SIZE);		fs = get_fs();		set_fs(KERNEL_DS);                if (get_user(i, (unsigned char *)va + DIO_IDOFF)) {			set_fs(fs);			if (scode >= DIOII_SCBASE)				iounmap(va);                        continue;              /* no board present at that select code */		}		set_fs(fs);                /* Found a board, allocate it an entry in the list */		dev = kmalloc(sizeof(struct dio_dev), GFP_KERNEL);		if (!dev)			return 0;		memset(dev, 0, sizeof(struct dio_dev));		dev->bus = &dio_bus;		dev->dev.parent = &dio_bus.dev;		dev->dev.bus = &dio_bus_type;		dev->scode = scode;		dev->resource.start = pa;		dev->resource.end = pa + DIO_SIZE(scode, va);		sprintf(dev->dev.bus_id,"%02x", scode);                /* read the ID byte(s) and encode if necessary. */		prid = DIO_ID(va);                if (DIO_NEEDSSECID(prid)) {                        secid = DIO_SECID(va);                        dev->id = DIO_ENCODE_ID(prid, secid);                } else                        dev->id = prid;                dev->ipl = DIO_IPL(va);                strcpy(dev->name,dio_getname(dev->id));                printk(KERN_INFO "select code %3d: ipl %d: ID %02X", dev->scode, dev->ipl, prid);                if (DIO_NEEDSSECID(prid))                        printk(":%02X", secid);                printk(": %s\n", dev->name);		if (scode >= DIOII_SCBASE)			iounmap(va);		device_register(&dev->dev);		dio_create_sysfs_dev_files(dev);        }	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/e66860cbda4a1880fa379bee17d6ab926e5cc58e/dio.c/clean/drivers/dio/dio.c