Re: [PATCH 2.6.17.4 1/1] ACPI,INPUT: Move atlas to input

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jaya,

On 7/25/06, jayakumar.acpi@xxxxxxxxx <jayakumar.acpi@xxxxxxxxx> wrote:
+static acpi_status acpi_atlas_button_handler(u32 function,
+                     acpi_physical_address address,
+                     u32 bit_width, acpi_integer *value,
+                     void *handler_context, void *region_context)
+{
+       acpi_status status;

Let's do:
     unsigned long addr = (unisigned long) address;

+
+       if (function == ACPI_WRITE)
+               atlas_input_report((u8) address);

     input_report_key(input_dev, KEY_F1 + (addr & 0x0f), !(addr & 0x10));

+       else {
+               printk(KERN_WARNING "atlas: shrugged on unexpected function"
+                       ":function=%x,address=%lx,value=%x\n",
+                       function, (unsigned long)address, (u32)*value);
      function, addr, (u32)*value);

[hmm, shouldn't it be *((u32*)value)?]

... and kill atlas_input_report. Now that the module is a pure input
driver you can fold some functions together.

+
+       return status;
+}
+
+static int atlas_acpi_button_add(struct acpi_device *device)
+{
+       int err;
+
+       err = atlas_setup_input();
+       if (err)
+               return err;
+
+       /* hookup button handler */
+       return acpi_install_address_space_handler(device->handle,
+                               0x81, &acpi_atlas_button_handler,
+                               &acpi_atlas_button_setup, device);
+}

This will leak input_dev if acpi_install_address_space_handler fails.
Please fold atlast_setup_input and atlast_acpi_button_add together
into one function (same goes for remove).

Thank you!

--
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux