Re: [PATCH v9 2/8] media: Add registration helpers for V4L2 flash sub-devices

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

 



Hi Alexey,

On 06/18/2015 07:45 PM, Alexey Klimov wrote:
Hi Jacek,

On Mon, May 25, 2015 at 6:13 PM, Jacek Anaszewski
<j.anaszewski@xxxxxxxxxxx> wrote:
This patch adds helper functions for registering/unregistering
LED Flash class devices as V4L2 sub-devices. The functions should
be called from the LED subsystem device driver. In case the
support for V4L2 Flash sub-devices is disabled in the kernel
config the functions' empty versions will be used.

Signed-off-by: Jacek Anaszewski <j.anaszewski@xxxxxxxxxxx>
Acked-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>
Cc: Sakari Ailus <sakari.ailus@xxxxxx>
Cc: Hans Verkuil <hans.verkuil@xxxxxxxxx>
---
  drivers/media/v4l2-core/Kconfig                |   11 +
  drivers/media/v4l2-core/Makefile               |    2 +
  drivers/media/v4l2-core/v4l2-flash-led-class.c |  671 ++++++++++++++++++++++++
  include/media/v4l2-flash-led-class.h           |  148 ++++++
  4 files changed, 832 insertions(+)
  create mode 100644 drivers/media/v4l2-core/v4l2-flash-led-class.c
  create mode 100644 include/media/v4l2-flash-led-class.h
[...]
+struct v4l2_flash *v4l2_flash_init(
+       struct device *dev, struct device_node *of_node,
+       struct led_classdev_flash *fled_cdev,
+       struct led_classdev_flash *iled_cdev,
+       const struct v4l2_flash_ops *ops,
+       struct v4l2_flash_config *config)
+{
+       struct v4l2_flash *v4l2_flash;

+       struct led_classdev *led_cdev = &fled_cdev->led_cdev;
+       struct v4l2_subdev *sd;
+       int ret;
+
+       if (!fled_cdev || !ops || !config)
+               return ERR_PTR(-EINVAL);

Could you please if it is correct? You're checking fled_cdev but four
lines above you're using fled_cdev and taking led_cdev pointer from
there. Maybe it's better to move calculation of led_cdev down and
place after if-check?

Thanks for spotting this. I'll submit fixed version soon.

--
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