Skip to content

Commit ce7c47d

Browse files
vsyrjaladvhart
authored andcommitted
platform/x86: fujitsu-laptop: Don't oops when FUJ02E3 is not presnt
My Fujitsu-Siemens Lifebook S6120 doesn't have the FUJ02E3 device, but it does have FUJ02B1. That means we do register the backlight device (and it even seems to work), but the code will oops as soon as we try to set the backlight brightness because it's trying to call call_fext_func() with a NULL device. Let's just skip those function calls when the FUJ02E3 device is not present. Cc: Jonathan Woithe <jwoithe@just42.net> Cc: Andy Shevchenko <andy@infradead.org> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: <stable@vger.kernel.org> # 4.13.x Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
1 parent 2bd6bf0 commit ce7c47d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎drivers/platform/x86/fujitsu-laptop.c‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,12 @@ static int bl_update_status(struct backlight_device *b)
254254
{
255255
struct acpi_device *device = bl_get_data(b);
256256

257-
if (b->props.power == FB_BLANK_POWERDOWN)
258-
call_fext_func(fext, FUNC_BACKLIGHT, 0x1, 0x4, 0x3);
259-
else
260-
call_fext_func(fext, FUNC_BACKLIGHT, 0x1, 0x4, 0x0);
257+
if (fext) {
258+
if (b->props.power == FB_BLANK_POWERDOWN)
259+
call_fext_func(fext, FUNC_BACKLIGHT, 0x1, 0x4, 0x3);
260+
else
261+
call_fext_func(fext, FUNC_BACKLIGHT, 0x1, 0x4, 0x0);
262+
}
261263

262264
return set_lcd_level(device, b->props.brightness);
263265
}

0 commit comments

Comments
 (0)