Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp345507imm; Wed, 13 Jun 2018 01:05:34 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI0+NAWr7V9oJiW50mxeHIb5AwXfsOeToKt5gE5ZDhsBiDGPlpBXbFzGnlU+Jl0jynudgX0 X-Received: by 2002:a65:660a:: with SMTP id w10-v6mr3138387pgv.366.1528877134372; Wed, 13 Jun 2018 01:05:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528877134; cv=none; d=google.com; s=arc-20160816; b=NXzHuvgkvnp6qSBKETWWvZDlSa9WiLVguJrKtpui1m93UkJIJy3NzOYe/JfJdmMAs+ hDCvrkw7W7YYo/pwmvtmYeyZ9yoPbSawNrtrBTh94cllouNYqdHoiIqZMzsuYSkpFy/+ vBs+Uh4vAL2yJBqbU9fqeKRbiegISArFmTFiwPfSaUuEggbcNKx/FoUwG0xDyAvJEQ6b X6++AvXgUddCu/APWKuYxgWSeoZvCzBATLbwimsxp1yK/zjpPXfUotV1Z0uNEs1v9jMN WORelbpAS+mQp2xUNObfrSOgv5bACVYo6Oce3bpDf5+BQg9QPon1xVUrDfR939oLiZnl qOzA== 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 :references:in-reply-to:mime-version:arc-authentication-results; bh=2KwO9bdDHrW4VEGYUkZAbm/f3ErEFVi8KQjEohL0RUc=; b=rBOCuL3zmtZSR+EG2PE8RuoI1TCgHQI7zmRfWGL+uu40Yc6h5SXHLJow3JrU0ALc+l msUqR3jdBjS53wcc8k3k1jmtOrbRwdyTCVeJl10/BpEK+4UdrS7ppyu+A9Ge/0F+q6x5 K0EQqccQbsH6YyZl76yktTEEDIRihz2pcYio69pDhkyOqF7yTJuMhrxPVpsT5YUkoWR1 yG1vX6blOjKalvoTWXOYzjlqB+9mC+H1uu4igD/HisCkStkukPAY302fhutEdPfluLvM MjeYe3yBdb7/8D4x+viXNMFYUzWHpjgPQoXVtM51mqAUW5mlWy3W5gQS0Fj5V4gFHuYv UrVA== 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 75-v6si2181596pfw.130.2018.06.13.01.05.19; Wed, 13 Jun 2018 01:05:34 -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 S1754514AbeFMIEt (ORCPT + 99 others); Wed, 13 Jun 2018 04:04:49 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:40678 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754472AbeFMIEo (ORCPT ); Wed, 13 Jun 2018 04:04:44 -0400 Received: by mail-wm0-f67.google.com with SMTP id n5-v6so3458831wmc.5; Wed, 13 Jun 2018 01:04:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=2KwO9bdDHrW4VEGYUkZAbm/f3ErEFVi8KQjEohL0RUc=; b=bHnuUkcnlLcZBwoSnei+uVXazu/nQ42X0EpPDDvm2OyAp38y1l9nhF1UhXrGVnwLi1 mGzb+6ja4ytuczGGB4EuDfg5al7ec9ZePs6LXJIMbuweYR9APHsWQkXPYERMJNklCWfe wUVA2MyHO5yMGIE6Z6eXrGEVc/PsAF9fZW8M5zDrjCVk1AvJyfTsozCjUaRyTR2dL15J Xn0+zIhqTDF/HEX+T+LLhMm4b5Yt2IjTgmRLsMfr8xE24OAYHMWfxnP6a9hOtdJLJRwK G7Ovphb98g7FhpN6mFQfLuy+6LNaV3w+HwbpKqbnpzN5TQZES4yt7r4e2lAtMd1Ot0Pr sQHQ== X-Gm-Message-State: APt69E1+PTB6T94y8Yo3yjlXNYSnRsj3llnAq4WfI4eNbRWfWmcsP78p 6ZXt/4GwtfTtua/IcvTLo/no8CtZ X-Received: by 2002:a50:9442:: with SMTP id q2-v6mr3011044eda.70.1528877082713; Wed, 13 Jun 2018 01:04:42 -0700 (PDT) Received: from mail-wr0-f177.google.com (mail-wr0-f177.google.com. [209.85.128.177]) by smtp.gmail.com with ESMTPSA id m19-v6sm986111edr.33.2018.06.13.01.04.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jun 2018 01:04:41 -0700 (PDT) Received: by mail-wr0-f177.google.com with SMTP id d8-v6so1684726wro.4; Wed, 13 Jun 2018 01:04:40 -0700 (PDT) X-Received: by 2002:adf:e94e:: with SMTP id m14-v6mr3264615wrn.126.1528877080735; Wed, 13 Jun 2018 01:04:40 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:a158:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 01:04:20 -0700 (PDT) In-Reply-To: <20180613074621.5phumovcyymbkfbn@flea> References: <20180612200036.21483-1-jernej.skrabec@siol.net> <20180612200036.21483-15-jernej.skrabec@siol.net> <20180613074621.5phumovcyymbkfbn@flea> From: Chen-Yu Tsai Date: Wed, 13 Jun 2018 16:04:20 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 14/27] drm/sun4i: Don't check for panel or bridge on TV TCONs To: Maxime Ripard Cc: Jernej Skrabec , Rob Herring , David Airlie , Gustavo Padovan , Maarten Lankhorst , Sean Paul , Mark Rutland , dri-devel , devicetree , linux-arm-kernel , linux-kernel , linux-clk , linux-sunxi 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 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. ChenYu