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=-9.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT 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 B594AC352A3 for ; Thu, 13 Feb 2020 20:20:35 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 85AF2246AF for ; Thu, 13 Feb 2020 20:20:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="aF+G69WL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 85AF2246AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 217DE6F64B; Thu, 13 Feb 2020 20:20:35 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3A00D6F64B for ; Thu, 13 Feb 2020 20:20:34 +0000 (UTC) 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 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, drinkcat@chromium.org, Minghsiu Tsai , frank-w@public-files.de, sean.wang@mediatek.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Houlong Wei , Matthias Brugger , wens@csie.org, Matthias Brugger , linux-mediatek@lists.infradead.org, rdunlap@infradead.org, matthias.bgg@kernel.org, Andrew-CT Chen , hsinyi@chromium.org, Mauro Carvalho Chehab , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel