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 6264DC43217 for ; Wed, 6 Oct 2021 17:31:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 488C6610FB for ; Wed, 6 Oct 2021 17:31:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238578AbhJFRdS (ORCPT ); Wed, 6 Oct 2021 13:33:18 -0400 Received: from mga14.intel.com ([192.55.52.115]:37987 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231678AbhJFRdR (ORCPT ); Wed, 6 Oct 2021 13:33:17 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10129"; a="226368285" X-IronPort-AV: E=Sophos;i="5.85,352,1624345200"; d="scan'208";a="226368285" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2021 10:31:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,352,1624345200"; d="scan'208";a="484200637" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 06 Oct 2021 10:31:20 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 5DEDD159; Wed, 6 Oct 2021 20:31:27 +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 v2 1/3] driver core: Provide device_match_acpi_handle() helper Date: Wed, 6 Oct 2021 20:31:23 +0300 Message-Id: <20211006173125.84423-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org We have couple of users of this helper, make it available for them. Signed-off-by: Andy Shevchenko --- v2: fixed compilation error (Greg) drivers/base/core.c | 6 ++++++ include/linux/device/bus.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/base/core.c b/drivers/base/core.c index c4a2c97a21a2..3a5623ea1369 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -4840,6 +4840,12 @@ int device_match_acpi_dev(struct device *dev, const void *adev) } EXPORT_SYMBOL(device_match_acpi_dev); +int device_match_acpi_handle(struct device *dev, const void *handle) +{ + return ACPI_HANDLE(dev) == handle; +} +EXPORT_SYMBOL(device_match_acpi_handle); + int device_match_any(struct device *dev, const void *unused) { return 1; diff --git a/include/linux/device/bus.h b/include/linux/device/bus.h index 062777a45a74..a039ab809753 100644 --- a/include/linux/device/bus.h +++ b/include/linux/device/bus.h @@ -143,6 +143,7 @@ int device_match_of_node(struct device *dev, const void *np); int device_match_fwnode(struct device *dev, const void *fwnode); int device_match_devt(struct device *dev, const void *pdevt); int device_match_acpi_dev(struct device *dev, const void *adev); +int device_match_acpi_handle(struct device *dev, const void *handle); int device_match_any(struct device *dev, const void *unused); /* iterator helpers for buses */ -- 2.33.0