Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp936878ybv; Thu, 13 Feb 2020 12:21:29 -0800 (PST) X-Google-Smtp-Source: APXvYqxm9EqZmWmdfFHPEsn5ozacMXilltHt6riK2Q9WLGd5U1od8XTAP/AObrlFXEubdz9sScMZ X-Received: by 2002:a9d:600e:: with SMTP id h14mr14192801otj.113.1581625289747; Thu, 13 Feb 2020 12:21:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581625289; cv=none; d=google.com; s=arc-20160816; b=EMYJ8GnaLmy9zuFfbId+9LWJGRgAwZa8Is8IzhziTfElWnNDCfzzzrS4XuO68PRDIV wZVTzNl+IckN40ZhEduucOQ+3R1OTGnBBpS7KAiNhyyzF2PGPt2c+pnbs2ygBZp7z9q5 7zUzukHeDKkYbIudBdm/KC8w4a7LLQi5Guriuqva7c5N0ScLfiThLDiooIrp3d5fUBG6 kJ8AU0caN9IDwTLbsKTMjcQpU0UY/5AuwYfaeZ3MCjaQx1XIliQ+wlmJ/YI0X403moDu h7sdH3rzJ74PTUILO3sFQad8oRaPEisAKFRPhfiocKrw9KUESmh8CYLhvhR3X0QIR0E4 fJhA== 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 :dkim-signature; bh=UjMNj2gj6qpBy+yjS1NJ67w51gWm6OMECUgYJ7ID8qs=; b=sSxZByShFg1vGjUwHySCY6t5vfv2Rj14DWQ5bI02dYdqCHIJ/qXR45CyAq48rKKjCj r91NzLDpETBIT0T7C9P3kfNgoqqloGTmhIDVyfINg3o+/6hpRe/SzlSSW/6OIt9SXp5c /wrfVS5TyOaE/nW0o5juZi1qIF4Oz8BT9fXUmaK2nd/ZYbTZagq7u6KZW/cOeaKHd0sK yW06eZ3JCkRhcYMYYzpmfPa787V0yHXgwK+vRNDQ43YCeWOVGR0UYzT+jHEtJOgQZMn7 zpF0/Ul7O2AUudx7gHiuIW7iLiADbsFwoKoKUTRa4rUODYvWRQCaPj7NUQ3emK9c1AlE odJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aF+G69WL; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m26si1647365otk.305.2020.02.13.12.21.17; Thu, 13 Feb 2020 12:21:29 -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; dkim=pass header.i=@kernel.org header.s=default header.b=aF+G69WL; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728788AbgBMUUf (ORCPT + 99 others); Thu, 13 Feb 2020 15:20:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:34724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727893AbgBMUUe (ORCPT ); Thu, 13 Feb 2020 15:20:34 -0500 Received: from ziggy.cz (unknown [37.223.145.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5FAE6246B7; Thu, 13 Feb 2020 20:20:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581625234; bh=XcEAV579vpbhrGM7L1sLKnlD3ZwYRAAFqPyNBSpB5xc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aF+G69WLp/bU/bU3mAke9zS47x1B61phTNiilup28yjTznPqtNMNZsUKTEojghrEv UDhVUoHff4lZCUyXZ1sMQRtW+DuPlCp17AskgWvvuAcX1QlqU1U7eCaRsk2OL8K7fq 5B9fX8ZndgcXDROq1g4SpccnqVBlas6ENti0jb8I= From: matthias.bgg@kernel.org 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, enric.balletbo@collabora.com Cc: devicetree@vger.kernel.org, drinkcat@chromium.org, frank-w@public-files.de, sean.wang@mediatek.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, wens@csie.org, linux-mediatek@lists.infradead.org, rdunlap@infradead.org, matthias.bgg@kernel.org, hsinyi@chromium.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, Matthias Brugger , Andrew-CT Chen , Houlong Wei , Matthias Brugger , Mauro Carvalho Chehab , Minghsiu Tsai Subject: [PATCH v7 06/13] media: mtk-mdp: Check return value of of_clk_get Date: Thu, 13 Feb 2020 21:19:46 +0100 Message-Id: <20200213201953.15268-7-matthias.bgg@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200213201953.15268-1-matthias.bgg@kernel.org> References: <20200213201953.15268-1-matthias.bgg@kernel.org> 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 --- Changes in v7: - fix check of return value of of_clk_get - fix identation Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None 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.24.1