pnp_set_current_resources(struct device * dmdev, const char * ubuf, size_t count) 
pnp_set_current_resources(struct device * dmdev, struct device_attribute *attr, const char * ubuf, size_t count) 
pnp_set_current_resources(struct device * dmdev, const char * ubuf, size_t count){	struct pnp_dev *dev = to_pnp_dev(dmdev);	char	*buf = (void *)ubuf;	int	retval = 0;	if (dev->status & PNP_ATTACHED) {		retval = -EBUSY;		pnp_info("Device %s cannot be configured because it is in use.", dev->dev.bus_id);		goto done;	}	while (isspace(*buf))		++buf;	if (!strnicmp(buf,"disable",7)) {		retval = pnp_disable_dev(dev);		goto done;	}	if (!strnicmp(buf,"activate",8)) {		retval = pnp_activate_dev(dev);		goto done;	}	if (!strnicmp(buf,"fill",4)) {		if (dev->active)			goto done;		retval = pnp_auto_config_dev(dev);		goto done;	}	if (!strnicmp(buf,"auto",4)) {		if (dev->active)			goto done;		pnp_init_resource_table(&dev->res);		retval = pnp_auto_config_dev(dev);		goto done;	}	if (!strnicmp(buf,"clear",5)) {		if (dev->active)			goto done;		pnp_init_resource_table(&dev->res);		goto done;	}	if (!strnicmp(buf,"get",3)) {		down(&pnp_res_mutex);		if (pnp_can_read(dev))			dev->protocol->get(dev, &dev->res);		up(&pnp_res_mutex);		goto done;	}	if (!strnicmp(buf,"set",3)) {		int nport = 0, nmem = 0, nirq = 0, ndma = 0;		if (dev->active)			goto done;		buf += 3;		pnp_init_resource_table(&dev->res);		down(&pnp_res_mutex);		while (1) {			while (isspace(*buf))				++buf;			if (!strnicmp(buf,"io",2)) {				buf += 2;				while (isspace(*buf))					++buf;				dev->res.port_resource[nport].start = simple_strtoul(buf,&buf,0);				while (isspace(*buf))					++buf;				if(*buf == '-') {					buf += 1;					while (isspace(*buf))						++buf;					dev->res.port_resource[nport].end = simple_strtoul(buf,&buf,0);				} else					dev->res.port_resource[nport].end = dev->res.port_resource[nport].start;				dev->res.port_resource[nport].flags = IORESOURCE_IO;				nport++;				if (nport >= PNP_MAX_PORT)					break;				continue;			}			if (!strnicmp(buf,"mem",3)) {				buf += 3;				while (isspace(*buf))					++buf;				dev->res.mem_resource[nmem].start = simple_strtoul(buf,&buf,0);				while (isspace(*buf))					++buf;				if(*buf == '-') {					buf += 1;					while (isspace(*buf))						++buf;					dev->res.mem_resource[nmem].end = simple_strtoul(buf,&buf,0);				} else					dev->res.mem_resource[nmem].end = dev->res.mem_resource[nmem].start;				dev->res.mem_resource[nmem].flags = IORESOURCE_MEM;				nmem++;				if (nmem >= PNP_MAX_MEM)					break;				continue;			}			if (!strnicmp(buf,"irq",3)) {				buf += 3;				while (isspace(*buf))					++buf;				dev->res.irq_resource[nirq].start =				dev->res.irq_resource[nirq].end = simple_strtoul(buf,&buf,0);				dev->res.irq_resource[nirq].flags = IORESOURCE_IRQ;				nirq++;				if (nirq >= PNP_MAX_IRQ)					break;				continue;			}			if (!strnicmp(buf,"dma",3)) {				buf += 3;				while (isspace(*buf))					++buf;				dev->res.dma_resource[ndma].start =				dev->res.dma_resource[ndma].end = simple_strtoul(buf,&buf,0);				dev->res.dma_resource[ndma].flags = IORESOURCE_DMA;				ndma++;				if (ndma >= PNP_MAX_DMA)					break;				continue;			}			break;		}		up(&pnp_res_mutex);		goto done;	} done:	if (retval < 0)		return retval;	return count;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/e404e274f62665f3333d6a539d0d3701f678a598/interface.c/clean/drivers/pnp/interface.c