From: Lee Jones <lee.jones@linaro.org>
To: "Noralf Trønnes" <noralf@tronnes.org>
Cc: dri-devel@lists.freedesktop.org, linux-usb@vger.kernel.org,
Daniel Thompson <daniel.thompson@linaro.org>,
Jingoo Han <jingoohan1@gmail.com>
Subject: Re: [PATCH 01/10] backlight: Add backlight_device_get_by_name()
Date: Thu, 30 Apr 2020 09:32:19 +0100 [thread overview]
Message-ID: <20200430083219.GC3118@dell> (raw)
In-Reply-To: <20200429124830.27475-2-noralf@tronnes.org>
On Wed, 29 Apr 2020, Noralf Trønnes wrote:
> Add a way to lookup a backlight device based on its name.
> Will be used by a USB display gadget getting the name from configfs.
>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Daniel Thompson <daniel.thompson@linaro.org>
> Cc: Jingoo Han <jingoohan1@gmail.com>
> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
> ---
> drivers/video/backlight/backlight.c | 21 +++++++++++++++++++++
> include/linux/backlight.h | 1 +
> 2 files changed, 22 insertions(+)
Once reviewed, can this patch be applied on its own?
My guess is that it can't, as the other patches in this set depend on
it, right? If this assumption is true, you need to send me the rest
of the set.
FYI: It's normally better to send the whole set to everyone, as it
provides visibility on current review (or lack there of) status of the
other patches and allows each of the maintainers to discuss possible
merge strategies.
> diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
> index cac3e35d7630..92d80aa0c0ef 100644
> --- a/drivers/video/backlight/backlight.c
> +++ b/drivers/video/backlight/backlight.c
> @@ -432,6 +432,27 @@ struct backlight_device *backlight_device_get_by_type(enum backlight_type type)
> }
> EXPORT_SYMBOL(backlight_device_get_by_type);
>
> +/**
> + * backlight_device_get_by_name - Get backlight device by name
> + * @name: Device name
> + *
> + * This function looks up a backlight device by its name. It obtains a reference
> + * on the backlight device and it is the caller's responsibility to drop the
> + * reference by calling backlight_put().
> + *
> + * Returns:
> + * A pointer to the backlight device if found, otherwise NULL.
> + */
> +struct backlight_device *backlight_device_get_by_name(const char *name)
> +{
> + struct device *dev;
> +
> + dev = class_find_device_by_name(backlight_class, name);
> +
> + return dev ? to_backlight_device(dev) : NULL;
> +}
> +EXPORT_SYMBOL(backlight_device_get_by_name);
> +
> /**
> * backlight_device_unregister - unregisters a backlight device object.
> * @bd: the backlight device object to be unregistered and freed.
> diff --git a/include/linux/backlight.h b/include/linux/backlight.h
> index c7d6b2e8c3b5..56e4580d4f55 100644
> --- a/include/linux/backlight.h
> +++ b/include/linux/backlight.h
> @@ -190,6 +190,7 @@ extern void backlight_force_update(struct backlight_device *bd,
> extern int backlight_register_notifier(struct notifier_block *nb);
> extern int backlight_unregister_notifier(struct notifier_block *nb);
> extern struct backlight_device *backlight_device_get_by_type(enum backlight_type type);
> +struct backlight_device *backlight_device_get_by_name(const char *name);
> extern int backlight_device_set_brightness(struct backlight_device *bd, unsigned long brightness);
>
> #define to_backlight_device(obj) container_of(obj, struct backlight_device, dev)
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2020-04-30 8:32 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-29 12:48 [PATCH 00/10] Generic USB Display driver Noralf Trønnes
2020-04-29 12:48 ` [PATCH 01/10] backlight: Add backlight_device_get_by_name() Noralf Trønnes
2020-04-30 8:32 ` Lee Jones [this message]
2020-04-30 9:20 ` Noralf Trønnes
2020-04-30 10:15 ` Lee Jones
2020-04-30 10:42 ` Noralf Trønnes
2020-04-30 14:02 ` Daniel Vetter
2020-05-04 7:10 ` Lee Jones
2020-05-03 7:13 ` Sam Ravnborg
2020-04-29 12:48 ` [PATCH 02/10] drm: Add backlight helper Noralf Trønnes
2020-04-29 14:13 ` Hans de Goede
2020-04-29 18:40 ` Noralf Trønnes
2020-04-30 15:36 ` Hans de Goede
2020-05-04 12:06 ` Daniel Vetter
2020-05-04 15:54 ` Noralf Trønnes
2020-04-29 12:48 ` [PATCH 03/10] drm/client: Add drm_client_init_from_id() Noralf Trønnes
2020-04-29 12:48 ` [PATCH 04/10] drm/client: Add drm_client_framebuffer_flush() Noralf Trønnes
2020-05-03 7:48 ` Sam Ravnborg
2020-05-03 9:54 ` Noralf Trønnes
2020-04-29 12:48 ` [PATCH 05/10] drm/client: Add drm_client_modeset_check() Noralf Trønnes
2020-05-03 8:03 ` Sam Ravnborg
2020-05-03 10:02 ` Noralf Trønnes
2020-04-29 12:48 ` [PATCH 06/10] drm/client: Add a way to set modeset, properties and rotation Noralf Trønnes
2020-05-03 8:47 ` Sam Ravnborg
2020-05-03 10:50 ` Noralf Trønnes
2020-04-29 12:48 ` [PATCH 07/10] drm/format-helper: Add drm_fb_swab() Noralf Trønnes
2020-05-03 10:29 ` Sam Ravnborg
2020-05-03 13:38 ` Noralf Trønnes
2020-04-29 12:48 ` [PATCH 08/10] drm: Add Generic USB Display driver Noralf Trønnes
2020-05-02 17:58 ` Noralf Trønnes
2020-04-29 12:48 ` [PATCH 09/10] drm/gud: Add functionality for the USB gadget side Noralf Trønnes
2020-04-29 12:48 ` [PATCH 10/10] usb: gadget: function: Add Generic USB Display support Noralf Trønnes
2020-05-01 13:22 ` [PATCH 00/10] Generic USB Display driver Noralf Trønnes
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=20200430083219.GC3118@dell \
--to=lee.jones@linaro.org \
--cc=daniel.thompson@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jingoohan1@gmail.com \
--cc=linux-usb@vger.kernel.org \
--cc=noralf@tronnes.org \
/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).