PATCH [3/3]: Provide generic backlight support in Toshiba ACPI driver
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Review static int __init toshiba_acpi_init(void · line 602
Quoted 13 lines
(quoted diff) +6
-0@@ -546,6 +591,12 @@ static int __init toshiba_acpi_init(void remove_proc_entry(PROC_TOSHIBA, acpi_root_dir); } + tosh_backlight_device = backlight_device_register ("tosh-bl", NULL, + &toshbl_data); + + if (IS_ERR (tosh_backlight_device)) + printk("Failed to register Toshiba backlight device\n"); + return (ACPI_SUCCESS(status)) ? 0 : -ENODEV; }
Should not this be
if (IS_ERR (tosh_backlight_device)) {
printk("Failed to register Toshiba backlight device\n");
tosh_backlight_device = NULL;
}Review static void __exit toshiba_acpi_exit(voi · line 613
Quoted 8 lines
(quoted diff) +2
-0@@ -556,6 +607,8 @@ static void __exit toshiba_acpi_exit(voi if (toshiba_proc_dir) remove_proc_entry(PROC_TOSHIBA, acpi_root_dir); + backlight_device_unregister(tosh_backlight_device); + return; }
What if it failed register before?
- -andrey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
iD8DBQFERRiyR6LMutpd94wRAgldAJ4mK7HeL0UUY29XewfrCODvfa3t7wCgqLN8 dPbb6SKWJrMdmO3s/o7Gnns=
=JhuH
-----END PGP SIGNATURE-----