Skip to contentSkip to conversation

acpi: Remove sysfs_create_link from video driver

PATCH In review Matthew Garrett 2 participants 2 messages Mar 28, 2011 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acpi: Remove sysfs_create_link from video driver

The acpi video driver attempts to explicitly create a sysfs link between the acpi device and the associated PCI device. However, we're now also doing this from the backlight core, which means that we get a backtrace caused by a duplicate file. Remove the code and leave it up to the backlight core.

---
 drivers/acpi/video.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
drivers/acpi/video.c +0 -6
index a18e497..31e9e10 100644
@@ -824,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)) {
@@ -1381,7 +1376,6 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
 		       "Cant remove video notify handler\n");
 	}
 	if (device->backlight) {
-		sysfs_remove_link(&device->backlight->dev.kobj, "device");
 		backlight_device_unregister(device->backlight);
 		device->backlight = NULL;
 	}
Signature · 1 line
1.7.4.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Matthew Garrett

The acpi video driver attempts to explicitly create a sysfs link between the acpi device and the associated PCI device. However, we're now also doing this from the backlight core, which means that we get a backtrace caused by a duplicate file. Remove the code and leave it up to the backlight core.

Quoted 29 lines
---
 drivers/acpi/video.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
drivers/acpi/video.c +0 -6
index a18e497..31e9e10 100644
@@ -824,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)) {
@@ -1381,7 +1376,6 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
 		       "Cant remove video notify handler\n");
 	}
 	if (device->backlight) {
-		sysfs_remove_link(&device->backlight->dev.kobj, "device");
 		backlight_device_unregister(device->backlight);
 		device->backlight = NULL;
 	}