@@ -67,7 +67,7 @@ MODULE_PARM_DESC(hw_changes_brightness,
6767static bool device_id_scheme = false;
6868module_param (device_id_scheme , bool , 0444 );
6969
70- static int only_lcd = -1 ;
70+ static int only_lcd ;
7171module_param (only_lcd , int , 0444 );
7272
7373static bool may_report_brightness_keys ;
@@ -1713,12 +1713,12 @@ static void acpi_video_dev_register_backlight(struct acpi_video_device *device)
17131713 return ;
17141714 count ++ ;
17151715
1716- acpi_get_parent (device -> dev -> handle , & acpi_parent );
1717-
1718- pdev = acpi_get_pci_dev ( acpi_parent );
1719- if ( pdev ) {
1720- parent = & pdev -> dev ;
1721- pci_dev_put ( pdev );
1716+ if ( ACPI_SUCCESS ( acpi_get_parent (device -> dev -> handle , & acpi_parent ))) {
1717+ pdev = acpi_get_pci_dev ( acpi_parent );
1718+ if ( pdev ) {
1719+ parent = & pdev -> dev ;
1720+ pci_dev_put ( pdev ) ;
1721+ }
17221722 }
17231723
17241724 memset (& props , 0 , sizeof (struct backlight_properties ));
@@ -2137,57 +2137,6 @@ static int __init intel_opregion_present(void)
21372137 return opregion ;
21382138}
21392139
2140- /* Check if the chassis-type indicates there is no builtin LCD panel */
2141- static bool dmi_is_desktop (void )
2142- {
2143- const char * chassis_type ;
2144- unsigned long type ;
2145-
2146- chassis_type = dmi_get_system_info (DMI_CHASSIS_TYPE );
2147- if (!chassis_type )
2148- return false;
2149-
2150- if (kstrtoul (chassis_type , 10 , & type ) != 0 )
2151- return false;
2152-
2153- switch (type ) {
2154- case 0x03 : /* Desktop */
2155- case 0x04 : /* Low Profile Desktop */
2156- case 0x05 : /* Pizza Box */
2157- case 0x06 : /* Mini Tower */
2158- case 0x07 : /* Tower */
2159- case 0x10 : /* Lunch Box */
2160- case 0x11 : /* Main Server Chassis */
2161- return true;
2162- }
2163-
2164- return false;
2165- }
2166-
2167- /*
2168- * We're seeing a lot of bogus backlight interfaces on newer machines
2169- * without a LCD such as desktops, servers and HDMI sticks. Checking the
2170- * lcd flag fixes this, enable this by default on any machines which are:
2171- * 1. Win8 ready (where we also prefer the native backlight driver, so
2172- * normally the acpi_video code should not register there anyways); *and*
2173- * 2.1 Report a desktop/server DMI chassis-type, or
2174- * 2.2 Are an ACPI-reduced-hardware platform (and thus won't use the EC for
2175- backlight control)
2176- */
2177- static bool should_check_lcd_flag (void )
2178- {
2179- if (!acpi_osi_is_win8 ())
2180- return false;
2181-
2182- if (dmi_is_desktop ())
2183- return true;
2184-
2185- if (acpi_reduced_hardware ())
2186- return true;
2187-
2188- return false;
2189- }
2190-
21912140int acpi_video_register (void )
21922141{
21932142 int ret = 0 ;
@@ -2201,9 +2150,6 @@ int acpi_video_register(void)
22012150 goto leave ;
22022151 }
22032152
2204- if (only_lcd == -1 )
2205- only_lcd = should_check_lcd_flag ();
2206-
22072153 dmi_check_system (video_dmi_table );
22082154
22092155 ret = acpi_bus_register_driver (& acpi_video_bus );
0 commit comments