aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pnp/system.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/drivers/pnp/system.c b/drivers/pnp/system.c
index fd17c7173c7b..2065e74bb63f 100644
--- a/drivers/pnp/system.c
+++ b/drivers/pnp/system.c
@@ -28,15 +28,15 @@ static void reserve_range(char *pnpid, int start, int end, int port)
28 char *regionid; 28 char *regionid;
29 29
30 regionid = kmalloc(16, GFP_KERNEL); 30 regionid = kmalloc(16, GFP_KERNEL);
31 if ( regionid == NULL ) 31 if (regionid == NULL)
32 return; 32 return;
33 snprintf(regionid, 16, "pnp %s", pnpid); 33 snprintf(regionid, 16, "pnp %s", pnpid);
34 if (port) 34 if (port)
35 res = request_region(start,end-start+1,regionid); 35 res = request_region(start,end-start+1,regionid);
36 else 36 else
37 res = request_mem_region(start,end-start+1,regionid); 37 res = request_mem_region(start,end-start+1,regionid);
38 if ( res == NULL ) 38 if (res == NULL)
39 kfree( regionid ); 39 kfree(regionid);
40 else 40 else
41 res->flags &= ~IORESOURCE_BUSY; 41 res->flags &= ~IORESOURCE_BUSY;
42 /* 42 /*
@@ -47,24 +47,18 @@ static void reserve_range(char *pnpid, int start, int end, int port)
47 printk(KERN_INFO 47 printk(KERN_INFO
48 "pnp: %s: %s range 0x%x-0x%x %s reserved\n", 48 "pnp: %s: %s range 0x%x-0x%x %s reserved\n",
49 pnpid, port ? "ioport" : "iomem", start, end, 49 pnpid, port ? "ioport" : "iomem", start, end,
50 NULL != res ? "has been" : "could not be" 50 NULL != res ? "has been" : "could not be");
51 );
52
53 return;
54} 51}
55 52
56static void reserve_resources_of_dev( struct pnp_dev *dev ) 53static void reserve_resources_of_dev(struct pnp_dev *dev)
57{ 54{
58 int i; 55 int i;
59 56
60 for (i=0;i<PNP_MAX_PORT;i++) { 57 for (i = 0; i < PNP_MAX_PORT; i++) {
61 if (!pnp_port_valid(dev, i)) 58 if (!pnp_port_valid(dev, i))
62 /* end of resources */
63 continue; 59 continue;
64 if (pnp_port_start(dev, i) == 0) 60 if (pnp_port_start(dev, i) == 0)
65 /* disabled */ 61 continue; /* disabled */
66 /* Do nothing */
67 continue;
68 if (pnp_port_start(dev, i) < 0x100) 62 if (pnp_port_start(dev, i) < 0x100)
69 /* 63 /*
70 * Below 0x100 is only standard PC hardware 64 * Below 0x100 is only standard PC hardware
@@ -76,14 +70,10 @@ static void reserve_resources_of_dev( struct pnp_dev *dev )
76 */ 70 */
77 continue; 71 continue;
78 if (pnp_port_end(dev, i) < pnp_port_start(dev, i)) 72 if (pnp_port_end(dev, i) < pnp_port_start(dev, i))
79 /* invalid endpoint */ 73 continue; /* invalid */
80 /* Do nothing */ 74
81 continue; 75 reserve_range(dev->dev.bus_id, pnp_port_start(dev, i),
82 reserve_range( 76 pnp_port_end(dev, i), 1);
83 dev->dev.bus_id,
84 pnp_port_start(dev, i),
85 pnp_port_end(dev, i), 1
86 );
87 } 77 }
88 78
89 for (i = 0; i < PNP_MAX_MEM; i++) { 79 for (i = 0; i < PNP_MAX_MEM; i++) {