aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <[email protected]>2023-04-30 18:57:53 +0200
committerHans de Goede <[email protected]>2023-05-09 12:29:50 +0200
commit017ad809680c1e59d0b744ccd28e2e94899b4099 (patch)
tree6c28d014ecfed54317cf4f2eeba4f5038bd67f73
parent9e6380d6573181c555ca1b5019b08d19a9ee581c (diff)
platform/x86: lenovo-yogabook: Simplify gpio lookup table cleanup
After the devm_gpiod_get("backside_hall_sw") call the gpio lookup table is no longer necessary. Remove it directly after this call instead using a devm reset-action for this. Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
-rw-r--r--drivers/platform/x86/lenovo-yogabook-wmi.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/platform/x86/lenovo-yogabook-wmi.c b/drivers/platform/x86/lenovo-yogabook-wmi.c
index d57fcc838851..0b49c7a54bfc 100644
--- a/drivers/platform/x86/lenovo-yogabook-wmi.c
+++ b/drivers/platform/x86/lenovo-yogabook-wmi.c
@@ -227,11 +227,6 @@ static struct gpiod_lookup_table yogabook_wmi_gpios = {
},
};
-static void yogabook_wmi_rm_gpio_lookup(void *unused)
-{
- gpiod_remove_lookup_table(&yogabook_wmi_gpios);
-}
-
static int yogabook_wmi_probe(struct wmi_device *wdev, const void *context)
{
struct yogabook_wmi *data;
@@ -275,13 +270,9 @@ static int yogabook_wmi_probe(struct wmi_device *wdev, const void *context)
}
gpiod_add_lookup_table(&yogabook_wmi_gpios);
+ data->backside_hall_gpio = devm_gpiod_get(&wdev->dev, "backside_hall_sw", GPIOD_IN);
+ gpiod_remove_lookup_table(&yogabook_wmi_gpios);
- r = devm_add_action_or_reset(&wdev->dev, yogabook_wmi_rm_gpio_lookup, NULL);
- if (r)
- goto error_put_devs;
-
- data->backside_hall_gpio =
- devm_gpiod_get(&wdev->dev, "backside_hall_sw", GPIOD_IN);
if (IS_ERR(data->backside_hall_gpio)) {
r = PTR_ERR(data->backside_hall_gpio);
dev_err_probe(&wdev->dev, r, "Getting backside_hall_sw GPIO\n");