Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2392150ybl; Sat, 7 Dec 2019 14:25:43 -0800 (PST) X-Google-Smtp-Source: APXvYqwW2dk0JjHi7B8eQxCBcb12ppWTLEbeYDy39GwSj9BH02YdEGcoB68VArWMogl/BBbkeTsZ X-Received: by 2002:a9d:7c8f:: with SMTP id q15mr7067637otn.341.1575757543352; Sat, 07 Dec 2019 14:25:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575757543; cv=none; d=google.com; s=arc-20160816; b=d88GplzV8eJt5nl+xLGyvAEZPzoGz4WA4KXHBky32AGyn6sMvhE+WyXXmwhif17gA1 xOpo8sz/YXYvHEe5Sm2cvtFdUQFOIAdVSyiF/cK7khc7IE+xRJ32T2tadGANz8/4Pe8V NHw1bXukUHqZ4rzhYJkuaCeoCXhjSc3KTvTMYrOM3fvLw2lJzhpItFrMh75yeS/8NVNI Ye+Mhae8Med/WwDv01GumTxNb++W6KMHJ5QBFDekRkL8UTQWeOj8Xj085ZnryKGaz3Pz XhHAd+qF7xnGzJfumpUMubeghAHpyprLdvxbZwtSmEy/KTzU23HuD3g+Wx/F3zZ89Y82 jUnA== 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=8KRvm7f+UbDo6uRbVC7KM5wI8K4tthSHMfS1S+AkdhY=; b=FXA+FJDc2HT2AOxFFlvdsZ0y/CtGkQ62g8A1rabC2Hqx2EXR9/9D9nGVhaJADfzW5d SoRX/+vo9Mhr50xvoNBAIVvD1ir1imy6TzCELX2gBWbDYvSwZsEqqqHGFzEdPI72DS5b 7kzFT0zyKOefLob6KQQvN0hZZj6qpDUOvQq3hpovr+i7030GWACxnBqkUCxjlFQmvZdw cyYzlPMWuvxq/fwlEMyMqbiX+zQqWA0G7NYuznyAqP5z3EPots7k2wx6Koqn2/rkK3Wk iB/9V/vnhdjRkkZTvAOWcP94Y0D3L/6pVfryoaR6MmGEuOLzstdYd1g+f3nOjaSdoMDv JOtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uxXS1VAM; 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 16si10108021otn.228.2019.12.07.14.25.32; Sat, 07 Dec 2019 14:25:43 -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=uxXS1VAM; 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 S1726971AbfLGWYy (ORCPT + 99 others); Sat, 7 Dec 2019 17:24:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:36828 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726949AbfLGWYx (ORCPT ); Sat, 7 Dec 2019 17:24:53 -0500 Received: from ziggy.de (unknown [95.169.229.25]) (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 0B2722467D; Sat, 7 Dec 2019 22:24:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575757492; bh=T3/4wZPL9p7tEA69OL6cyT7PPtrc6Pr84n3ts0k0Pfo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uxXS1VAMa98HE9acicpZKn+v42FOxv/RwEn0KlvGqCpmFiXQQB+VvpdNB5J8kHNgY mDI3JrWQOHNThSTkpfpxL4P459FvdL1qqJs5C3u+VHcJ+bV+D/fWZiNoow7ajO+EHM HZ2Sg2xGCo4X8lW1mO/BssttoEDiRv2hrD4cqwH4= 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@codeaurora.org, ulrich.hecht+renesas@gmail.com, laurent.pinchart@ideasonboard.com, enric.balletbo@collabora.com Cc: sean.wang@mediatek.com, sean.wang@kernel.org, rdunlap@infradead.org, wens@csie.org, hsinyi@chromium.org, frank-w@public-files.de, drinkcat@chromium.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, mbrugger@suse.com Subject: [PATCH v6 05/12] media: mtk-mdp: Check return value of of_clk_get Date: Sat, 7 Dec 2019 23:23:42 +0100 Message-Id: <20191207222349.23161-6-matthias.bgg@kernel.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191207222349.23161-1-matthias.bgg@kernel.org> References: <20191207222349.23161-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 --- 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 9afe8161a8c0..4e2fc1337b80 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])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.0