From patchwork Thu Mar 26 10:35:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Riesen X-Patchwork-Id: 210429 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 361F4C43331 for ; Thu, 26 Mar 2020 11:00:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 161412073E for ; Thu, 26 Mar 2020 11:00:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727959AbgCZLAX (ORCPT ); Thu, 26 Mar 2020 07:00:23 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:51849 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727590AbgCZLAX (ORCPT ); Thu, 26 Mar 2020 07:00:23 -0400 Received: from mail.cetitecgmbh.com ([87.190.42.90]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MORVA-1isklH3vIs-00PsZ0 for ; Thu, 26 Mar 2020 12:00:21 +0100 Received: from pflvmailgateway.corp.cetitec.com (unknown [127.0.0.1]) by mail.cetitecgmbh.com (Postfix) with ESMTP id B39796502CC for ; Thu, 26 Mar 2020 11:00:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at cetitec.com Received: from mail.cetitecgmbh.com ([127.0.0.1]) by pflvmailgateway.corp.cetitec.com (pflvmailgateway.corp.cetitec.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rsBBgx-1BaWp for ; Thu, 26 Mar 2020 12:00:21 +0100 (CET) Received: from pfwsexchange.corp.cetitec.com (unknown [10.10.1.99]) by mail.cetitecgmbh.com (Postfix) with ESMTPS id 6160564F400 for ; Thu, 26 Mar 2020 12:00:21 +0100 (CET) Received: from pflmari.corp.cetitec.com (10.8.5.79) by PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 26 Mar 2020 12:00:21 +0100 Received: by pflmari.corp.cetitec.com (Postfix, from userid 1000) id DD5CD80504; Thu, 26 Mar 2020 11:35:42 +0100 (CET) Date: Thu, 26 Mar 2020 11:35:42 +0100 From: Alex Riesen To: Kieran Bingham CC: Geert Uytterhoeven , Mauro Carvalho Chehab , Hans Verkuil , "Laurent Pinchart" , Rob Herring , Mark Rutland , Kuninori Morimoto , , , , , Subject: [PATCH v4 7/9] media: adv748x: only activate DAI if it is described in device tree Message-ID: Mail-Followup-To: Alex Riesen , Kieran Bingham , Geert Uytterhoeven , Mauro Carvalho Chehab , Hans Verkuil , Laurent Pinchart , Rob Herring , Mark Rutland , Kuninori Morimoto , devel@driverdev.osuosl.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Originating-IP: [10.8.5.79] X-ClientProxiedBy: PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) To PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) X-EsetResult: clean, is OK X-EsetId: 37303A290D7F536A6D7C67 X-Provags-ID: V03:K1:PYvKiwuBoOvAlT4fazJ4+X72qdK9sEdBY3wBGKRwLo4rYthOYyA PbwaHT3uwIz/7lPjoo3a9B0qE0a5MO43oIaoob4EJRdUpzz6g2UVTEVPjBnL0Nx4Cg6Uuio 54Ey0D9ZqODLTndVdupdsn2YS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ux-media@vger.kernel.org To avoid setting it up even if the hardware is not actually connected to anything physically. Besides, the bindings explicitly notes that port definitions are "optional if they are not connected to anything at the hardware level". Signed-off-by: Alexander Riesen --- drivers/media/i2c/adv748x/adv748x-dai.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/i2c/adv748x/adv748x-dai.c b/drivers/media/i2c/adv748x/adv748x-dai.c index 185f78023e91..f9cc47fa9ad1 100644 --- a/drivers/media/i2c/adv748x/adv748x-dai.c +++ b/drivers/media/i2c/adv748x/adv748x-dai.c @@ -216,6 +216,11 @@ int adv748x_dai_init(struct adv748x_dai *dai) int ret; struct adv748x_state *state = adv748x_dai_to_state(dai); + if (!state->endpoints[ADV748X_PORT_I2S]) { + adv_info(state, "no I2S port, DAI disabled\n"); + ret = 0; + goto fail; + } dai->mclk_name = kasprintf(GFP_KERNEL, "%s.%s-i2s-mclk", state->dev->driver->name, dev_name(state->dev));