[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0gi2vpr5y3USnPnPBHjPA1YAwfqjsJppfLgBP5CcycGog@mail.gmail.com>
Date: Tue, 18 Jun 2019 00:07:14 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Suzuki K Poulose <suzuki.poulose@....com>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Len Brown <lenb@...nel.org>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
linux-spi <linux-spi@...r.kernel.org>,
Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH v2 09/28] drivers: Add generic match helper by
ACPI_COMPANION device
On Fri, Jun 14, 2019 at 7:55 PM Suzuki K Poulose <suzuki.poulose@....com> wrote:
>
> Add a generic helper to match a device by the ACPI_COMPANION device.
> This will be later used for providing wrappers for
> (bus/class/driver)_find_device().
>
> Cc: Len Brown <lenb@...nel.org>
> Cc: linux-acpi@...r.kernel.org
> Cc: linux-spi@...r.kernel.org
> Cc: Mark Brown <broonie@...nel.org>
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Cc: "Rafael J. Wysocki" <rafael@...nel.org>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@....com>
Please fold this change into the patch adding users of device_match_acpi_dev().
> ---
> 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
>
Powered by blists - more mailing lists