From patchwork Tue Feb 9 08:40:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 77969 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o198lLg6025394 for ; Tue, 9 Feb 2010 08:47:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751999Ab0BIIrU (ORCPT ); Tue, 9 Feb 2010 03:47:20 -0500 Received: from mail-yw0-f189.google.com ([209.85.211.189]:59253 "EHLO mail-yw0-f189.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751762Ab0BIIrU (ORCPT ); Tue, 9 Feb 2010 03:47:20 -0500 Received: by ywh27 with SMTP id 27so6298337ywh.1 for ; Tue, 09 Feb 2010 00:47:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=S/JJ+4kN2ZguAclESxDzbTHkzsSux5qsx2IDB5mI6ms=; b=QAnaeJIw/H9XnXkTU6Bsob5kqIpaSMPkAgG8AmNOWFMcCcc62k91QQziASL/BXv6OX n2/zoDB+Deu31jn5p3Qn7XhU1bngC5vmb1q8O9M1o7CbLQlHyEroUB2R4fHp5lEpzvLo IBYAR+Mtuk9D8AhreZbZN32i8XDTKPblLshbs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=yEauUlm+nFmAfT/x77Y+xZSTspxIUJGWFOAllOD8Gp75IWWBeyDJU9c6/oI7Qy/vQv ZR2fgSWSnr8S0BAhKT1KzPKfQUcuCSDgg1KvIFLDphChNRWe5uyOR2FavFXU1RJ73NNi llXfZVl3ItZqoTtQnldwn89MneznejUVRg4KE= Received: by 10.90.155.9 with SMTP id c9mr1122820age.38.1265705239303; Tue, 09 Feb 2010 00:47:19 -0800 (PST) Received: from rxone.opensource.se (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id 16sm3503815gxk.7.2010.02.09.00.47.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 09 Feb 2010 00:47:18 -0800 (PST) From: Magnus Damm To: linux-media@vger.kernel.org Cc: Magnus Damm , g.liakhovetski@gmx.de Date: Tue, 09 Feb 2010 17:40:40 +0900 Message-Id: <20100209084040.29907.35986.sendpatchset@rxone.opensource.se> Subject: [PATCH] soc-camera: return -ENODEV is sensor is missing Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 09 Feb 2010 08:47:23 +0000 (UTC) --- 0001/drivers/media/video/soc_camera.c +++ work/drivers/media/video/soc_camera.c 2010-02-09 17:32:58.000000000 +0900 @@ -846,10 +846,8 @@ static int soc_camera_init_i2c(struct so struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); struct i2c_adapter *adap = i2c_get_adapter(icl->i2c_adapter_id); struct v4l2_subdev *subdev; - int ret; if (!adap) { - ret = -ENODEV; dev_err(&icd->dev, "Cannot get I2C adapter #%d. No driver?\n", icl->i2c_adapter_id); goto ei2cga; @@ -859,10 +857,8 @@ static int soc_camera_init_i2c(struct so subdev = v4l2_i2c_new_subdev_board(&ici->v4l2_dev, adap, icl->module_name, icl->board_info, NULL); - if (!subdev) { - ret = -ENOMEM; + if (!subdev) goto ei2cnd; - } client = subdev->priv; @@ -873,7 +869,7 @@ static int soc_camera_init_i2c(struct so ei2cnd: i2c_put_adapter(adap); ei2cga: - return ret; + return -ENODEV; } static void soc_camera_free_i2c(struct soc_camera_device *icd)