platform/x86: thinkpad_acpi: Make *_init() functions return -ENODEV instead of 1
authorHans de Goede <hdegoede@redhat.com>
Sun, 21 Nov 2021 19:11:24 +0000 (20:11 +0100)
committerHans de Goede <hdegoede@redhat.com>
Thu, 25 Nov 2021 15:18:21 +0000 (16:18 +0100)
commitc7e1c782f2432cd4dc6c6ea930d99d93997a0edb
treea10593374d72b184bc1e15fb8b5e34734056456d
parentc15f86856bec5bbf9a5ea909ce5ccc5b05744eb1
platform/x86: thinkpad_acpi: Make *_init() functions return -ENODEV instead of 1

Make ibm_init_struct.init() callbacks return -ENODEV instead of 1 when
the subdevice / function is not available.

Using -ENODEV clearly states what it going on where as a magic return of
"1" requires a deep dive into the code to figure out what is going on.

This also allows for some cleanups, avoiding the need to translate an
-ENODEV return into "return 1" (which often mistakenly was "return 0").

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Tested-by: Mark Pearson <mpearson@lenovo.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211121191129.256713-3-hdegoede@redhat.com
drivers/platform/x86/thinkpad_acpi.c