diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2005-09-06 15:16:51 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 16:57:21 -0700 |
commit | a2822e7f00cdccbff8e507b5ebbddce1aa95eb5d (patch) | |
tree | 07ac5760bb7771744daa59b759c34190fb39f3ae /drivers/pnp/pnpbios/core.c | |
parent | ea2f1590aaffbd02f1850c19c3895ff4d092c6e0 (diff) |
[PATCH] pnp: consolidate kmalloc wrappers
ISAPNP, PNPBIOS, and PNPACPI all had their own kmalloc wrappers that
reimplemented kcalloc(). Remove the wrappers and just use kcalloc()
directly.
Note that this also removes the PNPBIOS error message when the kmalloc
fails.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/pnp/pnpbios/core.c')
-rw-r--r-- | drivers/pnp/pnpbios/core.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c index 778a324028f..f49674f0794 100644 --- a/drivers/pnp/pnpbios/core.c +++ b/drivers/pnp/pnpbios/core.c @@ -86,16 +86,6 @@ int pnp_bios_present(void) struct pnp_dev_node_info node_info; -void *pnpbios_kmalloc(size_t size, int f) -{ - void *p = kmalloc( size, f ); - if ( p == NULL ) - printk(KERN_ERR "PnPBIOS: kmalloc() failed\n"); - else - memset(p, 0, size); - return p; -} - /* * * DOCKING FUNCTIONS @@ -121,10 +111,10 @@ static int pnp_dock_event(int dock, struct pnp_docking_station_info *info) if (!current->fs->root) { return -EAGAIN; } - if (!(envp = (char **) pnpbios_kmalloc (20 * sizeof (char *), GFP_KERNEL))) { + if (!(envp = (char **) kcalloc (20, sizeof (char *), GFP_KERNEL))) { return -ENOMEM; } - if (!(buf = pnpbios_kmalloc (256, GFP_KERNEL))) { + if (!(buf = kcalloc (1, 256, GFP_KERNEL))) { kfree (envp); return -ENOMEM; } @@ -231,7 +221,7 @@ static int pnpbios_get_resources(struct pnp_dev * dev, struct pnp_resource_table if(!pnpbios_is_dynamic(dev)) return -EPERM; - node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL); + node = kcalloc(1, node_info.max_node_size, GFP_KERNEL); if (!node) return -1; if (pnp_bios_get_dev_node(&nodenum, (char )PNPMODE_DYNAMIC, node)) { @@ -254,7 +244,7 @@ static int pnpbios_set_resources(struct pnp_dev * dev, struct pnp_resource_table if (!pnpbios_is_dynamic(dev)) return -EPERM; - node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL); + node = kcalloc(1, node_info.max_node_size, GFP_KERNEL); if (!node) return -1; if (pnp_bios_get_dev_node(&nodenum, (char )PNPMODE_DYNAMIC, node)) { @@ -305,7 +295,7 @@ static int pnpbios_disable_resources(struct pnp_dev *dev) if(dev->flags & PNPBIOS_NO_DISABLE || !pnpbios_is_dynamic(dev)) return -EPERM; - node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL); + node = kcalloc(1, node_info.max_node_size, GFP_KERNEL); if (!node) return -ENOMEM; @@ -347,7 +337,7 @@ static int insert_device(struct pnp_dev *dev, struct pnp_bios_node * node) } /* set the initial values for the PnP device */ - dev_id = pnpbios_kmalloc(sizeof(struct pnp_id), GFP_KERNEL); + dev_id = kcalloc(1, sizeof(struct pnp_id), GFP_KERNEL); if (!dev_id) return -1; pnpid32_to_pnpid(node->eisa_id,id); @@ -385,7 +375,7 @@ static void __init build_devlist(void) struct pnp_bios_node *node; struct pnp_dev *dev; - node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL); + node = kcalloc(1, node_info.max_node_size, GFP_KERNEL); if (!node) return; @@ -402,7 +392,7 @@ static void __init build_devlist(void) break; } nodes_got++; - dev = pnpbios_kmalloc(sizeof (struct pnp_dev), GFP_KERNEL); + dev = kcalloc(1, sizeof (struct pnp_dev), GFP_KERNEL); if (!dev) break; if(insert_device(dev,node)<0) |