Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp861246imm; Wed, 13 Jun 2018 09:22:52 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKjBh3/8P0279AoxuMsvJo4xoj8+0FmpXeGEQc2yX3eSgbA8W56js6q/BCprIRfpYvPotkz X-Received: by 2002:a63:648:: with SMTP id 69-v6mr4678442pgg.205.1528906972167; Wed, 13 Jun 2018 09:22:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528906972; cv=none; d=google.com; s=arc-20160816; b=DQXBIpXmyIRN43Fu6offfj6gxyrrHq5c5TEFacI0FflO49YNBhphGwehn/adkhjy15 FeUWRwP7BZiwdIOaxBBy9kJrWU5aLMgckLIQSDsrVZv7VFXsusNh8TOkdi1/kCOL4337 iEiUn4SCzPe8OLJDdLFgARuid/JBYRErrRvYm6smBZaERNcXXDiQy8O0lSFgcLXccZ5M Jcsh3QAHpWX7h+KZPm8ughM0s3p1RrCtrTbxQWR1aCRBPEjT7PKlaAdfoG6ewohlR0AW yld1i0Y/3EEqBFZRDLX+qYqcrmD1+U4sigfHt+srjqvQv+OVyIyiwGJa75f0D5wkqqXU iq7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=pOa2Lu28GTP6CdJSxbbhkSqc8gubda1lGYwP3thNWOg=; b=LBIyi5EU4vUE6tbf6gHEJNZeblKO+YtlTK42Ep5cPhYeVEbmfRDSpsqX12XLl7QJLG b2IewueC5NWtRxcxDG9rUAqkZ34W4PrpS2/bLHS8/D57BWF3KKpkslg99UNrdhf/sZkb vHLrseaaJ4Nd7jtZeUoMe5rqKUiqyAYE7dbiNIKMgXdbv6bxfHOwZy33TbtNim7wB6ey rqLcHkG5u6rleJBjHoizZI5E2ucltF2b1xfLqt7fML81/yoUgflMVFGzwfnS3FnyK/JQ 1jhjXG1sm4vGvhCkWSV2e4aOpWEMz+KG9b1HZnnRDLjDbO+rkWDDaVyCzuZ99hjDosXi sr/w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w61-v6si3102679plb.502.2018.06.13.09.22.37; Wed, 13 Jun 2018 09:22:52 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934961AbeFMQVR (ORCPT + 99 others); Wed, 13 Jun 2018 12:21:17 -0400 Received: from mailoutvs39.siol.net ([185.57.226.230]:45095 "EHLO mail.siol.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754498AbeFMQVN (ORCPT ); Wed, 13 Jun 2018 12:21:13 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTP id 74222520C01; Wed, 13 Jun 2018 18:21:10 +0200 (CEST) X-Virus-Scanned: amavisd-new at psrvmta11.zcs-production.pri Received: from mail.siol.net ([127.0.0.1]) by localhost (psrvmta11.zcs-production.pri [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id eMnrL9tp_yVf; Wed, 13 Jun 2018 18:21:09 +0200 (CEST) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTPS id C1FD652106A; Wed, 13 Jun 2018 18:21:09 +0200 (CEST) Received: from jernej-laptop.localnet (unknown [194.152.15.144]) (Authenticated sender: 031275009) by mail.siol.net (Postfix) with ESMTPA id BF79A521069; Wed, 13 Jun 2018 18:21:08 +0200 (CEST) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: linux-sunxi@googlegroups.com, wens@csie.org Cc: Maxime Ripard , Rob Herring , David Airlie , Gustavo Padovan , Maarten Lankhorst , Sean Paul , Mark Rutland , dri-devel , devicetree , linux-arm-kernel , linux-kernel , linux-clk Subject: Re: [linux-sunxi] Re: [PATCH v2 14/27] drm/sun4i: Don't check for panel or bridge on TV TCONs Date: Wed, 13 Jun 2018 18:20:07 +0200 Message-ID: <2662622.yHSNrIAaJ9@jernej-laptop> In-Reply-To: References: <20180612200036.21483-1-jernej.skrabec@siol.net> <20180613074621.5phumovcyymbkfbn@flea> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dne sreda, 13. junij 2018 ob 10:04:20 CEST je Chen-Yu Tsai napisal(a): > On Wed, Jun 13, 2018 at 3:46 PM, Maxime Ripard > > wrote: > > On Tue, Jun 12, 2018 at 10:00:23PM +0200, Jernej Skrabec wrote: > >> TV TCONs are always connected to TV or HDMI encoder, so it doesn't make > >> sense to check if panel or bridge is connected to them. > >> > >> Check if TCON has channel 0 and only then check for connected panel or > >> bridges. > >> > >> Signed-off-by: Jernej Skrabec > >> --- > >> > >> drivers/gpu/drm/sun4i/sun4i_tcon.c | 12 +++++++++--- > >> 1 file changed, 9 insertions(+), 3 deletions(-) > >> > >> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c > >> b/drivers/gpu/drm/sun4i/sun4i_tcon.c index b1205a7bc20f..c9ffa5381185 > >> 100644 > >> --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c > >> +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c > >> @@ -1189,13 +1189,19 @@ static const struct component_ops sun4i_tcon_ops > >> = {>> > >> static int sun4i_tcon_probe(struct platform_device *pdev) > >> { > >> > >> struct device_node *node = pdev->dev.of_node; > >> > >> + const struct sun4i_tcon_quirks *quirks; > >> > >> struct drm_bridge *bridge; > >> struct drm_panel *panel; > >> int ret; > >> > >> - ret = drm_of_find_panel_or_bridge(node, 1, 0, &panel, &bridge); > >> - if (ret == -EPROBE_DEFER) > >> - return ret; > >> + quirks = of_device_get_match_data(&pdev->dev); > > > > We should probably check ofr the pointer value before dereferencing it. > > I think we've discussed this before. If the driver has data structures > for all the supported compatible strings, and it is device tree only, > then we should just let it blow up in the user's face, since they are > obviously doing something they shouldn't be doing to get the driver > to probe without a compatible string match. TCON can't work with no quirks specified, since that would mean that neither channels are present. Additionally, sun4i_tcon_bind() also doesn't check if quirks are NULL or not. So I concur with Chen-Yu here. Best regards, Jernej