Received: by 10.223.176.5 with SMTP id f5csp1692574wra; Thu, 8 Feb 2018 01:45:04 -0800 (PST) X-Google-Smtp-Source: AH8x226rmLHk7CoIowbcxbVbAr/J+HXTF+VgfHH1pf2p2rQoyqXwrCDET9D1a1uw0uSIYGePFp5U X-Received: by 2002:a17:902:7889:: with SMTP id q9-v6mr106837pll.114.1518083104193; Thu, 08 Feb 2018 01:45:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518083104; cv=none; d=google.com; s=arc-20160816; b=jtC+9CU7Fx0XNvtQtcQGCd696EPcZczKxAdSzqjgQot0xhNbXdKKH2khw9RySDVSPR tKJK4CPd5P3vsCmO0ntOKMucpQWHCnWXvLJVTZnO8SU3ptvBxVyPdszmObtd9hbhZH/A 1FeBvrrUkm/EK1vczgiIFaK+GtNR1cEAoYhJVEkSZlZCpAXhq2hciZL1zUQ+EK+LCrot QiGTwGC+Y28n1g0PwtIcuPt4u5XO50RM1xmqj+qLDtmj9mv22DCpMshDF5Hm8EZM3JKp ckob3kOKsHFP4fX50LI0cou7sNmPpzO6jjKUB0HIvgjXkFPIZXKypgfUcc9OSfl1fXxR O9sQ== 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=bOhG7poyaQshAF/HlQKXc0aKJ4gWABu4GIBaRIWsBihsMJrI4i+4yUzsvGuhFoaZXM KQS5S+RmAgsmcoeG0vogYxYeOambLcC8irv/OG7Beu7ny6zsp57d64sFUp59oZFeCmos eRWB+NHGy5JNbEwcBzPSVmuUxK35oNb2Sm31CK0mlsSlC3e1Y0vpt9Xtn+iL0vDkmlA7 vN7haGSDW1iaoKgc4Hn0Or7IUSHuyFZUQOG7Ku2i74oJ6OWvPa6BoGNBhz7XVzRCd/cj TEoFivgsdsx+PGNMkrJtqnRM/67+YKpOdCrsEwose/RymGkGFTV7tD9SqbHM4HYtYFsm cjQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 j9si1070091pfe.97.2018.02.08.01.44.50; Thu, 08 Feb 2018 01:45:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1751788AbeBHJmZ (ORCPT + 99 others); Thu, 8 Feb 2018 04:42:25 -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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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) -- 2.7.4