linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: josh.wu@atmel.com (Josh Wu)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 1/5] media: soc-camera: use icd->control instead of icd->pdev for reset()
Date: Thu, 18 Dec 2014 10:27:22 +0800	[thread overview]
Message-ID: <1418869646-17071-2-git-send-email-josh.wu@atmel.com> (raw)
In-Reply-To: <1418869646-17071-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>
---
v3->v4:
  none

v2->v3:
  1. check whether icd->control is NULL or not.

 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:[~2014-12-18  2:27 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-18  2:27 [PATCH v4 0/5] media: ov2640: add device tree support Josh Wu
2014-12-18  2:27 ` Josh Wu [this message]
2014-12-18  2:27 ` [PATCH v4 2/5] media: ov2640: add async probe function Josh Wu
2014-12-18 21:59   ` Guennadi Liakhovetski
2014-12-19  6:11     ` Josh Wu
2014-12-19 22:16       ` Guennadi Liakhovetski
2014-12-22 10:27         ` Josh Wu
2014-12-24 22:39           ` Guennadi Liakhovetski
2014-12-26  6:37             ` Josh Wu
2014-12-26  9:01               ` Laurent Pinchart
2014-12-26  9:14                 ` Guennadi Liakhovetski
2014-12-26 10:06                   ` Laurent Pinchart
2014-12-26 10:38                     ` Guennadi Liakhovetski
2014-12-30  0:23                       ` Laurent Pinchart
2014-12-30  8:36                         ` Guennadi Liakhovetski
2014-12-30  8:58                           ` Laurent Pinchart
2014-12-30 10:08                           ` Josh Wu
2014-12-30 12:12                             ` Guennadi Liakhovetski
2015-01-01 17:44                               ` Laurent Pinchart
2014-12-29  8:28                     ` Josh Wu
2014-12-30  0:15                       ` Laurent Pinchart
2014-12-30 10:02                         ` Josh Wu
2015-01-01 17:43                           ` Laurent Pinchart
2014-12-18  2:27 ` [PATCH v4 3/5] media: ov2640: add primary dt support Josh Wu
2014-12-18  2:27 ` [PATCH v4 4/5] media: ov2640: add a master clock for sensor Josh Wu
2014-12-18  2:27 ` [PATCH v4 5/5] media: ov2640: dt: add the device tree binding document Josh Wu
2014-12-18 11:56   ` Laurent Pinchart
2014-12-18 12:13   ` Sylwester Nawrocki
2014-12-18 12:21     ` Fabio Estevam
2014-12-22 10:32     ` Josh Wu
2014-12-22 11:47       ` Sylwester Nawrocki

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=1418869646-17071-2-git-send-email-josh.wu@atmel.com \
    --to=josh.wu@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.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).