V4L/DVB (9043): S5H1420: Fix size of shadow-array to avoid overflow
[safe/jmp/linux-2.6] / drivers / acpi / toshiba_acpi.c
index 0208d3a..0a43c8e 100644 (file)
@@ -99,6 +99,13 @@ MODULE_LICENSE("GPL");
 #define HCI_VIDEO_OUT_CRT              0x2
 #define HCI_VIDEO_OUT_TV               0x4
 
+static const struct acpi_device_id toshiba_device_ids[] = {
+       {"TOS6200", 0},
+       {"TOS1900", 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, toshiba_device_ids);
+
 /* utility
  */
 
@@ -315,7 +322,7 @@ static int set_lcd(int value)
 
 static int set_lcd_status(struct backlight_device *bd)
 {
-       return set_lcd(bd->props->brightness);
+       return set_lcd(bd->props.brightness);
 }
 
 static unsigned long write_lcd(const char *buffer, unsigned long count)
@@ -362,7 +369,7 @@ static unsigned long write_video(const char *buffer, unsigned long count)
        int crt_out = -1;
        int tv_out = -1;
        u32 hci_result;
-       int video_out;
+       u32 video_out;
 
        /* scan expression.  Multiple expressions may be delimited with ;
         *
@@ -524,7 +531,7 @@ static acpi_status __init add_device(void)
        return AE_OK;
 }
 
-static acpi_status __exit remove_device(void)
+static acpi_status remove_device(void)
 {
        ProcItem *item;
 
@@ -533,14 +540,12 @@ static acpi_status __exit remove_device(void)
        return AE_OK;
 }
 
-static struct backlight_properties toshiba_backlight_data = {
-        .owner          = THIS_MODULE,
+static struct backlight_ops toshiba_backlight_data = {
         .get_brightness = get_lcd,
         .update_status  = set_lcd_status,
-        .max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1,
 };
 
-static void __exit toshiba_acpi_exit(void)
+static void toshiba_acpi_exit(void)
 {
        if (toshiba_backlight_device)
                backlight_device_unregister(toshiba_backlight_device);
@@ -561,10 +566,6 @@ static int __init toshiba_acpi_init(void)
        if (acpi_disabled)
                return -ENODEV;
 
-       if (!acpi_specific_hotkey_enabled) {
-               printk(MY_INFO "Using generic hotkey driver\n");
-               return -ENODEV;
-       }
        /* simple device detection: look for HCI method */
        if (is_valid_acpi_path(METHOD_HCI_1))
                method_hci = METHOD_HCI_1;
@@ -597,10 +598,14 @@ static int __init toshiba_acpi_init(void)
                                                NULL,
                                                &toshiba_backlight_data);
         if (IS_ERR(toshiba_backlight_device)) {
+               int ret = PTR_ERR(toshiba_backlight_device);
+
                printk(KERN_ERR "Could not register toshiba backlight device\n");
                toshiba_backlight_device = NULL;
                toshiba_acpi_exit();
+               return ret;
        }
+        toshiba_backlight_device->props.max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1;
 
        return (ACPI_SUCCESS(status)) ? 0 : -ENODEV;
 }