From: Thierry Reding <thierry.reding@gmail.com>
To: Meghana Madhyastha <meghana.madhyastha@gmail.com>
Cc: "Lee Jones" <lee.jones@linaro.org>,
"Daniel Thompson" <daniel.thompson@linaro.org>,
"Jingoo Han" <jingoohan1@gmail.com>,
"Noralf Trønnes" <noralf@tronnes.org>,
"Tomi Valkeinen" <tomi.valkeinen@ti.com>,
"Daniel Vetter" <daniel.vetter@intel.com>,
"Sean Paul" <seanpaul@chromium.org>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v19 03/10] video: backlight: Add of_find_backlight helper in backlight.c
Date: Thu, 25 Jan 2018 15:14:51 +0100 [thread overview]
Message-ID: <20180125141451.GD27888@ulmo> (raw)
In-Reply-To: <116d160ba78be2e6dcbdcb6855622bce67da9472.1516810725.git.meghana.madhyastha@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2256 bytes --]
On Wed, Jan 24, 2018 at 04:35:30PM +0000, Meghana Madhyastha wrote:
> Add of_find_backlight, a helper function which is a generic version
> of tinydrm_of_find_backlight that can be used by other drivers to avoid
> repetition of code and simplify things.
>
> Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
> Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
> Reviewed-by: Sean Paul<seanpaul@chromium.org>
> Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com>
> ---
> drivers/video/backlight/backlight.c | 43 +++++++++++++++++++++++++++++++++++++
> include/linux/backlight.h | 19 ++++++++++++++++
> 2 files changed, 62 insertions(+)
>
> diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
> index 8049e7656..553bf5c48 100644
> --- a/drivers/video/backlight/backlight.c
> +++ b/drivers/video/backlight/backlight.c
> @@ -580,6 +580,49 @@ struct backlight_device *of_find_backlight_by_node(struct device_node *node)
> EXPORT_SYMBOL(of_find_backlight_by_node);
> #endif
>
> +/**
> + * of_find_backlight - Get backlight device
> + * @dev: Device
> + *
> + * This function looks for a property named 'backlight' on the DT node
> + * connected to @dev and looks up the backlight device.
> + *
> + * Call backlight_put() to drop the reference on the backlight device.
> + *
> + * Returns:
> + * A pointer to the backlight device if found.
> + * Error pointer -EPROBE_DEFER if the DT property is set, but no backlight
> + * device is found.
> + * NULL if there's no backlight property.
> + */
> +struct backlight_device *of_find_backlight(struct device *dev)
Just a nit: there isn't really anything OF specific about this. It would
be if this took a struct device_node * as parameter. So technically you
could implement this for ACPI or whatever other firmware interface as
well. So I think a more idiomatic name for this would be:
struct backlight_device *backlight_get(struct device *dev);
which would match the:
void backlight_put(struct backlight_device *bd);
and be consistent with how other resources are obtained. Not a big deal,
though. It can always be changed later on.
Reviewed-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2018-01-25 14:14 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-24 16:32 [PATCH v19 00/10] Add backlight helper functions Meghana Madhyastha
2018-01-24 16:32 ` Meghana Madhyastha
2018-01-24 16:34 ` [PATCH v19 01/10] video: backlight: Add helpers to enable and disable backlight Meghana Madhyastha
2018-01-24 16:34 ` Meghana Madhyastha
2018-01-24 16:34 ` [PATCH v19 02/10] drm/tinydrm: Convert tinydrm_enable/disable_backlight to backlight_enable/disable Meghana Madhyastha
2018-01-24 16:35 ` [PATCH v19 03/10] video: backlight: Add of_find_backlight helper in backlight.c Meghana Madhyastha
2018-01-24 16:35 ` Meghana Madhyastha
2018-01-25 14:14 ` Thierry Reding [this message]
2018-01-26 9:48 ` Lee Jones
2018-01-26 9:48 ` Lee Jones
2018-01-26 17:46 ` Randy Dunlap
2018-01-29 9:11 ` Lee Jones
2018-01-29 14:43 ` Sean Paul
2018-01-29 14:43 ` Sean Paul
2018-01-30 9:02 ` Lee Jones
2018-01-30 9:02 ` Lee Jones
2018-01-30 2:30 ` Randy Dunlap
2018-01-24 16:36 ` [PATCH v19 04/10] drm/tinydrm: Replace tinydrm_of_find_backlight with of_find_backlight Meghana Madhyastha
2018-01-24 16:36 ` Meghana Madhyastha
2018-01-24 16:37 ` [PATCH v19 05/10] video: backlight: Add devres versions of of_find_backlight Meghana Madhyastha
2018-01-24 16:37 ` Meghana Madhyastha
2018-01-24 16:37 ` [PATCH v19 06/10] drm/tinydrm: Call devres version " Meghana Madhyastha
2018-01-24 16:37 ` Meghana Madhyastha
2018-01-24 16:39 ` [PATCH v19 07/10] drm/panel: Use backlight_enable/disable helpers Meghana Madhyastha
2018-01-25 14:08 ` Thierry Reding
2018-01-25 14:08 ` Thierry Reding
2018-01-24 16:40 ` [PATCH v19 08/10] drm/omapdrm: " Meghana Madhyastha
2018-01-24 16:40 ` [PATCH v19 09/10] drm/panel: Use of_find_backlight helper Meghana Madhyastha
2018-01-24 16:40 ` Meghana Madhyastha
2018-01-25 14:09 ` Thierry Reding
2018-01-25 14:09 ` Thierry Reding
2018-01-24 16:41 ` [PATCH v19 10/10] drm/omapdrm: " Meghana Madhyastha
2018-01-24 19:23 ` Sean Paul
2018-01-24 19:23 ` Sean Paul
2018-01-24 19:26 ` Sean Paul
2018-01-24 19:26 ` Sean Paul
2018-01-25 11:27 ` Daniel Thompson
2018-01-24 20:13 ` Noralf Trønnes
2018-01-24 20:13 ` Noralf Trønnes
2018-01-25 14:17 ` [PATCH v19 00/10] Add backlight helper functions Thierry Reding
2018-02-20 16:16 ` Sean Paul
2018-02-20 16:16 ` Sean Paul
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=20180125141451.GD27888@ulmo \
--to=thierry.reding@gmail.com \
--cc=daniel.thompson@linaro.org \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jingoohan1@gmail.com \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=meghana.madhyastha@gmail.com \
--cc=noralf@tronnes.org \
--cc=seanpaul@chromium.org \
--cc=tomi.valkeinen@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.