Re: [PATCH 4/5] leds: aat1290: Pass dev and dev->of_node to v4l2_flash_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/20/2015 02:27 PM, Sakari Ailus wrote:
Hi Jacek,

On Wed, May 20, 2015 at 12:37:03PM +0200, Jacek Anaszewski wrote:
On 05/20/2015 11:47 AM, Jacek Anaszewski wrote:
Hi Sakari,

On 05/20/2015 01:04 AM, Sakari Ailus wrote:
Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxx>
---
  drivers/leds/leds-aat1290.c |    5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/leds/leds-aat1290.c b/drivers/leds/leds-aat1290.c
index c656a2d..71bf6bb 100644
--- a/drivers/leds/leds-aat1290.c
+++ b/drivers/leds/leds-aat1290.c
@@ -524,9 +524,8 @@ static int aat1290_led_probe(struct
platform_device *pdev)
      led_cdev->dev->of_node = sub_node;

      /* Create V4L2 Flash subdev. */
-    led->v4l2_flash = v4l2_flash_init(fled_cdev,
-                      &v4l2_flash_ops,
-                      &v4l2_sd_cfg);
+    led->v4l2_flash = v4l2_flash_init(dev, NULL, fled_cdev,
+                      &v4l2_flash_ops, &v4l2_sd_cfg);

Here the first argument should be led_cdev->dev, not dev, which is
&pdev->dev, whereas led_cdev->dev is returned by
device_create_with_groups (it takes dev as a parent) called from
led_classdev_register.

The reason for this is the fact that pdev->dev has its of_node
field initialized, which makes v4l2_async trying to match
subdev by parent node of a LED device, not by sub-LED related
DT node.

If v4l2_subdev->of_node is set, then it won't be replaced with one from
struct device. I.e. you need to provide of_node pointer only if it's
different from dev->of_node.


It will always be different since dev->of_node pointer is related
to the main DT node of LED device, whereas each LED connected to it
must be expressed in the form of sub-node, as
Documentation/devicetree/bindings/leds/common.txt DT states.

--
Best Regards,
Jacek Anaszewski
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux