From patchwork Tue Jan 21 22:48:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 11344725 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 836721580 for ; Tue, 21 Jan 2020 22:48:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6181324125 for ; Tue, 21 Jan 2020 22:48:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rGiLs9G6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6181324125 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=XOZrSl1ptSofnUVE27/pPwlhIhCJG9Y7A9+rZeq65qM=; b=rGiLs9G6eMXSJM Cbtnn2VWOJOXXBEtrV0v+vmRfckEDXuX80m4lrbeMvCSvIJuugqMpAacnvPhWA36WtQTj3RBM6jce ve4ytpFvIvfVagWPPpBUlF69MC33lm1Vk5v7HX9dgI5tWLdEDCAO0Spx3MwsRIv1yAoOuZSzt+meK fkdABV8bNB6cS/eIfx1C3hRXEYVYirkLoqPpgpozWKUJ6723ViViUrWHpH/x57KV9JHX2FgvACszj 7QUWdgnO3cHEU7smt49AITZnePe2tp90zsFL1MgUcY0mCP7OOn1zsYdMHSOAjNaoIEzlV09xxQlEf E8vQ1oTeqNtTTeifNuPw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iu2KI-00052t-A0; Tue, 21 Jan 2020 22:48:50 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iu2KF-000526-ER; Tue, 21 Jan 2020 22:48:48 +0000 Received: from mail.linser.at ([80.109.168.170] helo=phil.Hitronhub.home) by gloria.sntech.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1iu2KA-0005xB-3m; Tue, 21 Jan 2020 23:48:42 +0100 From: Heiko Stuebner To: hjc@rock-chips.com Subject: [PATCH] drm/rockchip: rgb: don't count non-existent devices when determining subdrivers Date: Tue, 21 Jan 2020 23:48:28 +0100 Message-Id: <20200121224828.4070067-1-heiko@sntech.de> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200121_144847_640959_EE977B55 X-CRM114-Status: GOOD ( 11.73 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heiko@sntech.de, Heiko Stuebner , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, miquel.raynal@bootlin.com, linux-arm-kernel@lists.infradead.org, christoph.muellner@theobroma-systems.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 Reviewed-by: Miquel Raynal --- 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++;