From mboxrd@z Thu Jan 1 00:00:00 1970 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=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham 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 704A8C10F27 for ; Tue, 10 Mar 2020 09:53:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4702E2467D for ; Tue, 10 Mar 2020 09:53:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726382AbgCJJxO convert rfc822-to-8bit (ORCPT ); Tue, 10 Mar 2020 05:53:14 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:39323 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726199AbgCJJxN (ORCPT ); Tue, 10 Mar 2020 05:53:13 -0400 X-Originating-IP: 90.89.41.158 Received: from xps13 (lfbn-tou-1-1473-158.w90-89.abo.wanadoo.fr [90.89.41.158]) (Authenticated sender: miquel.raynal@bootlin.com) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 9661B1C0012; Tue, 10 Mar 2020 09:53:08 +0000 (UTC) Date: Tue, 10 Mar 2020 10:53:08 +0100 From: Miquel Raynal To: Heiko Stuebner Cc: hjc@rock-chips.com, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, christoph.muellner@theobroma-systems.com, Heiko Stuebner Subject: Re: [PATCH] drm/rockchip: rgb: don't count non-existent devices when determining subdrivers Message-ID: <20200310105308.1c5fadf9@xps13> In-Reply-To: <20200121224828.4070067-1-heiko@sntech.de> References: <20200121224828.4070067-1-heiko@sntech.de> Organization: Bootlin X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Heiko, Heiko Stuebner wrote on Tue, 21 Jan 2020 23:48:28 +0100: > From: Heiko Stuebner > > rockchip_drm_endpoint_is_subdriver() may also return error codes. > For example if the target-node is in the disabled state, so no > platform-device is getting created for it. > > In that case current code would count that as external rgb device, > which in turn would make probing the rockchip-drm device fail. > > So only count the target as rgb device if the function actually > returns 0. > > Signed-off-by: Heiko Stuebner > --- > drivers/gpu/drm/rockchip/rockchip_rgb.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/rockchip/rockchip_rgb.c b/drivers/gpu/drm/rockchip/rockchip_rgb.c > index ae730275a34f..79a7e60633e0 100644 > --- a/drivers/gpu/drm/rockchip/rockchip_rgb.c > +++ b/drivers/gpu/drm/rockchip/rockchip_rgb.c > @@ -98,7 +98,8 @@ struct rockchip_rgb *rockchip_rgb_init(struct device *dev, > if (of_property_read_u32(endpoint, "reg", &endpoint_id)) > endpoint_id = 0; > > - if (rockchip_drm_endpoint_is_subdriver(endpoint) > 0) > + /* if subdriver (> 0) or error case (< 0), ignore entry */ > + if (rockchip_drm_endpoint_is_subdriver(endpoint) != 0) > continue; > > child_count++; Reviewed-by: Miquel Raynal Thanks, Miquèl