|
@@ -323,6 +323,7 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
|
|
const char *ubuf, size_t count)
|
|
const char *ubuf, size_t count)
|
|
{
|
|
{
|
|
struct pnp_dev *dev = to_pnp_dev(dmdev);
|
|
struct pnp_dev *dev = to_pnp_dev(dmdev);
|
|
|
|
+ struct resource *res;
|
|
char *buf = (void *)ubuf;
|
|
char *buf = (void *)ubuf;
|
|
int retval = 0;
|
|
int retval = 0;
|
|
|
|
|
|
@@ -382,21 +383,18 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
|
|
buf += 2;
|
|
buf += 2;
|
|
while (isspace(*buf))
|
|
while (isspace(*buf))
|
|
++buf;
|
|
++buf;
|
|
- dev->res.port_resource[nport].start =
|
|
|
|
- simple_strtoul(buf, &buf, 0);
|
|
|
|
|
|
+ res = &dev->res.port_resource[nport];
|
|
|
|
+ res->start = simple_strtoul(buf, &buf, 0);
|
|
while (isspace(*buf))
|
|
while (isspace(*buf))
|
|
++buf;
|
|
++buf;
|
|
if (*buf == '-') {
|
|
if (*buf == '-') {
|
|
buf += 1;
|
|
buf += 1;
|
|
while (isspace(*buf))
|
|
while (isspace(*buf))
|
|
++buf;
|
|
++buf;
|
|
- dev->res.port_resource[nport].end =
|
|
|
|
- simple_strtoul(buf, &buf, 0);
|
|
|
|
|
|
+ res->end = simple_strtoul(buf, &buf, 0);
|
|
} else
|
|
} else
|
|
- dev->res.port_resource[nport].end =
|
|
|
|
- dev->res.port_resource[nport].start;
|
|
|
|
- dev->res.port_resource[nport].flags =
|
|
|
|
- IORESOURCE_IO;
|
|
|
|
|
|
+ res->end = res->start;
|
|
|
|
+ res->flags = IORESOURCE_IO;
|
|
nport++;
|
|
nport++;
|
|
if (nport >= PNP_MAX_PORT)
|
|
if (nport >= PNP_MAX_PORT)
|
|
break;
|
|
break;
|
|
@@ -406,21 +404,18 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
|
|
buf += 3;
|
|
buf += 3;
|
|
while (isspace(*buf))
|
|
while (isspace(*buf))
|
|
++buf;
|
|
++buf;
|
|
- dev->res.mem_resource[nmem].start =
|
|
|
|
- simple_strtoul(buf, &buf, 0);
|
|
|
|
|
|
+ res = &dev->res.mem_resource[nmem];
|
|
|
|
+ res->start = simple_strtoul(buf, &buf, 0);
|
|
while (isspace(*buf))
|
|
while (isspace(*buf))
|
|
++buf;
|
|
++buf;
|
|
if (*buf == '-') {
|
|
if (*buf == '-') {
|
|
buf += 1;
|
|
buf += 1;
|
|
while (isspace(*buf))
|
|
while (isspace(*buf))
|
|
++buf;
|
|
++buf;
|
|
- dev->res.mem_resource[nmem].end =
|
|
|
|
- simple_strtoul(buf, &buf, 0);
|
|
|
|
|
|
+ res->end = simple_strtoul(buf, &buf, 0);
|
|
} else
|
|
} else
|
|
- dev->res.mem_resource[nmem].end =
|
|
|
|
- dev->res.mem_resource[nmem].start;
|
|
|
|
- dev->res.mem_resource[nmem].flags =
|
|
|
|
- IORESOURCE_MEM;
|
|
|
|
|
|
+ res->end = res->start;
|
|
|
|
+ res->flags = IORESOURCE_MEM;
|
|
nmem++;
|
|
nmem++;
|
|
if (nmem >= PNP_MAX_MEM)
|
|
if (nmem >= PNP_MAX_MEM)
|
|
break;
|
|
break;
|
|
@@ -430,11 +425,10 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
|
|
buf += 3;
|
|
buf += 3;
|
|
while (isspace(*buf))
|
|
while (isspace(*buf))
|
|
++buf;
|
|
++buf;
|
|
- dev->res.irq_resource[nirq].start =
|
|
|
|
- dev->res.irq_resource[nirq].end =
|
|
|
|
|
|
+ res = &dev->res.irq_resource[nirq];
|
|
|
|
+ res->start = res->end =
|
|
simple_strtoul(buf, &buf, 0);
|
|
simple_strtoul(buf, &buf, 0);
|
|
- dev->res.irq_resource[nirq].flags =
|
|
|
|
- IORESOURCE_IRQ;
|
|
|
|
|
|
+ res->flags = IORESOURCE_IRQ;
|
|
nirq++;
|
|
nirq++;
|
|
if (nirq >= PNP_MAX_IRQ)
|
|
if (nirq >= PNP_MAX_IRQ)
|
|
break;
|
|
break;
|
|
@@ -444,11 +438,10 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
|
|
buf += 3;
|
|
buf += 3;
|
|
while (isspace(*buf))
|
|
while (isspace(*buf))
|
|
++buf;
|
|
++buf;
|
|
- dev->res.dma_resource[ndma].start =
|
|
|
|
- dev->res.dma_resource[ndma].end =
|
|
|
|
|
|
+ res = &dev->res.dma_resource[ndma];
|
|
|
|
+ res->start = res->end =
|
|
simple_strtoul(buf, &buf, 0);
|
|
simple_strtoul(buf, &buf, 0);
|
|
- dev->res.dma_resource[ndma].flags =
|
|
|
|
- IORESOURCE_DMA;
|
|
|
|
|
|
+ res->flags = IORESOURCE_DMA;
|
|
ndma++;
|
|
ndma++;
|
|
if (ndma >= PNP_MAX_DMA)
|
|
if (ndma >= PNP_MAX_DMA)
|
|
break;
|
|
break;
|