aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/pnpacpi/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp/pnpacpi/core.c')
-rw-r--r--drivers/pnp/pnpacpi/core.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
index 8655dd2e5b83..d3d292ea5876 100644
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -41,14 +41,6 @@ static inline int is_exclusive_device(struct acpi_device *dev)
41 return (!acpi_match_ids(dev, excluded_id_list)); 41 return (!acpi_match_ids(dev, excluded_id_list));
42} 42}
43 43
44void *pnpacpi_kmalloc(size_t size, int f)
45{
46 void *p = kmalloc(size, f);
47 if (p)
48 memset(p, 0, size);
49 return p;
50}
51
52/* 44/*
53 * Compatible Device IDs 45 * Compatible Device IDs
54 */ 46 */
@@ -143,7 +135,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
143 return 0; 135 return 0;
144 136
145 pnp_dbg("ACPI device : hid %s", acpi_device_hid(device)); 137 pnp_dbg("ACPI device : hid %s", acpi_device_hid(device));
146 dev = pnpacpi_kmalloc(sizeof(struct pnp_dev), GFP_KERNEL); 138 dev = kcalloc(1, sizeof(struct pnp_dev), GFP_KERNEL);
147 if (!dev) { 139 if (!dev) {
148 pnp_err("Out of memory"); 140 pnp_err("Out of memory");
149 return -ENOMEM; 141 return -ENOMEM;
@@ -173,7 +165,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
173 dev->number = num; 165 dev->number = num;
174 166
175 /* set the initial values for the PnP device */ 167 /* set the initial values for the PnP device */
176 dev_id = pnpacpi_kmalloc(sizeof(struct pnp_id), GFP_KERNEL); 168 dev_id = kcalloc(1, sizeof(struct pnp_id), GFP_KERNEL);
177 if (!dev_id) 169 if (!dev_id)
178 goto err; 170 goto err;
179 pnpidacpi_to_pnpid(acpi_device_hid(device), dev_id->id); 171 pnpidacpi_to_pnpid(acpi_device_hid(device), dev_id->id);
@@ -205,8 +197,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
205 for (i = 0; i < cid_list->count; i++) { 197 for (i = 0; i < cid_list->count; i++) {
206 if (!ispnpidacpi(cid_list->id[i].value)) 198 if (!ispnpidacpi(cid_list->id[i].value))
207 continue; 199 continue;
208 dev_id = pnpacpi_kmalloc(sizeof(struct pnp_id), 200 dev_id = kcalloc(1, sizeof(struct pnp_id), GFP_KERNEL);
209 GFP_KERNEL);
210 if (!dev_id) 201 if (!dev_id)
211 continue; 202 continue;
212 203