Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp908814ybv; Thu, 20 Feb 2020 09:22:45 -0800 (PST) X-Google-Smtp-Source: APXvYqzU0+umjfa4kKbX27m+az3WQ6a7Q9pFiw9n9Y5GVpegoiutey/8/BeJaiPY1P0XrUHsMtBY X-Received: by 2002:a9d:48d:: with SMTP id 13mr22955188otm.249.1582219365465; Thu, 20 Feb 2020 09:22:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582219365; cv=none; d=google.com; s=arc-20160816; b=GbuwQARPynM4eIBkkVnnZC0Nxr8h7Iaw8QD0UK8yUxaqAB2P5Iy+fS2B1O1XgGd9Lw FbSY7jfBc4LCYNGxk9ZQ1XpfXmCgvLZJxwLkYzGptOE59WOvsiFEC45tQnh7SzCr0Gkv /XLEPflX5/oVKZJJF5zHyHHxFnryJ+SSPnDbkKO/2FDUL3F+q40U1pm8H7LfZtSlF/W+ 3oCeTauWR7CFimv0rf6N3HBdAf3rTrivMUeIPYIKW2AjXsSOimW7phKyjKT8+U+yPQGk Hq9s8iukEZym4XfJA7a985YUu42zjKhBZZHOny0jJkGydXE0y8wtILnI5gI33GUj5q1k Hkdw== 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; bh=OapeaBSu76tMTA+FEKzYgWMvguCK4tpzeLfV3F4t944=; b=i9xXudOZoR3dGQnu0jM6stICJ5+kc2cHRqbYouKdxBWRbBy2TloCuj9BDtUA1ewI81 xJAoxWEUMsz10YVKzmPy44HHDYXmW8QcccfrLPVZpqqsSykqTokk6PidSq/AFH6ulgAG /1NX7L9lttUqTGT4w5ezYU5WgyjzeBHOqJyCiYu6ueLFEAn2mYMbjyPrsDbXL/hh43ZE Ndc3vTx/xxEnjz558UZABKxKXxTIvIooqpobKMTkhSQSJUL1dioNdEtwzUmV6DWK85y4 4PPXKsGtERlwJkrJoq0+XikuWYXEDV73DDpc/AVHRGmjk90VXFlF/XTAux/YN7WNFfa8 plZQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i7si10677538oib.63.2020.02.20.09.22.33; Thu, 20 Feb 2020 09:22:45 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728872AbgBTRWM (ORCPT + 99 others); Thu, 20 Feb 2020 12:22:12 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:48766 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726959AbgBTRWI (ORCPT ); Thu, 20 Feb 2020 12:22:08 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 4BC76295280 From: Enric Balletbo i Serra To: robh+dt@kernel.org, mark.rutland@arm.com, ck.hu@mediatek.com, p.zabel@pengutronix.de, airlied@linux.ie, mturquette@baylibre.com, sboyd@kernel.org, ulrich.hecht+renesas@gmail.com, laurent.pinchart@ideasonboard.com Cc: Mauro Carvalho Chehab , rdunlap@infradead.org, dri-devel@lists.freedesktop.org, Weiyi Lu , Seiya Wang , linux-clk@vger.kernel.org, Collabora Kernel ML , mtk01761 , Allison Randal , Thomas Gleixner , wens@csie.org, Kate Stewart , Greg Kroah-Hartman , Houlong Wei , Matthias Brugger , linux-media@vger.kernel.org, devicetree@vger.kernel.org, sean.wang@mediatek.com, frank-w@public-files.de, Minghsiu Tsai , Andrew-CT Chen , linux-mediatek@lists.infradead.org, hsinyi@chromium.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org, Richard Fontana , linux-kernel@vger.kernel.org, matthias.bgg@kernel.org, Daniel Vetter Subject: [PATCH v8 3/6] media: mtk-mdp: Check return value of of_clk_get Date: Thu, 20 Feb 2020 18:21:44 +0100 Message-Id: <20200220172147.919996-4-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200220172147.919996-1-enric.balletbo@collabora.com> References: <20200220172147.919996-1-enric.balletbo@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthias Brugger Check the return value of of_clk_get and print an error message if not EPROBE_DEFER. Signed-off-by: Matthias Brugger Signed-off-by: Enric Balletbo i Serra --- Changes in v8: None Changes in v7: - Fix check of return value of of_clk_get - Fix identation drivers/media/platform/mtk-mdp/mtk_mdp_comp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c index 0c4788af78dd..58abfbdfb82d 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c @@ -110,6 +110,12 @@ int mtk_mdp_comp_init(struct device *dev, struct device_node *node, for (i = 0; i < ARRAY_SIZE(comp->clk); i++) { comp->clk[i] = of_clk_get(node, i); + if (IS_ERR(comp->clk[i])) { + if (PTR_ERR(comp->clk[i]) != -EPROBE_DEFER) + dev_err(dev, "Failed to get clock\n"); + + return PTR_ERR(comp->clk[i]); + } /* Only RDMA needs two clocks */ if (comp->type != MTK_MDP_RDMA) -- 2.25.0