Commit 7602aa8d authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://linux-pnp.bkbits.net/pnp-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 3a80046a 6f9119dd
...@@ -323,14 +323,14 @@ pnp_set_current_resources(struct device * dmdev, const char * ubuf, size_t count ...@@ -323,14 +323,14 @@ pnp_set_current_resources(struct device * dmdev, const char * ubuf, size_t count
if (!strnicmp(buf,"auto",4)) { if (!strnicmp(buf,"auto",4)) {
if (dev->active) if (dev->active)
goto done; goto done;
pnp_init_resources(&dev->res); pnp_init_resource_table(&dev->res);
retval = pnp_auto_config_dev(dev); retval = pnp_auto_config_dev(dev);
goto done; goto done;
} }
if (!strnicmp(buf,"clear",5)) { if (!strnicmp(buf,"clear",5)) {
if (dev->active) if (dev->active)
goto done; goto done;
pnp_init_resources(&dev->res); pnp_init_resource_table(&dev->res);
goto done; goto done;
} }
if (!strnicmp(buf,"get",3)) { if (!strnicmp(buf,"get",3)) {
...@@ -345,7 +345,7 @@ pnp_set_current_resources(struct device * dmdev, const char * ubuf, size_t count ...@@ -345,7 +345,7 @@ pnp_set_current_resources(struct device * dmdev, const char * ubuf, size_t count
if (dev->active) if (dev->active)
goto done; goto done;
buf += 3; buf += 3;
pnp_init_resources(&dev->res); pnp_init_resource_table(&dev->res);
down(&pnp_res_mutex); down(&pnp_res_mutex);
while (1) { while (1) {
while (isspace(*buf)) while (isspace(*buf))
......
...@@ -458,7 +458,7 @@ static struct pnp_dev * __init isapnp_parse_device(struct pnp_card *card, int si ...@@ -458,7 +458,7 @@ static struct pnp_dev * __init isapnp_parse_device(struct pnp_card *card, int si
dev->capabilities |= PNP_READ; dev->capabilities |= PNP_READ;
dev->capabilities |= PNP_WRITE; dev->capabilities |= PNP_WRITE;
dev->capabilities |= PNP_DISABLE; dev->capabilities |= PNP_DISABLE;
pnp_init_resources(&dev->res); pnp_init_resource_table(&dev->res);
return dev; return dev;
} }
...@@ -1020,7 +1020,7 @@ static int isapnp_read_resources(struct pnp_dev *dev, struct pnp_resource_table ...@@ -1020,7 +1020,7 @@ static int isapnp_read_resources(struct pnp_dev *dev, struct pnp_resource_table
static int isapnp_get_resources(struct pnp_dev *dev, struct pnp_resource_table * res) static int isapnp_get_resources(struct pnp_dev *dev, struct pnp_resource_table * res)
{ {
int ret; int ret;
pnp_init_resources(res); pnp_init_resource_table(res);
isapnp_cfg_begin(dev->card->number, dev->number); isapnp_cfg_begin(dev->card->number, dev->number);
ret = isapnp_read_resources(dev, res); ret = isapnp_read_resources(dev, res);
isapnp_cfg_end(); isapnp_cfg_end();
......
...@@ -190,10 +190,9 @@ static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx) ...@@ -190,10 +190,9 @@ static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx)
* @table: pointer to the desired resource table * @table: pointer to the desired resource table
* *
*/ */
void pnp_init_resources(struct pnp_resource_table *table) void pnp_init_resource_table(struct pnp_resource_table *table)
{ {
int idx; int idx;
down(&pnp_res_mutex);
for (idx = 0; idx < PNP_MAX_IRQ; idx++) { for (idx = 0; idx < PNP_MAX_IRQ; idx++) {
table->irq_resource[idx].name = NULL; table->irq_resource[idx].name = NULL;
table->irq_resource[idx].start = -1; table->irq_resource[idx].start = -1;
...@@ -218,7 +217,6 @@ void pnp_init_resources(struct pnp_resource_table *table) ...@@ -218,7 +217,6 @@ void pnp_init_resources(struct pnp_resource_table *table)
table->mem_resource[idx].end = 0; table->mem_resource[idx].end = 0;
table->mem_resource[idx].flags = IORESOURCE_AUTO; table->mem_resource[idx].flags = IORESOURCE_AUTO;
} }
up(&pnp_res_mutex);
} }
/** /**
...@@ -226,7 +224,7 @@ void pnp_init_resources(struct pnp_resource_table *table) ...@@ -226,7 +224,7 @@ void pnp_init_resources(struct pnp_resource_table *table)
* @res - the resources to clean * @res - the resources to clean
* *
*/ */
static void pnp_clean_resources(struct pnp_resource_table * res) static void pnp_clean_resource_table(struct pnp_resource_table * res)
{ {
int idx; int idx;
for (idx = 0; idx < PNP_MAX_IRQ; idx++) { for (idx = 0; idx < PNP_MAX_IRQ; idx++) {
...@@ -278,7 +276,7 @@ int pnp_assign_resources(struct pnp_dev *dev, int depnum) ...@@ -278,7 +276,7 @@ int pnp_assign_resources(struct pnp_dev *dev, int depnum)
return -ENODEV; return -ENODEV;
down(&pnp_res_mutex); down(&pnp_res_mutex);
pnp_clean_resources(&dev->res); /* start with a fresh slate */ pnp_clean_resource_table(&dev->res); /* start with a fresh slate */
if (dev->independent) { if (dev->independent) {
port = dev->independent->port; port = dev->independent->port;
mem = dev->independent->mem; mem = dev->independent->mem;
...@@ -351,7 +349,7 @@ int pnp_assign_resources(struct pnp_dev *dev, int depnum) ...@@ -351,7 +349,7 @@ int pnp_assign_resources(struct pnp_dev *dev, int depnum)
return 1; return 1;
fail: fail:
pnp_clean_resources(&dev->res); pnp_clean_resource_table(&dev->res);
up(&pnp_res_mutex); up(&pnp_res_mutex);
return 0; return 0;
} }
...@@ -510,7 +508,7 @@ int pnp_disable_dev(struct pnp_dev *dev) ...@@ -510,7 +508,7 @@ int pnp_disable_dev(struct pnp_dev *dev)
/* release the resources so that other devices can use them */ /* release the resources so that other devices can use them */
down(&pnp_res_mutex); down(&pnp_res_mutex);
pnp_clean_resources(&dev->res); pnp_clean_resource_table(&dev->res);
up(&pnp_res_mutex); up(&pnp_res_mutex);
return 1; return 1;
...@@ -539,4 +537,4 @@ EXPORT_SYMBOL(pnp_auto_config_dev); ...@@ -539,4 +537,4 @@ EXPORT_SYMBOL(pnp_auto_config_dev);
EXPORT_SYMBOL(pnp_activate_dev); EXPORT_SYMBOL(pnp_activate_dev);
EXPORT_SYMBOL(pnp_disable_dev); EXPORT_SYMBOL(pnp_disable_dev);
EXPORT_SYMBOL(pnp_resource_change); EXPORT_SYMBOL(pnp_resource_change);
EXPORT_SYMBOL(pnp_init_resources); EXPORT_SYMBOL(pnp_init_resource_table);
...@@ -937,7 +937,7 @@ static int insert_device(struct pnp_dev *dev, struct pnp_bios_node * node) ...@@ -937,7 +937,7 @@ static int insert_device(struct pnp_dev *dev, struct pnp_bios_node * node)
/* clear out the damaged flags */ /* clear out the damaged flags */
if (!dev->active) if (!dev->active)
pnp_init_resources(&dev->res); pnp_init_resource_table(&dev->res);
pnp_add_device(dev); pnp_add_device(dev);
pnpbios_interface_attach_device(node); pnpbios_interface_attach_device(node);
......
...@@ -123,7 +123,7 @@ unsigned char * pnp_parse_current_resources(unsigned char * p, unsigned char * e ...@@ -123,7 +123,7 @@ unsigned char * pnp_parse_current_resources(unsigned char * p, unsigned char * e
return NULL; return NULL;
/* Blank the resource table values */ /* Blank the resource table values */
pnp_init_resources(res); pnp_init_resource_table(res);
while ((char *)p < (char *)end) { while ((char *)p < (char *)end) {
......
...@@ -400,7 +400,7 @@ int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data); ...@@ -400,7 +400,7 @@ int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data);
int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data); int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data);
int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data); int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data);
int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data); int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data);
void pnp_init_resources(struct pnp_resource_table *table); void pnp_init_resource_table(struct pnp_resource_table *table);
int pnp_assign_resources(struct pnp_dev *dev, int depnum); int pnp_assign_resources(struct pnp_dev *dev, int depnum);
int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode); int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode);
int pnp_auto_config_dev(struct pnp_dev *dev); int pnp_auto_config_dev(struct pnp_dev *dev);
...@@ -448,7 +448,7 @@ static inline int pnp_register_irq_resource(struct pnp_option *option, struct pn ...@@ -448,7 +448,7 @@ static inline int pnp_register_irq_resource(struct pnp_option *option, struct pn
static inline int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data) { return -ENODEV; } static inline int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data) { return -ENODEV; }
static inline int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data) { return -ENODEV; } static inline int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data) { return -ENODEV; }
static inline int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data) { return -ENODEV; } static inline int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data) { return -ENODEV; }
static inline void pnp_init_resources(struct pnp_resource_table *table) { } static inline void pnp_init_resource_table(struct pnp_resource_table *table) { }
static inline int pnp_assign_resources(struct pnp_dev *dev, int depnum) { return -ENODEV; } static inline int pnp_assign_resources(struct pnp_dev *dev, int depnum) { return -ENODEV; }
static inline int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode) { return -ENODEV; } static inline int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode) { return -ENODEV; }
static inline int pnp_auto_config_dev(struct pnp_dev *dev) { return -ENODEV; } static inline int pnp_auto_config_dev(struct pnp_dev *dev) { return -ENODEV; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment