Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46459
b: refs/heads/master
c: 5859554
h: refs/heads/master
i:
  46457: 77af673
  46455: f3ccb4a
v: v3
  • Loading branch information
Bjorn Helgaas authored and Len Brown committed Jan 26, 2007
1 parent 004969e commit 5f8aabb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a8c78f7fb1571764f48b8af5459abdd2c66a765f
refs/heads/master: 5859554c3ad31b722f0b5a1d3a40e19d8ccedd0b
32 changes: 11 additions & 21 deletions trunk/drivers/pnp/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ static void reserve_range(char *pnpid, int start, int end, int port)
char *regionid;

regionid = kmalloc(16, GFP_KERNEL);
if ( regionid == NULL )
if (regionid == NULL)
return;
snprintf(regionid, 16, "pnp %s", pnpid);
if (port)
res = request_region(start,end-start+1,regionid);
else
res = request_mem_region(start,end-start+1,regionid);
if ( res == NULL )
kfree( regionid );
if (res == NULL)
kfree(regionid);
else
res->flags &= ~IORESOURCE_BUSY;
/*
Expand All @@ -47,24 +47,18 @@ static void reserve_range(char *pnpid, int start, int end, int port)
printk(KERN_INFO
"pnp: %s: %s range 0x%x-0x%x %s reserved\n",
pnpid, port ? "ioport" : "iomem", start, end,
NULL != res ? "has been" : "could not be"
);

return;
NULL != res ? "has been" : "could not be");
}

static void reserve_resources_of_dev( struct pnp_dev *dev )
static void reserve_resources_of_dev(struct pnp_dev *dev)
{
int i;

for (i=0;i<PNP_MAX_PORT;i++) {
for (i = 0; i < PNP_MAX_PORT; i++) {
if (!pnp_port_valid(dev, i))
/* end of resources */
continue;
if (pnp_port_start(dev, i) == 0)
/* disabled */
/* Do nothing */
continue;
continue; /* disabled */
if (pnp_port_start(dev, i) < 0x100)
/*
* Below 0x100 is only standard PC hardware
Expand All @@ -76,14 +70,10 @@ static void reserve_resources_of_dev( struct pnp_dev *dev )
*/
continue;
if (pnp_port_end(dev, i) < pnp_port_start(dev, i))
/* invalid endpoint */
/* Do nothing */
continue;
reserve_range(
dev->dev.bus_id,
pnp_port_start(dev, i),
pnp_port_end(dev, i), 1
);
continue; /* invalid */

reserve_range(dev->dev.bus_id, pnp_port_start(dev, i),
pnp_port_end(dev, i), 1);
}

for (i = 0; i < PNP_MAX_MEM; i++) {
Expand Down

0 comments on commit 5f8aabb

Please sign in to comment.