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: 2656 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Tue, 09 Feb 2010 08:47:22 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.6) for (single-drop); Tue, 09 Feb 2010 09:51:16 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1Nelkf-0007AU-QW; Tue, 09 Feb 2010 08:47:22 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751999Ab0BIIrU (ORCPT + 1 other); 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 From: Magnus Damm Update the soc-camera i2c code to return -ENODEV if a camera sensor is missing instead of -ENOMEM. Signed-off-by: Magnus Damm --- drivers/media/video/soc_camera.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 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)