From patchwork Fri Oct 14 18:34:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 2788 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp325760wrs; Fri, 14 Oct 2022 11:36:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6QAKXw9YHESK04n9FDItKGBiDeKKvKuo4fgxxKza7HrD2fQ0cdRY5kNYQ0wdMcc3z3mY91 X-Received: by 2002:a63:2a02:0:b0:42b:2711:d534 with SMTP id q2-20020a632a02000000b0042b2711d534mr5644029pgq.176.1665772618941; Fri, 14 Oct 2022 11:36:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665772618; cv=none; d=google.com; s=arc-20160816; b=OI4z2cAZu1yXISwaQyZqHBNHitu4zWVuBlZ0aWPs3iA3B0mR4YC2ZeSgxpukxCikTP 1TTbMlIAc6sagng9/OW30KuVd38xesOj6TDkeF9JyrH3/RELqKRJUyjzOAxjq2Ltvqwa SvmJWehWWZ1vRmf39wDrcIXeUleLFV4ko9tnri1X2evl2VR5oImR+NIKJJQEGKQwZCUC PxHqRGVCjuPytQCqai7krBufn4cluygGEVfzhopDKbGlL8Tms9/dHjOj62+wvMYLG7vL LyplE0yoQ2/yMyFHbHpn1qHg5nMbaI7jWPQifAWG4KBPZyQWUUi6niz3unwlE6QR/N7c pS4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FPNinP5NcVb9ViQFD23z9JvBzsucMh06jMRDsBjL9jk=; b=Ay0KS7+H6nCTpFt+OLy3ke9BGAPciDkW2cxNBP5nciS1inGdLaYsWlxBrcLbr8Vq13 YzYUBg9zhw8Q+7Bwiave1ZekPiGlf0lX4YeGy00vwuoN1QrwNeeYcmzVqiQ5YuwRbrb8 jie4FtSGGJO+jaY0RAafJQa08GHpLGovbqsDtYvGtSzuaL/hIBhpFVBpktJriYQgJVWj 3zga8Ab6cYa/KHoZ/uU6EGxEtVH8nocOePBctrub1mnTH/jHubYirJoA8gUXpgALrmQZ 9tB+tXrLIdXxOA1qTR5Y4OPuo1dVh+I83T6N4PlrUoe4BCGx+9Tk4KM1VIf6RXqHsJRG irig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=K3ZIGnYT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k18-20020a170902c41200b00172e069021dsi4073808plk.469.2022.10.14.11.36.45; Fri, 14 Oct 2022 11:36:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=K3ZIGnYT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229683AbiJNSfy (ORCPT + 99 others); Fri, 14 Oct 2022 14:35:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231130AbiJNSfb (ORCPT ); Fri, 14 Oct 2022 14:35:31 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 857C4A7A99; Fri, 14 Oct 2022 11:35:23 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id r13so8846637wrj.11; Fri, 14 Oct 2022 11:35:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FPNinP5NcVb9ViQFD23z9JvBzsucMh06jMRDsBjL9jk=; b=K3ZIGnYTG2IW438XZKj0WhZ+OGMxdF8aRcvKK9NtgqDu/HP4htzpzZP5o4f6MqSCNn hoDyxzJP5TSGezWugWfiKaUdYwng+RoV0hCpMm+dava7Kf8Y7i0X09qMAxg58qrqFS56 49X+On/sn8fp+tQfes6gRmGRmp6yJskbhBVD6gjINZ3nhKtrcNSe0b434f/2idDVba5S 1ASPzAUmhBiGb6aXngjNu3ZSL78xhXOqlqgLmad4HP7ToGqNIUolv8EJgMdkr2CVv/4T 1M4k2F5fpbP+82IboWoD+wVeYUnHJK19a3gP/dWYxvpiwZ7kxEjqe/N8cQM7oFz3e31Q PnMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FPNinP5NcVb9ViQFD23z9JvBzsucMh06jMRDsBjL9jk=; b=tbNvugd/stySTJmTLWIHLVs8t61V/u57XlkwRLBS0IKjTwpVH/u1dQ7q340BPOt9j2 f1LQ4WlvbPHv2RTIsDVu0TX+/qtXWaIHOt441EXXopeaLlkVsDgRPO1PTbL/iMhwHn5v tR+cuc3bMa99UdkFCE20KeTJ15HmUpaLvEGseiuNCGhqJ7f44gQYLUgiKUWYO1HNucnw TxZzfV2WLrVG4FjmCKRcxhF62OUTH1cdaot3YJDGXoCM22J4n8X4y8lO3RBUyagw2TXj skZY6PeOr0P5H+xSuJr4pRhWxGzQxZ9h+WgCZUznh3iNjmim5iZIPGJVXkls4ObboeQb g1AA== X-Gm-Message-State: ACrzQf0UFDVOWALkJKDvyXeoX1117ojsYK/tcOeZAt7SiyCCdNuxy/iP GrASPFoJRC/UUv4mcn0DEa8= X-Received: by 2002:a05:6000:1565:b0:22f:1407:9bfd with SMTP id 5-20020a056000156500b0022f14079bfdmr4240073wrz.620.1665772521673; Fri, 14 Oct 2022 11:35:21 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2501:c701:fc4d:6548:d8bd:5bd]) by smtp.gmail.com with ESMTPSA id h10-20020a5d504a000000b0022a403954c3sm2485410wrt.42.2022.10.14.11.35.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 11:35:21 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Krzysztof Kozlowski , Rob Herring , Mauro Carvalho Chehab , Hans Verkuil Cc: Shawn Tu , Jacopo Mondi , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Lad Prabhakar Subject: [PATCH v2 4/5] media: i2c: ov5645: Return zero for s_stream(0) Date: Fri, 14 Oct 2022 19:34:58 +0100 Message-Id: <20221014183459.181567-5-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221014183459.181567-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20221014183459.181567-1-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746689189507507635?= X-GMAIL-MSGID: =?utf-8?q?1746689189507507635?= From: Lad Prabhakar Always return zero while stopping the stream as the caller will ignore the return value. This patch drops checking the return value of ov5645_write_reg() and continues further in the code path while stopping stream. The user anyway gets an error message in case ov5645_write_reg() fails. Suggested-by: Sakari Ailus Signed-off-by: Lad Prabhakar --- v1->v2 * New patch --- drivers/media/i2c/ov5645.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c index a0b9d0c43b78..b3825294aaf1 100644 --- a/drivers/media/i2c/ov5645.c +++ b/drivers/media/i2c/ov5645.c @@ -995,14 +995,11 @@ static int ov5645_s_stream(struct v4l2_subdev *subdev, int enable) if (ret < 0) goto err_rpm_put; } else { - ret = ov5645_write_reg(ov5645, OV5645_IO_MIPI_CTRL00, 0x40); - if (ret < 0) - return ret; + ov5645_write_reg(ov5645, OV5645_IO_MIPI_CTRL00, 0x40); + + ov5645_write_reg(ov5645, OV5645_SYSTEM_CTRL0, + OV5645_SYSTEM_CTRL0_STOP); - ret = ov5645_write_reg(ov5645, OV5645_SYSTEM_CTRL0, - OV5645_SYSTEM_CTRL0_STOP); - if (ret < 0) - return ret; pm_runtime_put(ov5645->dev); }