Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp3937372ybn; Fri, 27 Sep 2019 13:38:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGVe/J9PyMrozTf0tK7p8oLyX3N3OC4VEZqKm/n/zylU5mxWGVVVtCcIKc5i1Z3fd1toF/ X-Received: by 2002:a17:906:e0c2:: with SMTP id gl2mr9536010ejb.157.1569616728231; Fri, 27 Sep 2019 13:38:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569616728; cv=none; d=google.com; s=arc-20160816; b=NH5IZCtAQUJO/qnEGHUMryZqU5B4a0B3FIuDzOGlTBsK6RetmyKab8Yw1cI0mOqJ3F nt/XiCCIF1ROyvpmS70UqSejX0xMX+VAGPlnicnWJsfucQajhmRSqa4iFwzm6FcoRbmy 0Z/19eHqhSptr+ydwuGjawJZfFZv6ROp9dkACevz3n/cIZbryC/SXhnKwFM1gpEKgBI8 AdMhYDhIZrqVs0C4ycTjQ9RGXC0LmQCIaBcQHvuXtC0gEaiLT+J23kKas2UbT/TaLhFn pSo6YonYfREOhuqlVaDlB0sIYJ00A8iMhCQPS8+WOK5FTeW1+cuFqXLPUIHAnxE5dZFB Vl/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=86XODwKrlVopUkndt2vCBDWtscRr9iPDGHIPZ2Bvuuo=; b=THR1fxqFfE3/ylYdzN4JE6Vn/uvXv8NH6OnmRAu0XQmS6YJxcmV5aGAdHq6NbAykEp B/RbTwvprhyn3VEmkAyq88e2lx1oGV+cmST9mGInCfw2vkOcGHxu/mdmB9aCbQBV7ezc CMetMWbPZ+6NboLJZ+/U+QjmkK7b6fnPir/chFLaCn669qmzuBY8yUNLJZ/hO3KpY35Y 0BDhRhimw3v9d186gOsADNV7tpK/yt1GiUFExAnVd0o2iCKeE5NQhdZ2vGXl5rw+VpU2 FiapznSa0t0a/z16AualCUC47YjKlkie6KIe/wYqZa7AiMLOU86MR1quERk+7r6k6wZQ aW6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SV7Kh4kH; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t26si3073942eju.238.2019.09.27.13.38.23; Fri, 27 Sep 2019 13:38:48 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SV7Kh4kH; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728275AbfI0Ufw (ORCPT + 99 others); Fri, 27 Sep 2019 16:35:52 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:44005 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725789AbfI0Ufw (ORCPT ); Fri, 27 Sep 2019 16:35:52 -0400 Received: by mail-oi1-f196.google.com with SMTP id t84so6295999oih.10; Fri, 27 Sep 2019 13:35:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=86XODwKrlVopUkndt2vCBDWtscRr9iPDGHIPZ2Bvuuo=; b=SV7Kh4kHFdsnSQv5lv8w1TDNdx5Vkq7Gqu8OKtbYMf1uA3zyRXqrYTtCXU97ro69Ha y+eZP1hPjdC39nbw07sYb34CSn9RGowUIi4ikmlsJloZjCxP1E+CUgzteHHDFoHKFLz/ 8ZA02dx7ln2OArTwYSlCNPSsjmm76UEipYE9tFrwRex0nEA4r6n62dayB8R092ZGaYJL 1IBJ7NmsR/WNj7D1IVsgJgZeswqVXen3LTPw3oz5wZpoRD9HCdc+/4l8Kj6sReS5O0SN qzClYTok3I/IKiSDqGjH8fy5Fkz647JkhrkGjj2UsDg4h/6f+TdAh5M6RP0mwV0Fm8S3 jW8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=86XODwKrlVopUkndt2vCBDWtscRr9iPDGHIPZ2Bvuuo=; b=K/Q5DhgQ0OxtgCT32WshISEBgj31Hnhi/P4BkRhalE+F+2Bfj+11rZ4l1lUWLgVwDg ZFBHiy2ye+RFrcysA+LxVlcVNr5WYTVB+A3EUF6XHJLPDNHaEobWKsNR97TkcxY9aPYX 7OIRl92z1ZTMTKXwQiqA4AdowrmYK5bXbsisHHdXakKWTJLsGvl0DcBU0vlWBz9VhloB hJm2CnxyMxMj47JiUBq27GwZ0BdsbwkX+LWmaubDEvkTOG4vJpi/ffyAumivWOJGlYzR xMcP6mE2LtM/sJdM2Lr67XCCbsZCaBkP/IoL6Id4w0DKbjeZGlUNU2DMNMpudJ2JyKcR a+CA== X-Gm-Message-State: APjAAAXanNyRsmqiWU+DCcUXoZ/i+QcGu9H6rCF3a8rcIQyeHRuIoFjW F9+gE07VMWtyRVrYtslkNrD/kIqd/JtyzPqxUuxcv1+eGk0= X-Received: by 2002:aca:5ed4:: with SMTP id s203mr8476773oib.101.1569616551443; Fri, 27 Sep 2019 13:35:51 -0700 (PDT) MIME-Version: 1.0 References: <20190927184722.31989-1-bparrot@ti.com> <20190927184722.31989-3-bparrot@ti.com> In-Reply-To: <20190927184722.31989-3-bparrot@ti.com> From: "Lad, Prabhakar" Date: Fri, 27 Sep 2019 21:35:25 +0100 Message-ID: Subject: Re: [Patch v4 2/8] media: i2c: ov2659: Fix sensor detection to actually fail when device is not present To: Benoit Parrot Cc: Hans Verkuil , Sakari Ailus , linux-media , devicetree@vger.kernel.org, LKML , Jyri Sarha Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 27, 2019 at 7:47 PM Benoit Parrot wrote: > > Make sure that if the expected sensor device id register > is not recognized properly the failure is propagated > up so devices are not left partially initialized. > > Signed-off-by: Benoit Parrot > Signed-off-by: Jyri Sarha > --- > drivers/media/i2c/ov2659.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > Acked-by: Lad, Prabhakar Cheers, --Prabhakar Lad > diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c > index 17573257097d..efbe6dc720e2 100644 > --- a/drivers/media/i2c/ov2659.c > +++ b/drivers/media/i2c/ov2659.c > @@ -1330,11 +1330,12 @@ static int ov2659_detect(struct v4l2_subdev *sd) > unsigned short id; > > id = OV265X_ID(pid, ver); > - if (id != OV2659_ID) > + if (id != OV2659_ID) { > dev_err(&client->dev, > "Sensor detection failed (%04X, %d)\n", > id, ret); > - else { > + ret = -ENODEV; > + } else { > dev_info(&client->dev, "Found OV%04X sensor\n", id); > ret = ov2659_init(sd, 0); > } > -- > 2.17.1 >