Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1587932pxk; Fri, 4 Sep 2020 13:21:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1UziaN42pdgs+/QOhbBmb6jXduRZmczZk14J6DP7U4bqkTp5Dlzv7v6/T0sK5FeKIraW1 X-Received: by 2002:a50:c909:: with SMTP id o9mr10467738edh.148.1599250885595; Fri, 04 Sep 2020 13:21:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599250885; cv=none; d=google.com; s=arc-20160816; b=be0vd9Gqq+clM61X3reKLrTSPb05QstFieHirGiVYq22S+Aa6S5veHVizOyVbEpyuL BRj8SFWrltFgIXEOQCnLq0RTJclIZTMOAijh9a7FJd43p+FTPPzPpQwMKm5nxf4FrZ3/ Jqqxfob+XE51bMISQ+DbXtn3uQdkmeCVW0dh/J/L6OHv4xI1OOcFyPpT6D6ZeEH4dy3d +fN6Em9bcr5RIFviCzeqtCkyw6Z9HgT6ysu+bkBN5jxw6hDj+Zj1/vvio8qEdV0VVSYT RUyNz5QkFf7FiEnFCDlbRnD2UM4DmSubUY1U9JHyQmCmW4fvoET6XzC+g4ymAkR+kncN pgXA== 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=dm6+v9jRo3M/1vCWJCQyjc2nxPNGWWHStMQB5Kfv1q0=; b=e0IwdaFwRSOa1ksxD4ROiysy7Vm5B1gC7jY7U18tnj69r05a7DFzzXMMN8g0UIpUej rKtYEVSor9wegZL6PVQbR6ggFjxAluDEXi4MFtE1NuHGAITsRnIvDpV5vrGLY6mcnmu4 KugzU4FC2WtPT/Z9puJuKMX5B9rn06RZVk0Y1HF7RVIkWJXQWELZXWLLb/ylAFsVcQNo 896jKvYsJOdxsMpJVK7Sz3BtfoCH2nFjsHoFk8eXmjZL3jUUPKCb8DsxJrFNPf1CX8fe 1XmOoZiL6pOwjUdY5GF1JpUbOCIlxpBCM0aLn8EDCqNFsMjND6ikwj38o5379O3wthTz yY6w== 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 n19si4675562edq.82.2020.09.04.13.21.03; Fri, 04 Sep 2020 13:21:25 -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 S1728209AbgIDUTQ (ORCPT + 99 others); Fri, 4 Sep 2020 16:19:16 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:40698 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726842AbgIDUTD (ORCPT ); Fri, 4 Sep 2020 16:19:03 -0400 X-IronPort-AV: E=Sophos;i="5.76,391,1592838000"; d="scan'208";a="56410453" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 05 Sep 2020 05:19:02 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 2657D400C441; Sat, 5 Sep 2020 05:18:59 +0900 (JST) From: Lad Prabhakar To: Jacopo Mondi , Sakari Ailus , Laurent Pinchart , Steve Longerbeam , Paul , Hugues Fruchet Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Lad Prabhakar , Biju Das , Prabhakar , Mauro Carvalho Chehab Subject: [PATCH v4 6/6] media: i2c: ov5640: Fail probe on unsupported bus_type Date: Fri, 4 Sep 2020 21:18:35 +0100 Message-Id: <20200904201835.5958-7-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200904201835.5958-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20200904201835.5958-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 Reviewed-by: Jacopo Mondi --- 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 96daeb5d6a27..ce39abf41b48 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -3072,6 +3072,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