devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Wu <josh.wu@atmel.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	Josh Wu <josh.wu@atmel.com>
Subject: [PATCH v5 1/4] media: soc-camera: use icd->control instead of icd->pdev for reset()
Date: Tue, 10 Feb 2015 17:31:33 +0800	[thread overview]
Message-ID: <1423560696-12304-2-git-send-email-josh.wu@atmel.com> (raw)
In-Reply-To: <1423560696-12304-1-git-send-email-josh.wu@atmel.com>

icd->control is the sub device dev, i.e. i2c device.
icd->pdev is the soc camera device's device.

To be consitent with power() function, we will call reset() with
icd->control as well.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
---

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/media/platform/soc_camera/soc_camera.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index f4be2a1..7e6b914 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -688,7 +688,8 @@ static int soc_camera_open(struct file *file)
 
 		/* The camera could have been already on, try to reset */
 		if (sdesc->subdev_desc.reset)
-			sdesc->subdev_desc.reset(icd->pdev);
+			if (icd->control)
+				sdesc->subdev_desc.reset(icd->control);
 
 		ret = soc_camera_add_device(icd);
 		if (ret < 0) {
@@ -1175,7 +1176,8 @@ static void scan_add_host(struct soc_camera_host *ici)
 
 			/* The camera could have been already on, try to reset */
 			if (ssdd->reset)
-				ssdd->reset(icd->pdev);
+				if (icd->control)
+					ssdd->reset(icd->control);
 
 			icd->parent = ici->v4l2_dev.dev;
 
@@ -1461,7 +1463,7 @@ static int soc_camera_async_bound(struct v4l2_async_notifier *notifier,
 				memcpy(&sdesc->subdev_desc, ssdd,
 				       sizeof(sdesc->subdev_desc));
 				if (ssdd->reset)
-					ssdd->reset(icd->pdev);
+					ssdd->reset(&client->dev);
 			}
 
 			icd->control = &client->dev;
-- 
1.9.1

  reply	other threads:[~2015-02-10  9:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-10  9:31 [PATCH v5 0/4] media: ov2640: add device tree support Josh Wu
2015-02-10  9:31 ` Josh Wu [this message]
2015-02-10  9:31 ` [PATCH v5 2/4] media: ov2640: add async probe function Josh Wu
2015-03-01 21:06   ` Guennadi Liakhovetski
2015-03-02  1:48     ` Josh Wu
     [not found]     ` <Pine.LNX.4.64.1503012202460.2412-0199iw4Nj15frtckUFj5Ag@public.gmane.org>
2015-03-02  1:52       ` [PATCH v5 2/4][resend] " Josh Wu
2015-02-10  9:31 ` [PATCH v5 3/4] media: ov2640: add primary dt support Josh Wu
     [not found]   ` <1423560696-12304-4-git-send-email-josh.wu-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2015-02-16 16:48     ` Lad, Prabhakar
2015-02-25  3:54       ` Josh Wu
2015-02-26  0:36         ` Lad, Prabhakar
2015-02-10  9:31 ` [PATCH v5 4/4] media: ov2640: dt: add the device tree binding document Josh Wu

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=1423560696-12304-2-git-send-email-josh.wu@atmel.com \
    --to=josh.wu@atmel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=g.liakhovetski@gmx.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-media@vger.kernel.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).