From: Kieran Bingham <kbingham@kernel.org>
To: niklas.soderlund@ragnatech.se
Cc: linux-renesas-soc@vger.kernel.org, linux-media@vger.kernel.org,
Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Subject: [PATCH 2/2] rcar-vin: group: use correct of_node
Date: Mon, 24 Apr 2017 19:14:26 +0100 [thread overview]
Message-ID: <1493057666-27961-1-git-send-email-kbingham@kernel.org> (raw)
In-Reply-To: <20170314190308.25790-1-niklas.soderlund+renesas@ragnatech.se>
From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
The unbind function dereferences the subdev->dev node to obtain the
of_node. In error paths, the subdev->dev can be set to NULL, whilst the
correct reference to the of_node is available as subdev->of_node.
Correct the dereferencing, and move the variable outside of the loop as
it is constant against the subdev, and not initialised per CSI, for both
the bind and unbind functions
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
---
drivers/media/platform/rcar-vin/rcar-core.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c
index 48557628e76d..a530dc388b95 100644
--- a/drivers/media/platform/rcar-vin/rcar-core.c
+++ b/drivers/media/platform/rcar-vin/rcar-core.c
@@ -469,7 +469,7 @@ static int rvin_digital_notify_bound(struct v4l2_async_notifier *notifier,
v4l2_set_subdev_hostdata(subdev, vin);
- if (vin->digital.asd.match.of.node == subdev->dev->of_node) {
+ if (vin->digital.asd.match.of.node == subdev->of_node) {
/* Find surce and sink pad of remote subdevice */
ret = rvin_find_pad(subdev, MEDIA_PAD_FL_SOURCE);
@@ -738,12 +738,11 @@ static void rvin_group_notify_unbind(struct v4l2_async_notifier *notifier,
struct v4l2_async_subdev *asd)
{
struct rvin_dev *vin = notifier_to_vin(notifier);
+ struct device_node *del = subdev->of_node;
unsigned int i;
mutex_lock(&vin->group->lock);
for (i = 0; i < RVIN_CSI_MAX; i++) {
- struct device_node *del = subdev->dev->of_node;
-
if (vin->group->bridge[i].asd.match.of.node == del) {
vin_dbg(vin, "Unbind bridge %s\n", subdev->name);
vin->group->bridge[i].subdev = NULL;
@@ -768,13 +767,13 @@ static int rvin_group_notify_bound(struct v4l2_async_notifier *notifier,
struct v4l2_async_subdev *asd)
{
struct rvin_dev *vin = notifier_to_vin(notifier);
+ struct device_node *new = subdev->of_node;
unsigned int i;
v4l2_set_subdev_hostdata(subdev, vin);
mutex_lock(&vin->group->lock);
for (i = 0; i < RVIN_CSI_MAX; i++) {
- struct device_node *new = subdev->dev->of_node;
if (vin->group->bridge[i].asd.match.of.node == new) {
vin_dbg(vin, "Bound bridge %s\n", subdev->name);
--
2.7.4
next prev parent reply other threads:[~2017-04-24 18:14 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-14 19:02 [PATCH v3 00/27] rcar-vin: Add Gen3 with media controller support Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 01/27] rcar-vin: add Gen3 devicetree bindings documentation Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 02/27] media: entity: Add has_route entity operation Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 03/27] media: entity: Add media_entity_has_route() function Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 04/27] media: entity: Swap pads if route is checked from source to sink Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 05/27] rcar-vin: move chip information to own struct Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 06/27] rcar-vin: move max width and height information to chip information Niklas Söderlund
2017-03-15 9:37 ` Sergei Shtylyov
2017-03-14 19:02 ` [PATCH v3 07/27] rcar-vin: change name of video device Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 08/27] rcar-vin: move functions regarding scaling Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 09/27] rcar-vin: all Gen2 boards can scale simplify logic Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 10/27] rcar-vin: do not reset crop and compose when setting format Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 11/27] rcar-vin: do not allow changing scaling and composing while streaming Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 12/27] rcar-vin: read subdevice format for crop only when needed Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 13/27] rcar-vin: do not cut height in two for top, bottom or alternate fields Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 14/27] rcar-vin: move media bus configuration to struct rvin_info Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 15/27] rcar-vin: enable Gen3 hardware configuration Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 16/27] rcar-vin: add functions to manipulate Gen3 CHSEL value Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 17/27] rcar-vin: prepare digital notifier for group notifier Niklas Söderlund
2017-03-14 19:02 ` [PATCH v3 18/27] rcar-vin: add flag to switch to media controller mode Niklas Söderlund
2017-03-14 19:03 ` [PATCH v3 19/27] rcar-vin: use different v4l2 operations in " Niklas Söderlund
2017-03-14 19:03 ` [PATCH v3 20/27] rcar-vin: register a media pad if running " Niklas Söderlund
2017-03-14 19:03 ` [PATCH v3 21/27] rcar-vin: add group allocator functions Niklas Söderlund
2017-03-14 19:03 ` [PATCH v3 22/27] rcar-vin: add chsel information to rvin_info Niklas Söderlund
2017-03-14 19:03 ` [PATCH v3 23/27] rcar-vin: parse Gen3 OF and setup media graph Niklas Söderlund
2017-03-14 19:03 ` [PATCH v3 24/27] rcar-vin: add link notify for Gen3 Niklas Söderlund
2017-03-14 19:03 ` [PATCH v3 25/27] rcar-vin: extend {start,stop}_streaming to work with media controller Niklas Söderlund
2017-03-14 19:03 ` [PATCH v3 26/27] rcar-vin: enable support for r8a7795 Niklas Söderlund
2017-03-14 19:03 ` [PATCH v3 27/27] rcar-vin: enable support for r8a7796 Niklas Söderlund
2017-03-16 8:36 ` Geert Uytterhoeven
2017-03-16 9:17 ` Niklas Söderlund
2017-04-24 18:14 ` Kieran Bingham [this message]
2017-04-25 14:30 ` [PATCH 2/2] rcar-vin: group: use correct of_node Niklas Söderlund
2017-04-25 14:33 ` 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=1493057666-27961-1-git-send-email-kbingham@kernel.org \
--to=kbingham@kernel.org \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=niklas.soderlund@ragnatech.se \
/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