aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/ec.c
diff options
context:
space:
mode:
authorBurman Yan <yan_952@hotmail.com>2006-12-19 15:56:11 -0500
committerLen Brown <len.brown@intel.com>2006-12-20 16:54:54 -0500
commit36bcbec7ce21e2e8b3143b11a05747330abeca70 (patch)
treed9ace4d83a5013dbb3cd599e7bc4358ce4cdb980 /drivers/acpi/ec.c
parent5b7b4119553dd7cc0bc200c0d1b1598e158eec9a (diff)
ACPI: replace kmalloc+memset with kzalloc
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/ec.c')
-rw-r--r--drivers/acpi/ec.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 08c12588af69..9c52d87d6f04 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -624,10 +624,9 @@ static int acpi_ec_add(struct acpi_device *device)
624 if (!device) 624 if (!device)
625 return -EINVAL; 625 return -EINVAL;
626 626
627 ec = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL); 627 ec = kzalloc(sizeof(struct acpi_ec), GFP_KERNEL);
628 if (!ec) 628 if (!ec)
629 return -ENOMEM; 629 return -ENOMEM;
630 memset(ec, 0, sizeof(struct acpi_ec));
631 630
632 ec->handle = device->handle; 631 ec->handle = device->handle;
633 ec->uid = -1; 632 ec->uid = -1;
@@ -848,12 +847,11 @@ static int __init acpi_ec_fake_ecdt(void)
848 847
849 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Try to make an fake ECDT")); 848 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Try to make an fake ECDT"));
850 849
851 ec_ecdt = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL); 850 ec_ecdt = kzalloc(sizeof(struct acpi_ec), GFP_KERNEL);
852 if (!ec_ecdt) { 851 if (!ec_ecdt) {
853 ret = -ENOMEM; 852 ret = -ENOMEM;
854 goto error; 853 goto error;
855 } 854 }
856 memset(ec_ecdt, 0, sizeof(struct acpi_ec));
857 855
858 status = acpi_get_devices(ACPI_EC_HID, 856 status = acpi_get_devices(ACPI_EC_HID,
859 acpi_fake_ecdt_callback, NULL, NULL); 857 acpi_fake_ecdt_callback, NULL, NULL);
@@ -885,10 +883,9 @@ static int __init acpi_ec_get_real_ecdt(void)
885 /* 883 /*
886 * Generate a temporary ec context to use until the namespace is scanned 884 * Generate a temporary ec context to use until the namespace is scanned
887 */ 885 */
888 ec_ecdt = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL); 886 ec_ecdt = kzalloc(sizeof(struct acpi_ec), GFP_KERNEL);
889 if (!ec_ecdt) 887 if (!ec_ecdt)
890 return -ENOMEM; 888 return -ENOMEM;
891 memset(ec_ecdt, 0, sizeof(struct acpi_ec));
892 889
893 mutex_init(&ec_ecdt->lock); 890 mutex_init(&ec_ecdt->lock);
894 if (acpi_ec_mode == EC_INTR) { 891 if (acpi_ec_mode == EC_INTR) {