diff options
| -rw-r--r-- | drivers/platform/x86/asus-laptop.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c index eaffe732653a..faa87d3e3983 100644 --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c | |||
| @@ -1321,7 +1321,6 @@ out: | |||
| 1321 | 1321 | ||
| 1322 | static int __init asus_laptop_init(void) | 1322 | static int __init asus_laptop_init(void) |
| 1323 | { | 1323 | { |
| 1324 | struct device *dev; | ||
| 1325 | int result; | 1324 | int result; |
| 1326 | 1325 | ||
| 1327 | if (acpi_disabled) | 1326 | if (acpi_disabled) |
| @@ -1343,24 +1342,10 @@ static int __init asus_laptop_init(void) | |||
| 1343 | return -ENODEV; | 1342 | return -ENODEV; |
| 1344 | } | 1343 | } |
| 1345 | 1344 | ||
| 1346 | dev = acpi_get_physical_device(hotk->device->handle); | ||
| 1347 | |||
| 1348 | if (!acpi_video_backlight_support()) { | ||
| 1349 | result = asus_backlight_init(dev); | ||
| 1350 | if (result) | ||
| 1351 | goto fail_backlight; | ||
| 1352 | } else | ||
| 1353 | printk(ASUS_INFO "Brightness ignored, must be controlled by " | ||
| 1354 | "ACPI video driver\n"); | ||
| 1355 | |||
| 1356 | result = asus_input_init(); | 1345 | result = asus_input_init(); |
| 1357 | if (result) | 1346 | if (result) |
| 1358 | goto fail_input; | 1347 | goto fail_input; |
| 1359 | 1348 | ||
| 1360 | result = asus_led_init(dev); | ||
| 1361 | if (result) | ||
| 1362 | goto fail_led; | ||
| 1363 | |||
| 1364 | /* Register platform stuff */ | 1349 | /* Register platform stuff */ |
| 1365 | result = platform_driver_register(&asuspf_driver); | 1350 | result = platform_driver_register(&asuspf_driver); |
| 1366 | if (result) | 1351 | if (result) |
| @@ -1381,8 +1366,27 @@ static int __init asus_laptop_init(void) | |||
| 1381 | if (result) | 1366 | if (result) |
| 1382 | goto fail_sysfs; | 1367 | goto fail_sysfs; |
| 1383 | 1368 | ||
| 1369 | result = asus_led_init(&asuspf_device->dev); | ||
| 1370 | if (result) | ||
| 1371 | goto fail_led; | ||
| 1372 | |||
| 1373 | if (!acpi_video_backlight_support()) { | ||
| 1374 | result = asus_backlight_init(&asuspf_device->dev); | ||
| 1375 | if (result) | ||
| 1376 | goto fail_backlight; | ||
| 1377 | } else | ||
| 1378 | printk(ASUS_INFO "Brightness ignored, must be controlled by " | ||
| 1379 | "ACPI video driver\n"); | ||
| 1380 | |||
| 1384 | return 0; | 1381 | return 0; |
| 1385 | 1382 | ||
| 1383 | fail_backlight: | ||
| 1384 | asus_led_exit(); | ||
| 1385 | |||
| 1386 | fail_led: | ||
| 1387 | sysfs_remove_group(&asuspf_device->dev.kobj, | ||
| 1388 | &asuspf_attribute_group); | ||
| 1389 | |||
| 1386 | fail_sysfs: | 1390 | fail_sysfs: |
| 1387 | platform_device_del(asuspf_device); | 1391 | platform_device_del(asuspf_device); |
| 1388 | 1392 | ||
| @@ -1393,15 +1397,9 @@ fail_platform_device1: | |||
| 1393 | platform_driver_unregister(&asuspf_driver); | 1397 | platform_driver_unregister(&asuspf_driver); |
| 1394 | 1398 | ||
| 1395 | fail_platform_driver: | 1399 | fail_platform_driver: |
| 1396 | asus_led_exit(); | ||
| 1397 | |||
| 1398 | fail_led: | ||
| 1399 | asus_input_exit(); | 1400 | asus_input_exit(); |
| 1400 | 1401 | ||
| 1401 | fail_input: | 1402 | fail_input: |
| 1402 | asus_backlight_exit(); | ||
| 1403 | |||
| 1404 | fail_backlight: | ||
| 1405 | 1403 | ||
| 1406 | return result; | 1404 | return result; |
| 1407 | } | 1405 | } |
