From patchwork Sat Apr 29 18:15:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 1775257 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-pwm-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=aP81WHlq; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4Q7yNs4FPJz23tq for ; Sun, 30 Apr 2023 04:17:01 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229851AbjD2SQ7 (ORCPT ); Sat, 29 Apr 2023 14:16:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbjD2SQ7 (ORCPT ); Sat, 29 Apr 2023 14:16:59 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C41272127 for ; Sat, 29 Apr 2023 11:16:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682792171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oz4KO3+uxpqK+I2MFg3l3I+tW/82/aRp7KvnPl4qUEU=; b=aP81WHlqF3qn0dmcjTQ0lqGevza4Nmishu+g+thynikqHN6/plZ8AzUqWIgfXAne7lo0P4 gSVyFNE58gqUqCKWpqTgn7Smwxln+forwD6kjwODrNt8aTRUyslf6jeLlKesO4EyJOt67M /whN7zMEZj3kCKJvFrvIMuRs8H2lyXs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-269-3ZkQdGwWOZuZpb5AkuKsGw-1; Sat, 29 Apr 2023 14:16:08 -0400 X-MC-Unique: 3ZkQdGwWOZuZpb5AkuKsGw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9BBC185A588; Sat, 29 Apr 2023 18:16:07 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F13E2027043; Sat, 29 Apr 2023 18:16:06 +0000 (UTC) From: Hans de Goede To: =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Andy Shevchenko , Thierry Reding , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= Cc: Hans de Goede , Yauhen Kharuzhy , platform-driver-x86@vger.kernel.org, linux-pwm@vger.kernel.org Subject: [PATCH 05/19] platform/x86: lenovo-yogabook: Simplify gpio lookup table cleanup Date: Sat, 29 Apr 2023 20:15:37 +0200 Message-Id: <20230429181551.98201-6-hdegoede@redhat.com> In-Reply-To: <20230429181551.98201-1-hdegoede@redhat.com> References: <20230429181551.98201-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-pwm@vger.kernel.org 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 --- drivers/platform/x86/lenovo-yogabook-wmi.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/platform/x86/lenovo-yogabook-wmi.c b/drivers/platform/x86/lenovo-yogabook-wmi.c index 727e3ae5e8f5..62db455218a5 100644 --- a/drivers/platform/x86/lenovo-yogabook-wmi.c +++ b/drivers/platform/x86/lenovo-yogabook-wmi.c @@ -228,11 +228,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; @@ -276,13 +271,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");