Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1524362pxa; Thu, 13 Aug 2020 10:16:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUITkGeMMgWCNWA3u1S1q4jwUkQdRd62p4M4pSspcyxiDwhsa36rsZLqyxMSlgb8Q7x91Q X-Received: by 2002:aa7:da8c:: with SMTP id q12mr5816008eds.126.1597338962492; Thu, 13 Aug 2020 10:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597338962; cv=none; d=google.com; s=arc-20160816; b=a46QsQ0/VtKNp1S0H/5EF1+Pz2IN5xo8UO7ahjOEi77hhGDBJyNwfKmtMUoVHzDL9e 0sLFClaP7/QCHP9HoQob6Z68FVrLJxuXAMOufVvLGadCnnB3EP+N4chpDMlin7GpEJCN IWJ1FrIMAsOXL0N2jdeE48xVt92hgXM0y263vaN2XNNkTIkiuAQrZgWx/5ancu8suPsg U8cLEHchOhl/9M+zrRp14+3JBxa0XfkWc6RByFzO2pXrQmsgmZGgWohEn3d/Eun3bE1u d3oojDtojJPpCmnP/Y2HrjdqEaM0bVdCFertlnHopl103zKf80gOyqSNu0iLt9tPGZtA 7Q0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=DIJubdNQgCo+/2MudZ962mD5f3iOC9wlGEMAA8J5ncg=; b=azXPQJEV4lVgV22KzAcRN47qadcIdr0zDvCMjXMRCiOnUN8RVuLs6LxAuogdGlbNyg 8UBCcdVYt5GKMWJTq1TqksNY7+/8D1nkB3BHp9bEZw1EmEE/GtnlPNYDwrAOAqywLHX2 g/ArreJ4qAwA3BCqCymY0rYU7epCPtPA/0rGzSMNuAd0m+BrokgU2CpGGmoSgafW3nNt jed7FxXh0sHM/t3Vn4uXxqM3JRVYW/Wvhy1IdG8Mats2clrMLODzpQldhbVolxpEeLng YJ+t1CKbdKxthotmrz5uUKjcofXrSE5kU7IjF5j1CXtOjAO0Ig+pMnpjQjRVJbqInxBo 2dlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bz27si3590863ejc.415.2020.08.13.10.15.39; Thu, 13 Aug 2020 10:16:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726683AbgHMRON (ORCPT + 99 others); Thu, 13 Aug 2020 13:14:13 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:28876 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726384AbgHMROK (ORCPT ); Thu, 13 Aug 2020 13:14:10 -0400 X-IronPort-AV: E=Sophos;i="5.76,309,1592838000"; d="scan'208";a="54312916" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 14 Aug 2020 02:14:07 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id B8D714005E0F; Fri, 14 Aug 2020 02:14:05 +0900 (JST) From: Lad Prabhakar To: Steve Longerbeam , Jacopo Mondi , Sakari Ailus , Laurent Pinchart , Paul , Hugues Fruchet Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Lad Prabhakar , Prabhakar Subject: [PATCH v3 3/3] media: i2c: ov5640: Fail probe on unsupported bus_type Date: Thu, 13 Aug 2020 18:13:37 +0100 Message-Id: <20200813171337.5540-4-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200813171337.5540-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20200813171337.5540-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fail probe if unsupported bus_type is detected. Signed-off-by: Lad Prabhakar --- drivers/media/i2c/ov5640.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index 160d2857352a..3191e2b223c3 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -3078,6 +3078,13 @@ static int ov5640_probe(struct i2c_client *client) return ret; } + if (sensor->ep.bus_type != V4L2_MBUS_PARALLEL && + sensor->ep.bus_type != V4L2_MBUS_CSI2_DPHY && + sensor->ep.bus_type != V4L2_MBUS_BT656) { + dev_err(dev, "Unsupported bus type %d\n", sensor->ep.bus_type); + return -EINVAL; + } + /* get system clock (xclk) */ sensor->xclk = devm_clk_get(dev, "xclk"); if (IS_ERR(sensor->xclk)) { -- 2.17.1