]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/acpi/video.c
Merge git://git.infradead.org/mtd-2.6
[mv-sheeva.git] / drivers / acpi / video.c
index a9eec8c95a1f6ddd411d454b3e9afd7877df9ebb..ec574fc8fbc6028089eea27ab90695c4accf794c 100644 (file)
@@ -782,6 +782,9 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
 
        if (acpi_video_backlight_support()) {
                struct backlight_properties props;
+               struct pci_dev *pdev;
+               acpi_handle acpi_parent;
+               struct device *parent = NULL;
                int result;
                static int count = 0;
                char *name;
@@ -794,10 +797,20 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
                        return;
                count++;
 
+               acpi_get_parent(device->dev->handle, &acpi_parent);
+
+               pdev = acpi_get_pci_dev(acpi_parent);
+               if (pdev) {
+                       parent = &pdev->dev;
+                       pci_dev_put(pdev);
+               }
+
                memset(&props, 0, sizeof(struct backlight_properties));
                props.type = BACKLIGHT_FIRMWARE;
                props.max_brightness = device->brightness->count - 3;
-               device->backlight = backlight_device_register(name, NULL, device,
+               device->backlight = backlight_device_register(name,
+                                                             parent,
+                                                             device,
                                                              &acpi_backlight_ops,
                                                              &props);
                kfree(name);
@@ -811,11 +824,6 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
                device->backlight->props.brightness =
                                acpi_video_get_brightness(device->backlight);
 
-               result = sysfs_create_link(&device->backlight->dev.kobj,
-                                          &device->dev->dev.kobj, "device");
-               if (result)
-                       printk(KERN_ERR PREFIX "Create sysfs link\n");
-
                device->cooling_dev = thermal_cooling_device_register("LCD",
                                        device->dev, &video_cooling_ops);
                if (IS_ERR(device->cooling_dev)) {
@@ -1346,7 +1354,7 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
                status = acpi_video_bus_get_one_device(dev, video);
                if (ACPI_FAILURE(status)) {
                        printk(KERN_WARNING PREFIX
-                                       "Cant attach device\n");
+                                       "Can't attach device\n");
                        continue;
                }
        }
@@ -1365,10 +1373,9 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
                                            acpi_video_device_notify);
        if (ACPI_FAILURE(status)) {
                printk(KERN_WARNING PREFIX
-                      "Cant remove video notify handler\n");
+                      "Can't remove video notify handler\n");
        }
        if (device->backlight) {
-               sysfs_remove_link(&device->backlight->dev.kobj, "device");
                backlight_device_unregister(device->backlight);
                device->backlight = NULL;
        }