Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752043AbdG0QSI (ORCPT ); Thu, 27 Jul 2017 12:18:08 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:36245 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751867AbdG0QSA (ORCPT ); Thu, 27 Jul 2017 12:18:00 -0400 From: Jerome Brunet To: Neil Armstrong , Michael Turquette , Stephen Boyd , Kevin Hilman Cc: Jerome Brunet , Carlo Caione , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] clk: meson: meson8b: fix protection against undefined clks Date: Thu, 27 Jul 2017 18:17:54 +0200 Message-Id: <20170727161755.10393-2-jbrunet@baylibre.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170727161755.10393-1-jbrunet@baylibre.com> References: <20170727161755.10393-1-jbrunet@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 920 Lines: 27 meson8b clock driver gracefully handles case where the clkid is defined but the clock hw pointer is not provided, as long as it is not at the end of the hw_onecell_data array. This patch ensure that the last entries are defined as well to handle this particular case. Fixes: e92f7cca446e ("clk: meson8b: clean up fixed rate clocks") Signed-off-by: Jerome Brunet --- drivers/clk/meson/meson8b.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/meson/meson8b.c b/drivers/clk/meson/meson8b.c index bb3f1de876b1..7629aa09472a 100644 --- a/drivers/clk/meson/meson8b.c +++ b/drivers/clk/meson/meson8b.c @@ -585,6 +585,7 @@ static struct clk_hw_onecell_data meson8b_hw_onecell_data = { [CLKID_MPLL0] = &meson8b_mpll0.hw, [CLKID_MPLL1] = &meson8b_mpll1.hw, [CLKID_MPLL2] = &meson8b_mpll2.hw, + [CLK_NR_CLKS] = NULL, }, .num = CLK_NR_CLKS, }; -- 2.9.4