Skip to content

Commit

Permalink
fujitsu-laptop: fingers off backlight if video.ko is serving this fun…
Browse files Browse the repository at this point in the history
…ctionality

Signed-off-by: Thomas Renninger <trenn@suse.de>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Thomas Renninger authored and Len Brown committed Nov 8, 2008
1 parent a2bf8c0 commit 7d5c89a
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions drivers/misc/fujitsu-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -990,16 +990,16 @@ static int __init fujitsu_init(void)

/* Register backlight stuff */

fujitsu->bl_device =
backlight_device_register("fujitsu-laptop", NULL, NULL,
&fujitsubl_ops);
if (IS_ERR(fujitsu->bl_device))
return PTR_ERR(fujitsu->bl_device);

max_brightness = fujitsu->max_brightness;

fujitsu->bl_device->props.max_brightness = max_brightness - 1;
fujitsu->bl_device->props.brightness = fujitsu->brightness_level;
if (!acpi_video_backlight_support()) {
fujitsu->bl_device =
backlight_device_register("fujitsu-laptop", NULL, NULL,
&fujitsubl_ops);
if (IS_ERR(fujitsu->bl_device))
return PTR_ERR(fujitsu->bl_device);
max_brightness = fujitsu->max_brightness;
fujitsu->bl_device->props.max_brightness = max_brightness - 1;
fujitsu->bl_device->props.brightness = fujitsu->brightness_level;
}

ret = platform_driver_register(&fujitsupf_driver);
if (ret)
Expand Down Expand Up @@ -1035,7 +1035,8 @@ static int __init fujitsu_init(void)

fail_backlight:

backlight_device_unregister(fujitsu->bl_device);
if (fujitsu->bl_device)
backlight_device_unregister(fujitsu->bl_device);

fail_platform_device2:

Expand All @@ -1062,7 +1063,8 @@ static void __exit fujitsu_cleanup(void)
&fujitsupf_attribute_group);
platform_device_unregister(fujitsu->pf_device);
platform_driver_unregister(&fujitsupf_driver);
backlight_device_unregister(fujitsu->bl_device);
if (fujitsu->bl_device)
backlight_device_unregister(fujitsu->bl_device);

acpi_bus_unregister_driver(&acpi_fujitsu_driver);

Expand Down

0 comments on commit 7d5c89a

Please sign in to comment.