Merge ../linus
[linux-drm-fsl-dcu.git] / drivers / char / sonypi.c
index a90f5d97df35dc8c262145efe0187085a6bd2009..17d54e1331b2ea61475534e8b294cd6e2ebb7e3d 100644 (file)
@@ -33,7 +33,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/input.h>
 #include <linux/pci.h>
@@ -512,7 +511,7 @@ static struct sonypi_device {
 
 #ifdef CONFIG_ACPI
 static struct acpi_device *sonypi_acpi_device;
-static int acpi_enabled;
+static int acpi_driver_registered;
 #endif
 
 static int sonypi_ec_write(u8 addr, u8 value)
@@ -766,7 +765,7 @@ static void sonypi_setbluetoothpower(u8 state)
        sonypi_device.bluetooth_power = state;
 }
 
-static void input_keyrelease(void *data)
+static void input_keyrelease(struct work_struct *work)
 {
        struct sonypi_keypress kp;
 
@@ -827,7 +826,7 @@ static void sonypi_report_input_event(u8 event)
 }
 
 /* Interrupt handler: some event is available */
-static irqreturn_t sonypi_irq(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t sonypi_irq(int irq, void *dev_id)
 {
        u8 v1, v2, event = 0;
        int i, j;
@@ -869,7 +868,7 @@ found:
                sonypi_report_input_event(event);
 
 #ifdef CONFIG_ACPI
-       if (acpi_enabled)
+       if (sonypi_acpi_device)
                acpi_bus_generate_event(sonypi_acpi_device, 1, event);
 #endif
 
@@ -980,7 +979,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf,
        }
 
        if (ret > 0) {
-               struct inode *inode = file->f_dentry->d_inode;
+               struct inode *inode = file->f_path.dentry->d_inode;
                inode->i_atime = current_fs_time(inode->i_sb);
        }
 
@@ -1107,7 +1106,7 @@ static int sonypi_misc_ioctl(struct inode *ip, struct file *fp,
        return ret;
 }
 
-static struct file_operations sonypi_misc_fops = {
+static const struct file_operations sonypi_misc_fops = {
        .owner          = THIS_MODULE,
        .read           = sonypi_misc_read,
        .poll           = sonypi_misc_poll,
@@ -1283,7 +1282,7 @@ static int __devinit sonypi_setup_irq(struct sonypi_device *dev,
        while (irq_list->irq) {
 
                if (!request_irq(irq_list->irq, sonypi_irq,
-                                SA_SHIRQ, "sonypi", sonypi_irq)) {
+                                IRQF_SHARED, "sonypi", sonypi_irq)) {
                        dev->irq = irq_list->irq;
                        dev->bits = irq_list->bits;
                        return 0;
@@ -1413,7 +1412,7 @@ static int __devinit sonypi_probe(struct platform_device *dev)
                        goto err_inpdev_unregister;
                }
 
-               INIT_WORK(&sonypi_device.input_work, input_keyrelease, NULL);
+               INIT_WORK(&sonypi_device.input_work, input_keyrelease);
        }
 
        sonypi_enable(0);
@@ -1551,8 +1550,8 @@ static int __init sonypi_init(void)
                goto err_free_device;
 
 #ifdef CONFIG_ACPI
-       if (acpi_bus_register_driver(&sonypi_acpi_driver) > 0)
-               acpi_enabled = 1;
+       if (acpi_bus_register_driver(&sonypi_acpi_driver) >= 0)
+               acpi_driver_registered = 1;
 #endif
 
        return 0;
@@ -1567,7 +1566,7 @@ static int __init sonypi_init(void)
 static void __exit sonypi_exit(void)
 {
 #ifdef CONFIG_ACPI
-       if (acpi_enabled)
+       if (acpi_driver_registered)
                acpi_bus_unregister_driver(&sonypi_acpi_driver);
 #endif
        platform_device_unregister(sonypi_platform_device);