All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kieran Bingham <kbingham@kernel.org>
To: laurent.pinchart@ideasonboard.com, sakari.ailus@iki.fi,
	niklas.soderlund@ragnatech.se
Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Subject: [PATCH v3 1/2] v4l: subdev: tolerate null in media_entity_to_v4l2_subdev
Date: Wed, 17 May 2017 15:13:17 +0100	[thread overview]
Message-ID: <2a3a6d999502db1b6a47706b4da92d396075b22b.1495029016.git-series.kieran.bingham+renesas@ideasonboard.com> (raw)
In-Reply-To: <cover.29a91b9366a11bb7dbf4118ea12b84f2d48a8989.1495029016.git-series.kieran.bingham+renesas@ideasonboard.com>
In-Reply-To: <cover.29a91b9366a11bb7dbf4118ea12b84f2d48a8989.1495029016.git-series.kieran.bingham+renesas@ideasonboard.com>

From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

Return NULL, if a null entity is parsed for it's v4l2_subdev

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
---
 include/media/v4l2-subdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 5f1669c45642..d43fa7ca3a92 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -829,7 +829,7 @@ struct v4l2_subdev {
 };
 
 #define media_entity_to_v4l2_subdev(ent) \
-	container_of(ent, struct v4l2_subdev, entity)
+	ent ? container_of(ent, struct v4l2_subdev, entity) : NULL
 #define vdev_to_v4l2_subdev(vdev) \
 	((struct v4l2_subdev *)video_get_drvdata(vdev))
 
-- 
git-series 0.9.1

  reply	other threads:[~2017-05-17 14:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-17 14:13 [PATCH v3 0/2] ADV748x HDMI/Analog video receiver Kieran Bingham
2017-05-17 14:13 ` Kieran Bingham [this message]
2017-05-17 14:25   ` [PATCH v3 1/2] v4l: subdev: tolerate null in media_entity_to_v4l2_subdev Geert Uytterhoeven
2017-05-17 14:37     ` Kieran Bingham
     [not found]   ` <cover.ed561929790222fc2c4467d4e57072a8e4ba69f3.1495035409.git-series.kieran.bingham+renesas@ideasonboard.com>
2017-05-17 15:38     ` [PATCH v3.1 " Kieran Bingham
2017-05-17 19:20       ` Sakari Ailus
2017-05-18 16:08         ` Laurent Pinchart
2017-05-18 20:50           ` Sakari Ailus
2017-05-18 20:54             ` Laurent Pinchart
2017-05-18 21:05               ` Sakari Ailus
2017-05-18 21:59                 ` Laurent Pinchart
2017-05-18 22:38                   ` Sakari Ailus
2017-05-17 14:13 ` [PATCH v3 2/2] media: i2c: adv748x: add adv748x driver Kieran Bingham
2017-05-18 21:48   ` Laurent Pinchart
2017-05-23 17:09     ` Kieran Bingham

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=2a3a6d999502db1b6a47706b4da92d396075b22b.1495029016.git-series.kieran.bingham+renesas@ideasonboard.com \
    --to=kbingham@kernel.org \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund@ragnatech.se \
    --cc=sakari.ailus@iki.fi \
    /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.