From patchwork Thu Feb 8 09:41:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todor Tomov X-Patchwork-Id: 127276 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1312678ljc; Thu, 8 Feb 2018 01:42:26 -0800 (PST) X-Google-Smtp-Source: AH8x226GIEWwzq2x+UfgQnhWq0/a9fIT0oRftpJECAb0sj06XByX3R5cVOo+Q+jrM/mvEqt7YJQO X-Received: by 10.99.142.76 with SMTP id k73mr63651pge.278.1518082946503; Thu, 08 Feb 2018 01:42:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518082946; cv=none; d=google.com; s=arc-20160816; b=hfNfy9oIe9agGnVkgJytSe4r7YS8+Xi7DiigGBZSZLnwdDXruGjnSGYlIqmt4+/Mhj fSiTDFRAb+ssy6CAsXSHVIen6K6kg/PlQb4pMRuCiSY3NgzFrR0JaWJWqYYC9vhJ7e9E teQjSROBL8wa3PCVvQz1PWwYB5XUUP/GGkZdJTWVzssuNTGPaEH0mo6/z0qF+TjhJgw0 aOees2zgziBXCpg64lnbr2HvvyP0FLgCTdame5JeZu2LL3VS9JkiXCYbfTq5CmzuXWdT QVi45LWUl/LtcUjgEt7usRkcvRx9qzaUy3dbUW17EhbIZc2NpV0A1HWec5j4wPaJ0CIH Igcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=GIYzflLocVajN1Etsavtn8JeeMK6zjPqY7URO2kcaVo=; b=LAlzaDh0vlfz7MvHID2odJHPFPpBw+Z9ZwxV/6bJInXf1gz/RcxGCVCDkHcl5SCel+ EByAX5+0dr9szzKe+amRgaf3gZcv4Z1mtBJKQdrRn0cTJbbCzXcWc+wBAEoqaiVpW+5E z1Ir0dRMPVwhuzF4bR7MD1FVR6Zz+hGyScF22N94y0km5aI40NPqejs0XDz3wVPzt5Tr 3t3bduoQvusKN1bN4nwuQS3TBssvRCSyvXfIK/812dmgd8bGBYwVf9+5PgCL9+MnxZRz nfozWpcetySqlO7rrDDzCC6STwH6JprhWYRmZPtFFH5YPNPQbRPQYq7aOpGDLIGRW5aO LwgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k77si770311pfj.127.2018.02.08.01.42.26; Thu, 08 Feb 2018 01:42:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750930AbeBHJmY (ORCPT + 4 others); Thu, 8 Feb 2018 04:42:24 -0500 Received: from ns.mm-sol.com ([37.157.136.199]:42524 "EHLO extserv.mm-sol.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750806AbeBHJmX (ORCPT ); Thu, 8 Feb 2018 04:42:23 -0500 Received: from mms-0439.qualcomm.mm-sol.com (unknown [37.157.136.206]) by extserv.mm-sol.com (Postfix) with ESMTPSA id 89E6ACCB2; Thu, 8 Feb 2018 11:42:21 +0200 (EET) From: Todor Tomov To: mchehab@kernel.org, sakari.ailus@linux.intel.com, hverkuil@xs4all.nl Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Todor Tomov Subject: [PATCH 1/2] media: ov5645: Fix write_reg return code Date: Thu, 8 Feb 2018 11:41:59 +0200 Message-Id: <1518082920-11309-1-git-send-email-todor.tomov@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org I2C transfer functions return number of successful operations (on success). Do not return the received positive return code but instead return 0 on success. The users of write_reg function already use this logic. Signed-off-by: Todor Tomov --- drivers/media/i2c/ov5645.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c index d28845f..9755562 100644 --- a/drivers/media/i2c/ov5645.c +++ b/drivers/media/i2c/ov5645.c @@ -600,11 +600,13 @@ static int ov5645_write_reg(struct ov5645 *ov5645, u16 reg, u8 val) regbuf[2] = val; ret = i2c_master_send(ov5645->i2c_client, regbuf, 3); - if (ret < 0) + if (ret < 0) { dev_err(ov5645->dev, "%s: write reg error %d: reg=%x, val=%x\n", __func__, ret, reg, val); + return ret; + } - return ret; + return 0; } static int ov5645_read_reg(struct ov5645 *ov5645, u16 reg, u8 *val)