Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp
[sfrench/cifs-2.6.git] / drivers / input / misc / atlas_btns.c
index dfaa9a045ed8a9378ad74030f0bc87dfd5dc8f2e..601f7372f9c47e7eb171f2449619f66a2a0d5713 100644 (file)
@@ -21,6 +21,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -60,12 +62,11 @@ static acpi_status acpi_atlas_button_handler(u32 function,
                input_report_key(input_dev, atlas_keymap[code], key_down);
                input_sync(input_dev);
 
-               status = 0;
+               status = AE_OK;
        } else {
-               printk(KERN_WARNING "atlas: shrugged on unexpected function"
-                       ":function=%x,address=%lx,value=%x\n",
+               pr_warn("shrugged on unexpected function: function=%x,address=%lx,value=%x\n",
                        function, (unsigned long)address, (u32)*value);
-               status = -EINVAL;
+               status = AE_BAD_PARAMETER;
        }
 
        return status;
@@ -79,7 +80,7 @@ static int atlas_acpi_button_add(struct acpi_device *device)
 
        input_dev = input_allocate_device();
        if (!input_dev) {
-               printk(KERN_ERR "atlas: unable to allocate input device\n");
+               pr_err("unable to allocate input device\n");
                return -ENOMEM;
        }
 
@@ -102,7 +103,7 @@ static int atlas_acpi_button_add(struct acpi_device *device)
 
        err = input_register_device(input_dev);
        if (err) {
-               printk(KERN_ERR "atlas: couldn't register input device\n");
+               pr_err("couldn't register input device\n");
                input_free_device(input_dev);
                return err;
        }
@@ -112,12 +113,12 @@ static int atlas_acpi_button_add(struct acpi_device *device)
                                0x81, &acpi_atlas_button_handler,
                                &acpi_atlas_button_setup, device);
        if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR "Atlas: Error installing addr spc handler\n");
+               pr_err("error installing addr spc handler\n");
                input_unregister_device(input_dev);
-               status = -EINVAL;
+               err = -EINVAL;
        }
 
-       return status;
+       return err;
 }
 
 static int atlas_acpi_button_remove(struct acpi_device *device, int type)
@@ -126,14 +127,12 @@ static int atlas_acpi_button_remove(struct acpi_device *device, int type)
 
        status = acpi_remove_address_space_handler(device->handle,
                                0x81, &acpi_atlas_button_handler);
-       if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR "Atlas: Error removing addr spc handler\n");
-               status = -EINVAL;
-       }
+       if (ACPI_FAILURE(status))
+               pr_err("error removing addr spc handler\n");
 
        input_unregister_device(input_dev);
 
-       return status;
+       return 0;
 }
 
 static const struct acpi_device_id atlas_device_ids[] = {
@@ -145,6 +144,7 @@ MODULE_DEVICE_TABLE(acpi, atlas_device_ids);
 static struct acpi_driver atlas_acpi_driver = {
        .name   = ACPI_ATLAS_NAME,
        .class  = ACPI_ATLAS_CLASS,
+       .owner  = THIS_MODULE,
        .ids    = atlas_device_ids,
        .ops    = {
                .add    = atlas_acpi_button_add,
@@ -154,18 +154,10 @@ static struct acpi_driver atlas_acpi_driver = {
 
 static int __init atlas_acpi_init(void)
 {
-       int result;
-
        if (acpi_disabled)
                return -ENODEV;
 
-       result = acpi_bus_register_driver(&atlas_acpi_driver);
-       if (result < 0) {
-               printk(KERN_ERR "Atlas ACPI: Unable to register driver\n");
-               return -ENODEV;
-       }
-
-       return 0;
+       return acpi_bus_register_driver(&atlas_acpi_driver);
 }
 
 static void __exit atlas_acpi_exit(void)