Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7193942ybi; Mon, 8 Jul 2019 16:37:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqwcuZXdiV3Tjh8oluk3H42yqUkFeS6WOGmcnpgfh1qdFd0G8WP9iTL1Z53RzQhoveXnvupm X-Received: by 2002:a63:3d8d:: with SMTP id k135mr27479017pga.23.1562629049439; Mon, 08 Jul 2019 16:37:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562629049; cv=none; d=google.com; s=arc-20160816; b=MYdYgjFZNO3a66UQ4NRyCXegmM1V53fHFp6y9QsFaWsuUdJRtYsJkeQ7sZnYBsqsMM pNO7tsqHxJgku4uq5YZT54Nv+bCsjShhEO5AbQYFi+RyAUzskxEG6f0v6kG4oa1HCMmI +pQrstoVHh5CVVh+RusDrhFnl4Ai0G4iondUYgXPrAwBPO6gshe5VeaL6KOIsrMfNr7n Jlk9LAWRfl4u9kj8/SPwTAte9ZoBQvo7enBBOwL5dKUVXWghZYF8iKKdrnT7G99moyhJ 2F6b/Lj+oNkpQX2GNyS9bY94LjDXUU49upO2PYdgrIZwbZLJEGZcebKfdjC4qceo7FlG gKiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=P/y3rZCRPxPJH4vqnCTstRn4wAUhWkibQv+8A1OFXWM=; b=XwsVo70DCzOOzzfIbiN9blm/2Xc6rEp50F8JjlGcQNoJipENDY32ygNHSxB7LKU3cI N+1yipihYg195ffgQi2Ze+RawJu/DemsLB3EjjqjIP7UfjhPRZQX/XweKgekeDUx1+rI XaLWg3K8jz1NjypLCJh/pr3d/Y+rd5OodzplxfCx0CTJaoON72EUxSLJWLyEBVJmxI9K Iew4vSfq0AEFtFHotLKx8zkLt9ggEsrINj2lfSU6Lt02/CYAAR9ioFWlODw6wURQAFTh WjB6UkOiHvO0mA/eUJc64r8AMz6p/p3OGNYcylRUN/ng6YmSyFdlLnyndiwPEGlMSiVt p5rA== 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 l185si21468914pgd.379.2019.07.08.16.37.14; Mon, 08 Jul 2019 16:37:29 -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 S1728160AbfGHWfv (ORCPT + 99 others); Mon, 8 Jul 2019 18:35:51 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:25910 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727633AbfGHWet (ORCPT ); Mon, 8 Jul 2019 18:34:49 -0400 X-UUID: b2e57046233c4f38be897090b0b2dc0b-20190709 X-UUID: b2e57046233c4f38be897090b0b2dc0b-20190709 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1553770687; Tue, 09 Jul 2019 06:34:43 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 9 Jul 2019 06:34:42 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 9 Jul 2019 06:34:41 +0800 From: To: CK Hu , Philipp Zabel , Rob Herring , Matthias Brugger CC: David Airlie , Daniel Vetter , Mark Rutland , , , , , , Yongqiang Niu Subject: [PATCH v4, 25/33] drm/mediatek: add clock property check before get it Date: Tue, 9 Jul 2019 06:34:05 +0800 Message-ID: <1562625253-29254-26-git-send-email-yongqiang.niu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1562625253-29254-1-git-send-email-yongqiang.niu@mediatek.com> References: <1562625253-29254-1-git-send-email-yongqiang.niu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yongqiang Niu This patch add clock property check before get it Signed-off-by: Yongqiang Niu --- drivers/gpu/drm/mediatek/mtk_drm_ddp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp.c b/drivers/gpu/drm/mediatek/mtk_drm_ddp.c index c57e7ab..a9d3e27 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp.c @@ -668,10 +668,12 @@ static int mtk_ddp_probe(struct platform_device *pdev) for (i = 0; i < 10; i++) ddp->mutex[i].id = i; - ddp->clk = devm_clk_get(dev, NULL); - if (IS_ERR(ddp->clk)) { - dev_err(dev, "Failed to get clock\n"); - return PTR_ERR(ddp->clk); + if (of_find_property(dev->of_node, "clocks", &i)) { + ddp->clk = devm_clk_get(dev, NULL); + if (IS_ERR(ddp->clk)) { + dev_err(dev, "Failed to get clock\n"); + return PTR_ERR(ddp->clk); + } } regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); -- 1.8.1.1.dirty