devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-leds-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org,
	robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	pavel-+ZI9xUNit7I@public.gmane.org
Subject: [PATCH 4/8] v4l2-flash: Use led_classdev instead of led_classdev_flash for indicator
Date: Wed, 14 Jun 2017 12:47:15 +0300	[thread overview]
Message-ID: <1497433639-13101-5-git-send-email-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <1497433639-13101-1-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>

The V4L2 flash class initialisation expects struct led_classdev_flash that
describes an indicator but only uses struct led_classdev which is a field
iled_cdev in the struct. Use struct iled_cdev only.

Signed-off-by: Sakari Ailus <sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
 drivers/media/v4l2-core/v4l2-flash-led-class.c | 19 +++++++------------
 include/media/v4l2-flash-led-class.h           |  6 +++---
 2 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-flash-led-class.c b/drivers/media/v4l2-core/v4l2-flash-led-class.c
index 7b82881..6d69119 100644
--- a/drivers/media/v4l2-core/v4l2-flash-led-class.c
+++ b/drivers/media/v4l2-core/v4l2-flash-led-class.c
@@ -110,7 +110,7 @@ static void v4l2_flash_set_led_brightness(struct v4l2_flash *v4l2_flash,
 		led_set_brightness_sync(&v4l2_flash->fled_cdev->led_cdev,
 					brightness);
 	} else {
-		led_set_brightness_sync(&v4l2_flash->iled_cdev->led_cdev,
+		led_set_brightness_sync(v4l2_flash->iled_cdev,
 					brightness);
 	}
 }
@@ -133,7 +133,7 @@ static int v4l2_flash_update_led_brightness(struct v4l2_flash *v4l2_flash,
 			return 0;
 		led_cdev = &v4l2_flash->fled_cdev->led_cdev;
 	} else {
-		led_cdev = &v4l2_flash->iled_cdev->led_cdev;
+		led_cdev = v4l2_flash->iled_cdev;
 	}
 
 	ret = led_update_brightness(led_cdev);
@@ -529,8 +529,7 @@ static int v4l2_flash_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
 	struct v4l2_flash *v4l2_flash = v4l2_subdev_to_v4l2_flash(sd);
 	struct led_classdev_flash *fled_cdev = v4l2_flash->fled_cdev;
 	struct led_classdev *led_cdev = &fled_cdev->led_cdev;
-	struct led_classdev_flash *iled_cdev = v4l2_flash->iled_cdev;
-	struct led_classdev *led_cdev_ind = NULL;
+	struct led_classdev *led_cdev_ind = v4l2_flash->iled_cdev;
 	int ret = 0;
 
 	if (!v4l2_fh_is_singular(&fh->vfh))
@@ -543,9 +542,7 @@ static int v4l2_flash_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
 
 	mutex_unlock(&led_cdev->led_access);
 
-	if (iled_cdev) {
-		led_cdev_ind = &iled_cdev->led_cdev;
-
+	if (led_cdev_ind) {
 		mutex_lock(&led_cdev_ind->led_access);
 
 		led_sysfs_disable(led_cdev_ind);
@@ -578,7 +575,7 @@ static int v4l2_flash_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
 	struct v4l2_flash *v4l2_flash = v4l2_subdev_to_v4l2_flash(sd);
 	struct led_classdev_flash *fled_cdev = v4l2_flash->fled_cdev;
 	struct led_classdev *led_cdev = &fled_cdev->led_cdev;
-	struct led_classdev_flash *iled_cdev = v4l2_flash->iled_cdev;
+	struct led_classdev *led_cdev_ind = v4l2_flash->iled_cdev;
 	int ret = 0;
 
 	if (!v4l2_fh_is_singular(&fh->vfh))
@@ -593,9 +590,7 @@ static int v4l2_flash_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
 
 	mutex_unlock(&led_cdev->led_access);
 
-	if (iled_cdev) {
-		struct led_classdev *led_cdev_ind = &iled_cdev->led_cdev;
-
+	if (led_cdev_ind) {
 		mutex_lock(&led_cdev_ind->led_access);
 		led_sysfs_enable(led_cdev_ind);
 		mutex_unlock(&led_cdev_ind->led_access);
@@ -614,7 +609,7 @@ static const struct v4l2_subdev_ops v4l2_flash_subdev_ops;
 struct v4l2_flash *v4l2_flash_init(
 	struct device *dev, struct fwnode_handle *fwn,
 	struct led_classdev_flash *fled_cdev,
-	struct led_classdev_flash *iled_cdev,
+	struct led_classdev *iled_cdev,
 	const struct v4l2_flash_ops *ops,
 	struct v4l2_flash_config *config)
 {
diff --git a/include/media/v4l2-flash-led-class.h b/include/media/v4l2-flash-led-class.h
index f9dcd54..54e31a8 100644
--- a/include/media/v4l2-flash-led-class.h
+++ b/include/media/v4l2-flash-led-class.h
@@ -85,7 +85,7 @@ struct v4l2_flash_config {
  */
 struct v4l2_flash {
 	struct led_classdev_flash *fled_cdev;
-	struct led_classdev_flash *iled_cdev;
+	struct led_classdev *iled_cdev;
 	const struct v4l2_flash_ops *ops;
 
 	struct v4l2_subdev sd;
@@ -124,7 +124,7 @@ static inline struct v4l2_flash *v4l2_ctrl_to_v4l2_flash(struct v4l2_ctrl *c)
 struct v4l2_flash *v4l2_flash_init(
 	struct device *dev, struct fwnode_handle *fwn,
 	struct led_classdev_flash *fled_cdev,
-	struct led_classdev_flash *iled_cdev,
+	struct led_classdev *iled_cdev,
 	const struct v4l2_flash_ops *ops,
 	struct v4l2_flash_config *config);
 
@@ -140,7 +140,7 @@ void v4l2_flash_release(struct v4l2_flash *v4l2_flash);
 static inline struct v4l2_flash *v4l2_flash_init(
 	struct device *dev, struct fwnode_handle *fwn,
 	struct led_classdev_flash *fled_cdev,
-	struct led_classdev_flash *iled_cdev,
+	struct led_classdev *iled_cdev,
 	const struct v4l2_flash_ops *ops,
 	struct v4l2_flash_config *config)
 {
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-06-14  9:47 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14  9:47 [PATCH 0/8] Support registering lens, flash and EEPROM devices Sakari Ailus
2017-06-14  9:47 ` [PATCH 1/8] dt: bindings: Add a binding for flash devices associated to a sensor Sakari Ailus
2017-06-14 15:19   ` Rob Herring
     [not found]   ` <1497433639-13101-2-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-06-15  9:11     ` Pavel Machek
2017-06-15  9:21   ` Sebastian Reichel
2017-06-14  9:47 ` [PATCH 2/8] dt: bindings: Add lens-focus binding for image sensors Sakari Ailus
2017-06-14 15:20   ` Rob Herring
2017-06-14  9:47 ` [PATCH 3/8] dt: bindings: Add a binding for referencing EEPROM from camera sensors Sakari Ailus
2017-06-18 14:05   ` Rob Herring
     [not found]   ` <1497433639-13101-4-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-07-19  7:52     ` Maxime Ripard
2017-07-19  9:21       ` Sakari Ailus
2017-07-19 11:18         ` Maxime Ripard
2017-07-21 11:14           ` Sakari Ailus
     [not found] ` <1497433639-13101-1-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-06-14  9:47   ` Sakari Ailus [this message]
2017-06-14 21:13     ` [PATCH 4/8] v4l2-flash: Use led_classdev instead of led_classdev_flash for indicator Jacek Anaszewski
2017-06-15  6:31     ` kbuild test robot
2017-06-15 10:45     ` Sebastian Reichel
2017-06-14  9:47   ` [PATCH 5/8] v4l2-flash: Flash ops aren't mandatory Sakari Ailus
2017-06-14 21:14     ` Jacek Anaszewski
     [not found]       ` <3e0a8823-a8b4-3f78-25e0-22d8cb8ad090-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-14 21:19         ` Sakari Ailus
     [not found]           ` <20170614211939.GR12407-S+BSfZ9RZZmRSg0ZkenSGLdO1Tsj/99ntUK59QYPAWc@public.gmane.org>
2017-06-15 12:08             ` Jacek Anaszewski
2017-06-15  9:24     ` Sebastian Reichel
2017-06-15 12:32       ` Sakari Ailus
     [not found]         ` <20170615123209.GD12407-S+BSfZ9RZZmRSg0ZkenSGLdO1Tsj/99ntUK59QYPAWc@public.gmane.org>
2017-06-15 12:51           ` Sebastian Reichel
2017-07-18 17:36     ` [PATCH v1.1 1/1] " Sakari Ailus
2017-07-19 11:53       ` Pavel Machek
2017-06-14  9:47   ` [PATCH 6/8] leds: as3645a: Add LED flash class driver Sakari Ailus
2017-06-14 21:15     ` Jacek Anaszewski
2017-06-14 22:10       ` Sakari Ailus
     [not found]         ` <20170614221028.GS12407-S+BSfZ9RZZmRSg0ZkenSGLdO1Tsj/99ntUK59QYPAWc@public.gmane.org>
2017-06-15 13:01           ` Jacek Anaszewski
2017-06-15 13:34             ` Sakari Ailus
     [not found]               ` <20170615133404.GF12407-S+BSfZ9RZZmRSg0ZkenSGLdO1Tsj/99ntUK59QYPAWc@public.gmane.org>
2017-06-15 13:47                 ` Jacek Anaszewski
2017-06-14 21:39     ` Pavel Machek
2017-06-14 22:21       ` Sakari Ailus
2017-06-14 22:28         ` Pavel Machek
2017-06-14 22:43           ` Sakari Ailus
2017-06-15 10:43             ` Pavel Machek
2017-06-14  9:47 ` [PATCH 7/8] smiapp: Add support for flash, lens and EEPROM devices Sakari Ailus
2017-06-15  1:50   ` kbuild test robot
2017-06-16 12:07   ` Pavel Machek
2017-06-16 12:26     ` Sakari Ailus
     [not found]       ` <20170616122629.GL15419-z7MJbOB4PBP+e+fPlCVrcFDQ4js95KgL@public.gmane.org>
2017-06-16 13:10         ` Pavel Machek
2017-06-16 12:42   ` Pavel Machek
2017-06-16 12:45     ` Sakari Ailus
     [not found]       ` <20170616124526.GM15419-z7MJbOB4PBP+e+fPlCVrcFDQ4js95KgL@public.gmane.org>
2017-06-17  9:19         ` Pavel Machek
2017-06-17 12:59       ` Pavel Machek
2017-06-17 21:12         ` Pavel Machek
     [not found]   ` <1497433639-13101-8-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-06-17 12:17     ` Pavel Machek
2017-06-14  9:47 ` [PATCH 8/8] arm: dts: omap3: N9/N950: Add AS3645A camera flash Sakari Ailus
2017-06-15 10:15   ` Sebastian Reichel
2017-06-14  9:53 ` [PATCH 0/8] Support registering lens, flash and EEPROM devices Sakari Ailus

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=1497433639-13101-5-git-send-email-sakari.ailus@linux.intel.com \
    --to=sakari.ailus-vuqaysv1563yd54fqh9/ca@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-leds-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pavel-+ZI9xUNit7I@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.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).