linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	linux-spi <linux-spi@vger.kernel.org>,
	Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH 07/13] drivers: Add generic match helper by ACPI_COMPANION device
Date: Thu, 6 Jun 2019 11:17:41 +0200	[thread overview]
Message-ID: <CAJZ5v0h+maPj-ijKV_vvQBpHD7N-VMiAqSeyztAkiUR9E2WdmQ@mail.gmail.com> (raw)
In-Reply-To: <1559747630-28065-8-git-send-email-suzuki.poulose@arm.com>

On Wed, Jun 5, 2019 at 5:14 PM Suzuki K Poulose <suzuki.poulose@arm.com> wrote:
>
> Add a generic helper to match a device by the acpi device.

"by its ACPI companion device object", please.

Also, it would be good to combine this patch with the patch(es) that
cause device_match_acpi_dev() to be actually used.

Helpers without any users are arguably not useful.

>
> Cc: Len Brown <lenb@kernel.org>
> Cc: linux-acpi@vger.kernel.org
> Cc: linux-spi@vger.kernel.org
> Cc: Mark Brown <broonie@kernel.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> ---
>  drivers/base/core.c    | 6 ++++++
>  include/linux/device.h | 1 +
>  2 files changed, 7 insertions(+)
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index b827ca1..597095b 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -3346,3 +3346,9 @@ int device_match_devt(struct device *dev, const void *pdevt)
>         return dev->devt == *(dev_t *)pdevt;
>  }
>  EXPORT_SYMBOL_GPL(device_match_devt);
> +
> +int device_match_acpi_dev(struct device *dev, const void *adev)
> +{
> +       return ACPI_COMPANION(dev) == adev;
> +}
> +EXPORT_SYMBOL(device_match_acpi_dev);
> diff --git a/include/linux/device.h b/include/linux/device.h
> index f315692..a03b50d 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -166,6 +166,7 @@ void subsys_dev_iter_exit(struct subsys_dev_iter *iter);
>  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 bus_for_each_dev(struct bus_type *bus, struct device *start, void *data,
>                      int (*fn)(struct device *dev, void *data));
> --
> 2.7.4
>

  reply	other threads:[~2019-06-06  9:17 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1559747630-28065-1-git-send-email-suzuki.poulose@arm.com>
2019-06-05 15:13 ` [PATCH 01/13] acpi: utils: Cleanup acpi_dev_match_cb Suzuki K Poulose
2019-06-06  9:14   ` Rafael J. Wysocki
2019-06-06  9:21     ` Suzuki K Poulose
2019-06-05 15:13 ` [PATCH 02/13] bus_find_device: Unify the match callback with class_find_device Suzuki K Poulose
2019-06-05 15:48   ` Corey Minyard
2019-06-05 15:51   ` Kershner, David A
2019-06-05 18:18   ` Mark Brown
2019-06-06  8:56   ` Rafael J. Wysocki
2019-06-06  9:01   ` Srinivas Kandagatla
2019-06-05 15:13 ` [PATCH 03/13] driver_find_device: Unify the match function with class_find_device() Suzuki K Poulose
2019-06-12  9:32   ` Lee Jones
2019-06-12  9:36     ` Suzuki K Poulose
2019-06-05 15:13 ` [PATCH 04/13] drivers: Add generic helper to match by of_node Suzuki K Poulose
2019-06-05 15:13 ` [PATCH 05/13] drivers: Add generic helper to match by fwnode Suzuki K Poulose
2019-06-05 15:13 ` [PATCH 06/13] drivers: Add generic helper to match by devt Suzuki K Poulose
2019-06-05 15:13 ` [PATCH 07/13] drivers: Add generic match helper by ACPI_COMPANION device Suzuki K Poulose
2019-06-06  9:17   ` Rafael J. Wysocki [this message]
2019-06-06  9:28     ` Suzuki K Poulose
2019-06-06  9:57       ` Rafael J. Wysocki
2019-06-12  9:43         ` Suzuki K Poulose
2019-06-12 22:07           ` Rafael J. Wysocki
2019-06-05 15:13 ` [PATCH 08/13] drivers: Add generic helper to match by name Suzuki K Poulose
2019-06-05 15:13 ` [PATCH 09/13] drivers: Add generic helper to match any device Suzuki K Poulose
2019-06-05 15:13 ` [PATCH 10/13] drivers: Introduce variants of class_find_device() Suzuki K Poulose
2019-06-05 16:14   ` Greg KH
2019-06-05 18:13     ` Suzuki K Poulose
2019-06-05 15:13 ` [PATCH 11/13] drivers: Introduce variants for bus_find_device() Suzuki K Poulose
2019-06-05 15:13 ` [PATCH 12/13] drivers: Introduce variants of driver_find_device() Suzuki K Poulose
2019-06-05 15:13 ` [PATCH 13/13] platform: Add platform_find_device_by_driver() helper Suzuki K Poulose

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJZ5v0h+maPj-ijKV_vvQBpHD7N-VMiAqSeyztAkiUR9E2WdmQ@mail.gmail.com \
    --to=rafael@kernel.org \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=suzuki.poulose@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).