diff options
Diffstat (limited to 'drivers/pnp/system.c')
-rw-r--r-- | drivers/pnp/system.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/drivers/pnp/system.c b/drivers/pnp/system.c index a8a95540b1ef..a06f980b3ac9 100644 --- a/drivers/pnp/system.c +++ b/drivers/pnp/system.c | |||
@@ -16,13 +16,14 @@ | |||
16 | 16 | ||
17 | static const struct pnp_device_id pnp_dev_table[] = { | 17 | static const struct pnp_device_id pnp_dev_table[] = { |
18 | /* General ID for reserving resources */ | 18 | /* General ID for reserving resources */ |
19 | { "PNP0c02", 0 }, | 19 | {"PNP0c02", 0}, |
20 | /* memory controller */ | 20 | /* memory controller */ |
21 | { "PNP0c01", 0 }, | 21 | {"PNP0c01", 0}, |
22 | { "", 0 } | 22 | {"", 0} |
23 | }; | 23 | }; |
24 | 24 | ||
25 | static void reserve_range(const char *pnpid, resource_size_t start, resource_size_t end, int port) | 25 | static void reserve_range(const char *pnpid, resource_size_t start, |
26 | resource_size_t end, int port) | ||
26 | { | 27 | { |
27 | struct resource *res; | 28 | struct resource *res; |
28 | char *regionid; | 29 | char *regionid; |
@@ -32,9 +33,9 @@ static void reserve_range(const char *pnpid, resource_size_t start, resource_siz | |||
32 | return; | 33 | return; |
33 | snprintf(regionid, 16, "pnp %s", pnpid); | 34 | snprintf(regionid, 16, "pnp %s", pnpid); |
34 | if (port) | 35 | if (port) |
35 | res = request_region(start, end-start+1, regionid); | 36 | res = request_region(start, end - start + 1, regionid); |
36 | else | 37 | else |
37 | res = request_mem_region(start, end-start+1, regionid); | 38 | res = request_mem_region(start, end - start + 1, regionid); |
38 | if (res == NULL) | 39 | if (res == NULL) |
39 | kfree(regionid); | 40 | kfree(regionid); |
40 | else | 41 | else |
@@ -44,11 +45,10 @@ static void reserve_range(const char *pnpid, resource_size_t start, resource_siz | |||
44 | * example do reserve stuff they know about too, so we may well | 45 | * example do reserve stuff they know about too, so we may well |
45 | * have double reservations. | 46 | * have double reservations. |
46 | */ | 47 | */ |
47 | printk(KERN_INFO | 48 | printk(KERN_INFO "pnp: %s: %s range 0x%llx-0x%llx %s reserved\n", |
48 | "pnp: %s: %s range 0x%llx-0x%llx %s reserved\n", | 49 | pnpid, port ? "ioport" : "iomem", |
49 | pnpid, port ? "ioport" : "iomem", | 50 | (unsigned long long)start, (unsigned long long)end, |
50 | (unsigned long long)start, (unsigned long long)end, | 51 | NULL != res ? "has been" : "could not be"); |
51 | NULL != res ? "has been" : "could not be"); | ||
52 | } | 52 | } |
53 | 53 | ||
54 | static void reserve_resources_of_dev(const struct pnp_dev *dev) | 54 | static void reserve_resources_of_dev(const struct pnp_dev *dev) |
@@ -74,7 +74,7 @@ static void reserve_resources_of_dev(const struct pnp_dev *dev) | |||
74 | continue; /* invalid */ | 74 | continue; /* invalid */ |
75 | 75 | ||
76 | reserve_range(dev->dev.bus_id, pnp_port_start(dev, i), | 76 | reserve_range(dev->dev.bus_id, pnp_port_start(dev, i), |
77 | pnp_port_end(dev, i), 1); | 77 | pnp_port_end(dev, i), 1); |
78 | } | 78 | } |
79 | 79 | ||
80 | for (i = 0; i < PNP_MAX_MEM; i++) { | 80 | for (i = 0; i < PNP_MAX_MEM; i++) { |
@@ -82,24 +82,22 @@ static void reserve_resources_of_dev(const struct pnp_dev *dev) | |||
82 | continue; | 82 | continue; |
83 | 83 | ||
84 | reserve_range(dev->dev.bus_id, pnp_mem_start(dev, i), | 84 | reserve_range(dev->dev.bus_id, pnp_mem_start(dev, i), |
85 | pnp_mem_end(dev, i), 0); | 85 | pnp_mem_end(dev, i), 0); |
86 | } | 86 | } |
87 | |||
88 | return; | ||
89 | } | 87 | } |
90 | 88 | ||
91 | static int system_pnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id) | 89 | static int system_pnp_probe(struct pnp_dev *dev, |
90 | const struct pnp_device_id *dev_id) | ||
92 | { | 91 | { |
93 | reserve_resources_of_dev(dev); | 92 | reserve_resources_of_dev(dev); |
94 | return 0; | 93 | return 0; |
95 | } | 94 | } |
96 | 95 | ||
97 | static struct pnp_driver system_pnp_driver = { | 96 | static struct pnp_driver system_pnp_driver = { |
98 | .name = "system", | 97 | .name = "system", |
99 | .id_table = pnp_dev_table, | 98 | .id_table = pnp_dev_table, |
100 | .flags = PNP_DRIVER_RES_DO_NOT_CHANGE, | 99 | .flags = PNP_DRIVER_RES_DO_NOT_CHANGE, |
101 | .probe = system_pnp_probe, | 100 | .probe = system_pnp_probe, |
102 | .remove = NULL, | ||
103 | }; | 101 | }; |
104 | 102 | ||
105 | static int __init pnp_system_init(void) | 103 | static int __init pnp_system_init(void) |