Permalink
Browse files

Fix driver to work with newer kernel versions

A recent Fedora kernel update (v2.6.34.6-47.fc13) broke your
samsung-backlight module due to an extra argument being added; I
managed to fix it with the attached patch.

As many Fedora HOW-TO sites list your GitHub repo as a resource, I
think it would be beneficial to share it and perhaps push it to said
repo. I've tested it on my machines (plural).
  • Loading branch information...
1 parent cb0feb7 commit 5b4e3ed757677a81cf9e83e542755d9204bd26bc Ben Arnold committed with Sep 2, 2010
Showing with 4 additions and 1 deletion.
  1. +4 −1 samsung-backlight.c
View
@@ -127,6 +127,9 @@ static struct dmi_system_id __initdata samsung_dmi_table[] = {
static int __init samsung_init(void)
{
+ struct backlight_properties props;
+ memset(&props, 0, sizeof(struct backlight_properties));
+
if (!dmi_check_system(samsung_dmi_table))
return -ENODEV;
@@ -145,7 +148,7 @@ static int __init samsung_init(void)
/* create a backlight device to talk to this one */
backlight_device = backlight_device_register("samsung",
&pci_device->dev,
- NULL, &backlight_ops);
+ NULL, &backlight_ops, &props);
if (IS_ERR(backlight_device)) {
pci_dev_put(pci_device);
return PTR_ERR(backlight_device);

5 comments on commit 5b4e3ed

This patch unfortunately breaks older kernels. Reverted it locally to be able to build the module on Debian Squeeze.

Owner

gregkh replied Sep 15, 2010

Of course, it is needed for newer kernels, that's the point :)

:-) I was kinda hoping that given people compile this on there distro/kernel of choice that it could be made a bit smarter..

Owner

gregkh replied Sep 15, 2010

Don't build this for any distro, use the in-kernel samsung-laptop driver instead and get a bios update from samsung to support it. This driver is not recommended for anyone and if they use it, they are on their own as it does not work properly, or correctly (the bios and video card do not know what the other one did so everything gets out of sync.)

There is a reason this is not upstream, and the other one is. I guess I should just delete this branch if people are trying to use it.

robcore replied Aug 4, 2016 edited

I'm glad you didn't, it's very helpful : ) (for learning purposes, of course)

Please sign in to comment.