ACPI / video: Refactor and fix dmi_is_desktop()
authorHans de Goede <hdegoede@redhat.com>
Mon, 7 Jan 2019 16:08:20 +0000 (17:08 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 13 Feb 2019 22:35:55 +0000 (23:35 +0100)
commitcecf3e3e0803462335e25d083345682518097334
tree8485cc0651b489ea15623472714f76a635851563
parentd13937116f1e82bf508a6325111b322c30c85eb9
ACPI / video: Refactor and fix dmi_is_desktop()

This commit refactors the chassis-type detection introduced by
commit 53fa1f6e8a59 ("ACPI / video: Only default only_lcd to true on
Win8-ready _desktops_") (where desktop means anything without a builtin
screen).

The DMI chassis_type is an unsigned integer, so rather then doing a
whole bunch of string-compares on it, convert it to an int and feed
the result to a switch case.

Note the switch case uses hex values, this is done because the spec
uses hex values too. This changes the check for "Main Server Chassis"
from checking for 11 decimal to 11 hexadecimal, this is a bug fix,
the original check for 11 decimal was wrong.

Fixes: 53fa1f6e8a59 ("ACPI / video: Only default only_lcd to true ...")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[ rjw: Drop redundant return statements ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpi_video.c