From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C32EC4332F for ; Thu, 7 Oct 2021 17:18:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 796D861371 for ; Thu, 7 Oct 2021 17:18:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243297AbhJGRU1 (ORCPT ); Thu, 7 Oct 2021 13:20:27 -0400 Received: from mga01.intel.com ([192.55.52.88]:40865 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242959AbhJGRUP (ORCPT ); Thu, 7 Oct 2021 13:20:15 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="249634652" X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="249634652" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 10:18:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="484592832" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 07 Oct 2021 10:18:13 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id E07AF170; Thu, 7 Oct 2021 20:18:19 +0300 (EEST) From: Andy Shevchenko To: Greg Kroah-Hartman , Saravana Kannan , Andy Shevchenko , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org, linux-i2c@vger.kernel.org Cc: "Rafael J. Wysocki" , Mika Westerberg , Linus Walleij , Bartosz Golaszewski , Wolfram Sang Subject: [PATCH v3 3/3] gpiolib: acpi: Replace custom code with device_match_acpi_handle() Date: Thu, 7 Oct 2021 20:18:15 +0300 Message-Id: <20211007171815.28336-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211007171815.28336-1-andriy.shevchenko@linux.intel.com> References: <20211007171815.28336-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Since driver core provides a generic device_match_acpi_handle() we may replace the custom code with it. Signed-off-by: Andy Shevchenko --- v3: amended the expression (Rafael) drivers/gpio/gpiolib-acpi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index 47712b6903b5..985e8589c58b 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -95,10 +95,7 @@ static bool acpi_gpio_deferred_req_irqs_done; static int acpi_gpiochip_find(struct gpio_chip *gc, void *data) { - if (!gc->parent) - return false; - - return ACPI_HANDLE(gc->parent) == data; + return gc->parent && device_match_acpi_handle(gc->parent, data); } /** -- 2.33.0