Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2406953ybl; Sat, 7 Dec 2019 14:50:07 -0800 (PST) X-Google-Smtp-Source: APXvYqzPlkDxwQ8O/NqQlkqHZPQB1FYlaXSJiwOztf4owm68FCHc6UOab5EE4V9vAW7m3qtkolK8 X-Received: by 2002:a54:4f8a:: with SMTP id g10mr17796183oiy.127.1575759007097; Sat, 07 Dec 2019 14:50:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575759007; cv=none; d=google.com; s=arc-20160816; b=FcQL0yAGgsf1XBeNTq3/J6IMbuS6nuciY8Hslzv93zkFlPJgMeIb8+JatPrSPN4psy K8HmmcugxWROpCg8zikrtN/wMdDeZWyRDOJQgQMRDq0cLziZ7V60lgvVIjjcMkCW2wgb teYHGCVT7IVu3rqS6+rtuDFiVdTAh/pIzMj8VCakvPlZCvfwLlt486kyfXShLveGwOnk /XVcFw1kukt+Jg34E3vEy7EVQR4g6V4D51hTLmaNbzgwJqtbOcP76NLE2DNcSVtATmCh Hz4BpOu5BnF9bpsCfIpZyd8GVB68JC4cWxkLhdRxPqbAn27Y3kVOwlfUVNzNoVshOtXl U6ug== 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=FSnVcF84lrJ542fNz3nsH7fxI8or0IHPzD+RmrrOdydPdf8FT7237EIT4ajoOrZ/Ek Kcc0I8WN9Ipxr0sIWJQJWzB6xDEHRVuQfugQsn9qjyV6iu2K/ZfIG6uUZjwJyy1OxlqA oRtV23ihrXEfhuNJ+BqtQvTVLrGjqpmjzs+rYbDzZmL6MIklqEVniGv8RrEH+naMcU1o KHYGGtlPpMVKvwKvVakxqN8KFdI8VyAcldlXfNXWPbBXA3nf9+J8n3AHmtcNFpUtArNt yrEFm8ZH0f/S3RMj5iP14UsQsdDQDR9lSrIcbxd9OjAZYANtgYAFY+NizhQr+DRoXkrq HuDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CvYvGt3z; 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 i9si9972669otp.139.2019.12.07.14.49.29; Sat, 07 Dec 2019 14:50:07 -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=CvYvGt3z; 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 S1727002AbfLGWsb (ORCPT + 99 others); Sat, 7 Dec 2019 17:48:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:43730 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726421AbfLGWs2 (ORCPT ); Sat, 7 Dec 2019 17:48:28 -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 5E2592467E; Sat, 7 Dec 2019 22:48:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575758908; bh=T3/4wZPL9p7tEA69OL6cyT7PPtrc6Pr84n3ts0k0Pfo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CvYvGt3z/Sy+gpaY9YyraZYD2q3rsfkCdtc4BVBxEbD6975AhN+QnXfUMQt0i+ojx 6S+x+4EoWlezGIT7geS9GrUahPX+e0uBpCR9m/QgZCWIXB3Vmkt62Qxx+uXBzb+e/8 QBS35ZBCJ92daP1WH0ClM8d06l6/4I25cUotuXCE= 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: 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, matthias.bgg@kernel.org Subject: [resend PATCH v6 05/12] media: mtk-mdp: Check return value of of_clk_get Date: Sat, 7 Dec 2019 23:47:33 +0100 Message-Id: <20191207224740.24536-6-matthias.bgg@kernel.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191207224740.24536-1-matthias.bgg@kernel.org> References: <20191207224740.24536-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