Message ID | 20170328144605.25278-3-jbrunet@baylibre.com (mailing list archive) |
---|---|
State | Changes Requested |
Headers | show
Return-Path: <linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6E854601E9 for <patchwork-linux-amlogic@patchwork.kernel.org>; Tue, 28 Mar 2017 14:46:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5ECE127F9F for <patchwork-linux-amlogic@patchwork.kernel.org>; Tue, 28 Mar 2017 14:46:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 53C6D283A6; Tue, 28 Mar 2017 14:46:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 051E724B44 for <patchwork-linux-amlogic@patchwork.kernel.org>; Tue, 28 Mar 2017 14:46:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=7MA1GrkiNfaCnwdvUubttdxJDIrT28AwvXGFRf/6qrg=; b=HXLAKnsLiG6ETawcPekenGvna/ gxpx567/FBj+M8R3PGI2I/hCQIMyvmeSIxDlFLDCft+5olrfPGTNJHhGCbVB1sALtn+P12XtlevA5 h4r4HGzUYP8MzZloeyVPchU4hz7mQOME2zvImJRjG1Dkj5CDoa8H5lYl83UgV37HubyMQKes9xUHV n905bPF4X4xCJrmtpnctTh6qs8ijAmoojSVpOqr1Q44ixXDRK4hUFXKEy2FhxnaHMe6rXHFbHt69H G++uQ0AI9uFDdxXaSqjvZGl+K8gPVRBaIzqvRa4ogybDfIuBXOrcUAxnDqHx6kRb0z90nWR+wPRhr ox6d2nWg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cssOO-0000AV-O3; Tue, 28 Mar 2017 14:46:40 +0000 Received: from mail-wr0-x231.google.com ([2a00:1450:400c:c0c::231]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cssOI-0008RS-Rc for linux-amlogic@lists.infradead.org; Tue, 28 Mar 2017 14:46:37 +0000 Received: by mail-wr0-x231.google.com with SMTP id w11so89653147wrc.3 for <linux-amlogic@lists.infradead.org>; Tue, 28 Mar 2017 07:46:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VcqRbppXG/EuthPFat0yZNfgAHVZhp0/vfLGmVmHnJs=; b=TjHhP+zgKZj8u6rERxHZUL8qlRk3XhG8U1LZuqP5dN2zuOMxW8D2KTLEo5RcOTZy24 RlryynaAh+13C7HkCjHzn0Pa56Cun0IIpQIbgYfmQGdDjycCz8xGiAjeeaUvjQc4LvSh xbS+1OYGoXXhM+uUGMr1/aRIYmSy+hAroHO33IUPidPd0ov+J4ZUXVQ4RvIbk9/sbDwm Zn3K/krsPsqAGLsl4fqucEL444LBcQQpilpKVzG4cq/7bj+DiDuX3dqdcaGfqeuPZ8GW j54GdJbRPr53tBsPHNjnP/+ECXXk0pqG06RIC/kxaTJT1UKvp+IElKB0mFLrQ/29AQkS ABNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VcqRbppXG/EuthPFat0yZNfgAHVZhp0/vfLGmVmHnJs=; b=cZUE3P8yt/wqoKeuhXBQpcy1zqPlshw2+M1vjNEAxLZzjlI2MSsmbVkbA+7ry1O2Rs 3ufQK28HiinQc5akAREGCR4DCvLOwzWQau0WpZkhHAPxPF1D/7UhjUayLo+cEyxWR/HE kd63jsg+aW3G/9KRihrVxcV8StxPwd0ZeExsZsyCeIxlNZ9rTxhGgbDKkbWY9FqQUs4Y w3R2j+csCwhDXw2sY6pBhSKI8CELXrtJ8ZhkqZErrD5TI0xJQPi4Y3Kap1Ccjf/LAB/4 FgedTAiWMevK+xsZhc+aIZiu42InQZ4HJWiOmIfD0CaeT/mu6mYiKZLEeaMM5qsyWclW NdHA== X-Gm-Message-State: AFeK/H1inqgSOWLtc+X6luTam0xWY4MYo0ERXkwy5cab5hs6SemciHWaEV//3RfyAUpldQsA X-Received: by 10.223.152.43 with SMTP id v40mr23775471wrb.60.1490712373338; Tue, 28 Mar 2017 07:46:13 -0700 (PDT) Received: from localhost.localdomain (cag06-3-82-243-161-21.fbx.proxad.net. [82.243.161.21]) by smtp.googlemail.com with ESMTPSA id a18sm5159457wrc.58.2017.03.28.07.46.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Mar 2017 07:46:12 -0700 (PDT) From: Jerome Brunet <jbrunet@baylibre.com> To: Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@codeaurora.org>, Kevin Hilman <khilman@baylibre.com>, Carlo Caione <carlo@caione.org> Subject: [PATCH v1 2/8] clk: meson: gxbb: protect against holes in the onecell_data array Date: Tue, 28 Mar 2017 16:45:59 +0200 Message-Id: <20170328144605.25278-3-jbrunet@baylibre.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170328144605.25278-1-jbrunet@baylibre.com> References: <20170328144605.25278-1-jbrunet@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170328_074635_087208_412C7114 X-CRM114-Status: UNSURE ( 9.42 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-amlogic.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-amlogic>, <mailto:linux-amlogic-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-amlogic/> List-Post: <mailto:linux-amlogic@lists.infradead.org> List-Help: <mailto:linux-amlogic-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-amlogic>, <mailto:linux-amlogic-request@lists.infradead.org?subject=subscribe> Cc: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Jerome Brunet <jbrunet@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" <linux-amlogic-bounces@lists.infradead.org> Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c index 75197664a7ee..28812ea41a60 100644 --- a/drivers/clk/meson/gxbb.c +++ b/drivers/clk/meson/gxbb.c @@ -1388,6 +1388,10 @@ static int gxbb_clkc_probe(struct platform_device *pdev) * register all clks */ for (clkid = 0; clkid < clkc_data->hw_onecell_data->num; clkid++) { + /* array might be sparse */ + if (!clkc_data->hw_onecell_data->hws[clkid]) + continue; + ret = devm_clk_hw_register(dev, clkc_data->hw_onecell_data->hws[clkid]); if (ret)
The clock controller is getting more complex and it might be possible, in the future, to have holes in the clk_hw_onecell_data array. Just make sure we skip those holes if it ever happens. Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> --- drivers/clk/meson/gxbb.c | 4 ++++ 1 file changed, 4 insertions(+)