From patchwork Tue Apr 16 10:39:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suzuki K Poulose X-Patchwork-Id: 162305 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp4050359jan; Tue, 16 Apr 2019 03:40:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBTuOCejkp5IORAhht1suwMV0mPn/AM3WWSQrEVIiRjuGxAvG3ECz4cem4p5ffSJVKN+Ln X-Received: by 2002:a65:554e:: with SMTP id t14mr65412536pgr.107.1555411200028; Tue, 16 Apr 2019 03:40:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555411200; cv=none; d=google.com; s=arc-20160816; b=RYT054at6ZoNLOL0N9Ut75LeyjNc0I4sZLpvU1mINO24vLWLxsQHHsWccNlf+ZgTJS EHhHCngEnkuMbA+7srdbT17IFz8/GnrHtDszbyfZ1D4FqbGo+aQlf89vamyVyzHJEcZ1 EzcrwHcMH5RY0Vm5lLkvw9ImbKBCZ7hDrHAOiPkm8KnvCrgVjPoyWfoCdeCdmgzz1HNM r5mmRrHp/G7WnBADb2zXFzX1ynBcmgovJxWopmG3GwLAgpzih3mJpNpp8JOdajMa0u0o 74SIARscgjZPexBiDmdYhK4MIXDG7CID25KhcE063NEwgmZvqEUK+7GFuPrY7347QDMP 2wrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=X8qlmoBbibly7CxFKVkvQQZ/TIRJcaM8XPs3mnllG90=; b=GxrJDistPQwU92GszChjeFWkVws/lSQpL1D1FmhjKP7Ujg10ib8IzfOwBBvXMUU7fy xi6iZYR4JNDQw4Z9q9dIZTwxh++3zJj3qiJmoOHK3OTyjXrE43ODGMfMEtugdDEa3boH 0wDZVBjWdM9ND3DSKYOFf4BNi8Cfw48+L6T48uxcb3Db1Otd6aiHAZ4JaZvkOyOEy3e2 MHWEuFcDIvSE90CBmo9Z/soDGwEsnX2YK0LkTyzLcrSxvfqoNj9tVF0eQk7xTmKFIPmw 7Am4Xp8g1zLlUxhTjT8e6JXukVI5AfDUxvPjPZxudRwEnt+b74qP1PR2imCoR6O7OFkF wlWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p18si50765944pli.432.2019.04.16.03.39.59; Tue, 16 Apr 2019 03:40:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728379AbfDPKj7 (ORCPT + 9 others); Tue, 16 Apr 2019 06:39:59 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:51998 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727037AbfDPKj6 (ORCPT ); Tue, 16 Apr 2019 06:39:58 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5BD2E15A2; Tue, 16 Apr 2019 03:39:58 -0700 (PDT) Received: from en101.cambridge.arm.com (en101.cambridge.arm.com [10.1.196.93]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D60613F68F; Tue, 16 Apr 2019 03:39:56 -0700 (PDT) From: Suzuki K Poulose To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, coresight@lists.linaro.org, rafael@kernel.org, mathieu.poirier@linaro.org, Suzuki K Poulose , Greg Kroah-Hartman , linux-acpi@vger.kernel.org Subject: [RESEND][PATCH v2 27/36] drivers: Add a generic helper to match device by fwnode handle Date: Tue, 16 Apr 2019 11:39:24 +0100 Message-Id: <1555411164-26399-1-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555344260-12375-28-git-send-email-suzuki.poulose@arm.com> References: <1555344260-12375-28-git-send-email-suzuki.poulose@arm.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Make the device_fwnode_match() a generic helper to match device by fwnode handle for use with bus_find_device(). This will be also used by coresight. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: linux-acpi@vger.kernel.org Signed-off-by: Suzuki K Poulose --- Resending with linux-acpi in Cc, as requested by Rafael. drivers/base/devcon.c | 5 ----- drivers/base/property.c | 6 ++++++ include/linux/property.h | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/drivers/base/devcon.c b/drivers/base/devcon.c index 04db9ae..f4a9e30 100644 --- a/drivers/base/devcon.c +++ b/drivers/base/devcon.c @@ -107,11 +107,6 @@ static struct bus_type *generic_match_buses[] = { NULL, }; -static int device_fwnode_match(struct device *dev, void *fwnode) -{ - return dev_fwnode(dev) == fwnode; -} - static void *device_connection_fwnode_match(struct device_connection *con) { struct bus_type *bus; diff --git a/drivers/base/property.c b/drivers/base/property.c index 8b91ab3..d10d923 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -25,6 +25,12 @@ struct fwnode_handle *dev_fwnode(struct device *dev) } EXPORT_SYMBOL_GPL(dev_fwnode); +int device_fwnode_match(struct device *dev, void *fwnode) +{ + return dev_fwnode(dev) == fwnode; +} +EXPORT_SYMBOL_GPL(device_fwnode_match); + /** * device_property_present - check if a property of a device is present * @dev: Device whose property is being checked diff --git a/include/linux/property.h b/include/linux/property.h index 65d3420..c8fd3d42 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -34,6 +34,7 @@ enum dev_dma_attr { }; struct fwnode_handle *dev_fwnode(struct device *dev); +int device_fwnode_match(struct device *dev, void *fwnode); bool device_property_present(struct device *dev, const char *propname); int device_property_read_u8_array(struct device *dev, const char *propname,