From patchwork Thu Jul 27 16:17:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 9867303 Return-Path: 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 8D2CB6038C for ; Thu, 27 Jul 2017 16:25:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F44C2884F for ; Thu, 27 Jul 2017 16:25:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7295428842; Thu, 27 Jul 2017 16:25:51 +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,RCVD_IN_DNSWL_NONE 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 0C41828845 for ; Thu, 27 Jul 2017 16:25:50 +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=fkNHemkujANhe804cfdP4BHcZvN+giHGZjat48D/xAg=; b=QU0agasqlJe4sfnK5vnySf80Am SY1qjzMLRlnDFo25ybqR/gpoiwMw89QMrfKTv82XPR+/Eiu0pIYQZ8J2SrNlgDwmo8ahipR4vZy6D w5Jhz1z4gQb6l0Bap7R122XH1v/knhr8zMJnc/NrB2Y9nYosfsTc0hVN1SqaL9cjoyESIlt8u0vct yj9G0eYua7hC109jbeuUNT8C3FCluz0adg870mn9MNcduVD/5Iv/NoXxN8iSTx6usav5vMJKUUsz4 +vgGwOKC8f9JjIhnxU6Hmm9kPow1aIcQv4SnJF70D51qg2iVQcqJOULi0CDVC36wgEZUa4LygnXrS Y3I39tHw==; 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 1dalbe-0006XS-Fv; Thu, 27 Jul 2017 16:25:46 +0000 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dalba-0006WR-Rj for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2017 16:25:44 +0000 Received: by mail-wm0-x234.google.com with SMTP id e199so320940wmd.0 for ; Thu, 27 Jul 2017 09:25:22 -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=EAABz+oYYNhLuBBaae9yyiAWL37RWjdpMLVRC03GgOk=; b=UYDC8YfPJQZ+iMgsv+Wav+f4qiyy2XHcWP0VmWYHuj6XibsdCXEMznSiHu8y6R2o2o VVI/NxbJv+7xk/Jn2Tyu3zNQ0TSBG6iLP0N7jLsl0Uk1nF43h5pDHYJzKYW7a9azJKFk 4tzaCEKWmAM55NijFb/r8QUuQlLdXkzE+CUY5la6cmS78tw+cIDFb5k3DYPDgj/Jhkh9 osb2c2OhPfZQTY+8Hl0c6j9T54vA755+IF5xWc9sTmoZ1MnIJc08n0C/iubn2m/yZsDj B7XxrvW2wcoUlvysRpUDGGioOx9jUoGfoJPOHwRJ20G/Ga/pAaNpYNHJoc4/v3l4oLWL 28mg== 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=EAABz+oYYNhLuBBaae9yyiAWL37RWjdpMLVRC03GgOk=; b=hQVyPpAsRhPv9VuO0qg7Upaz02uJz48R4UgBTRUjj5hU/9hUX/O18ojJCnUKyFBpSl WuBEQ1jdyPZHcx5ruYZQgZ8GA0t5sUv28DzbdOTNp/RCebdavz1jNovwRtO/KYug2OGb KaMPzyQjKLHs1Y+OpW0IUly6VH88USWa37qwzAwUdAVWVOeLAgPdO82NgHhpodFjP0FX GCLYPZUe1sgjGcZQWT+UT+yDcfDSWtV8hC85qSkOdJsOrIEWR9iv/MRZwmg2fHiPLey1 eZ3aTqZYGFCx4uXkm7Dx9oxUXDSelMYC8m41st71VjFXsylWChYI4tOfG3Ll6FVeWk83 XKww== X-Gm-Message-State: AIVw11287joW3TOWX2hXKhIqjtIGFmRixU8iXryF/7AGbjgttIUoY6VU M8xzlf9lc2sx23Fk X-Received: by 10.28.24.210 with SMTP id 201mr3610548wmy.65.1501172280741; Thu, 27 Jul 2017 09:18:00 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id w19sm16128125wrb.49.2017.07.27.09.17.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jul 2017 09:18:00 -0700 (PDT) From: Jerome Brunet To: Neil Armstrong , Michael Turquette , Stephen Boyd , Kevin Hilman Subject: [PATCH 2/2] clk: meson: gxbb: fix protection against undefined clks Date: Thu, 27 Jul 2017 18:17:55 +0200 Message-Id: <20170727161755.10393-3-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170727_092543_087710_07DF24DF X-CRM114-Status: GOOD ( 11.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Carlo Caione , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jerome Brunet MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP gxbb 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: a70c6e06ed7c ("clk: meson: gxbb: protect against holes in the onecell_data array") Signed-off-by: Jerome Brunet --- drivers/clk/meson/gxbb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c index a897ea45327c..8409d86cda24 100644 --- a/drivers/clk/meson/gxbb.c +++ b/drivers/clk/meson/gxbb.c @@ -1183,6 +1183,7 @@ static struct clk_hw_onecell_data gxbb_hw_onecell_data = { [CLKID_32K_CLK] = &gxbb_32k_clk.hw, [CLKID_32K_CLK_SEL] = &gxbb_32k_clk_sel.hw, [CLKID_32K_CLK_DIV] = &gxbb_32k_clk_div.hw, + [NR_CLKS] = NULL, }, .num = NR_CLKS, }; @@ -1305,6 +1306,7 @@ static struct clk_hw_onecell_data gxl_hw_onecell_data = { [CLKID_32K_CLK] = &gxbb_32k_clk.hw, [CLKID_32K_CLK_SEL] = &gxbb_32k_clk_sel.hw, [CLKID_32K_CLK_DIV] = &gxbb_32k_clk_div.hw, + [NR_CLKS] = NULL, }, .num = NR_CLKS, };