From patchwork Wed May 8 11:58:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_R=C3=83=C2=A9tornaz?= X-Patchwork-Id: 2538681 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 1BDB03FC5A for ; Wed, 8 May 2013 12:06:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754734Ab3EHMGZ (ORCPT ); Wed, 8 May 2013 08:06:25 -0400 Received: from smtp4.epfl.ch ([128.178.224.219]:45881 "HELO smtp4.epfl.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754169Ab3EHMGZ (ORCPT ); Wed, 8 May 2013 08:06:25 -0400 X-Greylist: delayed 399 seconds by postgrey-1.27 at vger.kernel.org; Wed, 08 May 2013 08:06:24 EDT Received: (qmail 19712 invoked by uid 107); 8 May 2013 11:59:41 -0000 X-Virus-Scanned: ClamAV Received: from lsro1pc40.epfl.ch (HELO lsro1arena.8.8.4.4) (128.178.145.86) (authenticated) by smtp4.epfl.ch (AngelmatoPhylax SMTP proxy) with ESMTPA; Wed, 08 May 2013 13:59:41 +0200 From: =?UTF-8?q?Philippe=20R=C3=A9tornaz?= To: Mauro Carvalho Chehab , Guennadi Liakhovetski Cc: linux-media@vger.kernel.org, =?UTF-8?q?Philippe=20R=C3=A9tornaz?= Subject: [PATCH 1/1] mt9t031: Fix panic on probe Date: Wed, 8 May 2013 13:58:54 +0200 Message-Id: <1368014334-23680-1-git-send-email-philippe.retornaz@epfl.ch> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The video device is not yet valid when probe() is called. Call directly soc_camera_power_on/off() instead of calling mt9t031_s_power(). Signed-off-by: Philippe Rétornaz --- drivers/media/i2c/soc_camera/mt9t031.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/soc_camera/mt9t031.c b/drivers/media/i2c/soc_camera/mt9t031.c index d80d044..71c0b16 100644 --- a/drivers/media/i2c/soc_camera/mt9t031.c +++ b/drivers/media/i2c/soc_camera/mt9t031.c @@ -632,10 +632,11 @@ static int mt9t031_s_power(struct v4l2_subdev *sd, int on) static int mt9t031_video_probe(struct i2c_client *client) { struct mt9t031 *mt9t031 = to_mt9t031(client); + struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client); s32 data; int ret; - ret = mt9t031_s_power(&mt9t031->subdev, 1); + ret = soc_camera_power_on(&client->dev, ssdd); if (ret < 0) return ret; @@ -664,7 +665,7 @@ static int mt9t031_video_probe(struct i2c_client *client) ret = v4l2_ctrl_handler_setup(&mt9t031->hdl); done: - mt9t031_s_power(&mt9t031->subdev, 0); + soc_camera_power_off(&client->dev, ssdd); return ret; }