aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/system.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2007-10-17 02:31:11 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 11:43:04 -0400
commitb933e19d32edce2f310dfe0fd943e32ff9798b60 (patch)
tree9a29184d00288546a6886e86601246a0f1d66a02 /drivers/pnp/system.c
parenta05d0781695566296e74a3670dd5bbd3daf24ae2 (diff)
PNP: use dev_info() in system driver
Use dev_info() for a little consistency. Changes this: pnp: 00:01: ioport range 0xf50-0xf58 has been reserved pnp: 00:01: ioport range 0x408-0x40f has been reserved pnp: 00:01: ioport range 0x900-0x903 has been reserved to this: system 00:01: ioport range 0xf50-0xf58 has been reserved system 00:01: ioport range 0x408-0x40f has been reserved system 00:01: ioport range 0x900-0x903 has been reserved Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Adam Belay <ambx1@neo.rr.com> Cc: Len Brown <lenb@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/pnp/system.c')
-rw-r--r--drivers/pnp/system.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/pnp/system.c b/drivers/pnp/system.c
index a06f980b3ac9..55c4563986b3 100644
--- a/drivers/pnp/system.c
+++ b/drivers/pnp/system.c
@@ -22,36 +22,39 @@ static const struct pnp_device_id pnp_dev_table[] = {
22 {"", 0} 22 {"", 0}
23}; 23};
24 24
25static void reserve_range(const char *pnpid, resource_size_t start, 25static void reserve_range(struct pnp_dev *dev, resource_size_t start,
26 resource_size_t end, int port) 26 resource_size_t end, int port)
27{ 27{
28 struct resource *res;
29 char *regionid; 28 char *regionid;
29 const char *pnpid = dev->dev.bus_id;
30 struct resource *res;
30 31
31 regionid = kmalloc(16, GFP_KERNEL); 32 regionid = kmalloc(16, GFP_KERNEL);
32 if (regionid == NULL) 33 if (!regionid)
33 return; 34 return;
35
34 snprintf(regionid, 16, "pnp %s", pnpid); 36 snprintf(regionid, 16, "pnp %s", pnpid);
35 if (port) 37 if (port)
36 res = request_region(start, end - start + 1, regionid); 38 res = request_region(start, end - start + 1, regionid);
37 else 39 else
38 res = request_mem_region(start, end - start + 1, regionid); 40 res = request_mem_region(start, end - start + 1, regionid);
39 if (res == NULL) 41 if (res)
40 kfree(regionid);
41 else
42 res->flags &= ~IORESOURCE_BUSY; 42 res->flags &= ~IORESOURCE_BUSY;
43 else
44 kfree(regionid);
45
43 /* 46 /*
44 * Failures at this point are usually harmless. pci quirks for 47 * Failures at this point are usually harmless. pci quirks for
45 * example do reserve stuff they know about too, so we may well 48 * example do reserve stuff they know about too, so we may well
46 * have double reservations. 49 * have double reservations.
47 */ 50 */
48 printk(KERN_INFO "pnp: %s: %s range 0x%llx-0x%llx %s reserved\n", 51 dev_info(&dev->dev, "%s range 0x%llx-0x%llx %s reserved\n",
49 pnpid, port ? "ioport" : "iomem", 52 port ? "ioport" : "iomem",
50 (unsigned long long)start, (unsigned long long)end, 53 (unsigned long long) start, (unsigned long long) end,
51 NULL != res ? "has been" : "could not be"); 54 res ? "has been" : "could not be");
52} 55}
53 56
54static void reserve_resources_of_dev(const struct pnp_dev *dev) 57static void reserve_resources_of_dev(struct pnp_dev *dev)
55{ 58{
56 int i; 59 int i;
57 60
@@ -73,7 +76,7 @@ static void reserve_resources_of_dev(const struct pnp_dev *dev)
73 if (pnp_port_end(dev, i) < pnp_port_start(dev, i)) 76 if (pnp_port_end(dev, i) < pnp_port_start(dev, i))
74 continue; /* invalid */ 77 continue; /* invalid */
75 78
76 reserve_range(dev->dev.bus_id, pnp_port_start(dev, i), 79 reserve_range(dev, pnp_port_start(dev, i),
77 pnp_port_end(dev, i), 1); 80 pnp_port_end(dev, i), 1);
78 } 81 }
79 82
@@ -81,7 +84,7 @@ static void reserve_resources_of_dev(const struct pnp_dev *dev)
81 if (!pnp_mem_valid(dev, i)) 84 if (!pnp_mem_valid(dev, i))
82 continue; 85 continue;
83 86
84 reserve_range(dev->dev.bus_id, pnp_mem_start(dev, i), 87 reserve_range(dev, pnp_mem_start(dev, i),
85 pnp_mem_end(dev, i), 0); 88 pnp_mem_end(dev, i), 0);
86 } 89 }
87} 90}