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: 10206811 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4AB6A600F6 for ; Thu, 8 Feb 2018 09:42:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 408152902B for ; Thu, 8 Feb 2018 09:42:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 337482903A; Thu, 8 Feb 2018 09:42:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4B7D29079 for ; Thu, 8 Feb 2018 09:42:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750930AbeBHJmY (ORCPT ); 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 X-Virus-Scanned: ClamAV using ClamSMTP 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)