From patchwork Mon Jun 3 15:50:17 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: 165635 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp4645708ili; Mon, 3 Jun 2019 08:52:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqwvkZi8asbIH3W59nP9RhzRQbI42Y0iZpY7/ZAogrh3iohN6F0qcMnjqzSm12fpiPh3q9if X-Received: by 2002:a63:134a:: with SMTP id 10mr20790722pgt.242.1559577172243; Mon, 03 Jun 2019 08:52:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559577172; cv=none; d=google.com; s=arc-20160816; b=nEqk3D8npS1TOBxFQyMx/+/3GWgHuaXXgMgwWrMnlF2Eu3qM07jhJ2vFl++OMbEP2h 8e414Jcd0sreTJqYjCg5/7G1g0nB4I+ekNCUr2mqT1GeW/7yJPn5qVYmsTO826mJkQ9O GY8eUfSpxwXsd/pord4z03Za1Bhve2qRP4j7gP6T3qgZXmps5hr7BHg/hgVCg1tRUwnq HfjO7EGpXiwviP18Uff685Y3KTBu1E3ahw27HL7hoVA28aKkWJCGyh1XvRKK/bS7WElD 9LVrhcTcgT+//B6b5iiHGZP9I0dD2IU4SPvDb3QTBzacG6V1woyVl+eCkMwNSHSsc5v3 Mw5Q== 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=pD4Gm2X8OgdpOyKhki1VFuLkjHOFxHLYlAW8xlonSwE=; b=j70l9z0ZMjNPe54kH/AOcvJqoDFWIqQs3znq2L9JT+V/50483P80L0GXFNatGql93t oUO0W0J7d1B3mZ26XcPCcWGZUM14rO2mmNPE/dyJlywBTWtT3o5zLoghJRcLbyZuQGv9 imeNs0Vfx0UZN9XclV4oEgIuG/nBYyAIBB+neM+D//WaeK3i8CDft8XeL7kayJoZdUK3 QSC07SmHJirTKrRagXUxDoSrQCDMR7UcMTSlciDZPNz0Mh32ipo9USIijcADBFh9B6gs Ows1nk92ByeJ2+a/U59Fusqcbre97l2SlJOJegdAWerWXbfoP/Qgvc0RtUS+rLOJ7aow 1knQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 l3si3193510pgl.560.2019.06.03.08.52.51; Mon, 03 Jun 2019 08:52:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729663AbfFCPwv (ORCPT + 30 others); Mon, 3 Jun 2019 11:52:51 -0400 Received: from foss.arm.com ([217.140.101.70]:54074 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729564AbfFCPwR (ORCPT ); Mon, 3 Jun 2019 11:52:17 -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 4A8ED1A25; Mon, 3 Jun 2019 08:52:17 -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 548123F246; Mon, 3 Jun 2019 08:52:16 -0700 (PDT) From: Suzuki K Poulose To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, rafael@kernel.org, suzuki.poulose@arm.com Subject: [RFC PATCH 51/57] drivers: Add generic helper to match all devices Date: Mon, 3 Jun 2019 16:50:17 +0100 Message-Id: <1559577023-558-52-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559577023-558-1-git-send-email-suzuki.poulose@arm.com> References: <1559577023-558-1-git-send-email-suzuki.poulose@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a generic helper which matches any given device by always returning true. Signed-off-by: Suzuki K Poulose --- drivers/base/core.c | 6 ++++++ include/linux/device.h | 1 + 2 files changed, 7 insertions(+) -- 2.7.4 diff --git a/drivers/base/core.c b/drivers/base/core.c index 69cba57..dd08bf9 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -3351,3 +3351,9 @@ int device_match_name(struct device *dev, const void *name) return sysfs_streq(dev_name(dev), name); } EXPORT_SYMBOL_GPL(device_match_name); + +int device_match_any(struct device *dev, const void *unused) +{ + return 1; +} +EXPORT_SYMBOL_GPL(device_match_any); diff --git a/include/linux/device.h b/include/linux/device.h index 68d6e04..7ea15e6 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -168,6 +168,7 @@ int device_match_acpi_dev(struct device *dev, const void *adev); int device_match_fwnode(struct device *dev, const void *fwnode); int device_match_devt(struct device *dev, const void *pdevt); int device_match_name(struct device *dev, const void *name); +int device_match_any(struct device *dev, const void *unused); int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data, int (*fn)(struct device *dev, void *data));