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: 9867299 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 18E316038C for ; Thu, 27 Jul 2017 16:24:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A12C287B4 for ; Thu, 27 Jul 2017 16:24:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2F1A2882E; Thu, 27 Jul 2017 16:24:01 +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 799AF287B4 for ; Thu, 27 Jul 2017 16:24:01 +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=OUFvrcciZiz/cXU8NHQOzlo1Px24b28Ekc+ltmEAsTs=; b=FFBY1ycqWr7R287y3yP4S54ha9 3pXEybCZvNJ6pQgl4OoirEMuOqVxnlJKu0QqTvxJhoxFv8FFTVF9Kw6L+DWKqfWR8sL+JQIYDFKGd eNNp625ijQFSnPJvyYJEAlFloQM1U0jU3jZVphioeqNNZafLMTD0x7Lz7KfWL1PNTDQc0UCYJYCSA w6BmXm772qtWGzzPsil+lcXWH3D/GTzUqSgEaIr/zK9znxxNLz0daSpr+ib0JZUwtz5JGPYNve3da nZLMJmoSv/V6BU+uQkFX5Z5t2ujENBEt39z9ZKaoR1IBonMvKFcRbxzh1uK/3wAlio6qH0+eihJfp k/hnzD2g==; 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 1dalZx-0005Fh-4y; Thu, 27 Jul 2017 16:24:01 +0000 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dalZt-0004NZ-DY for linux-amlogic@lists.infradead.org; Thu, 27 Jul 2017 16:23:59 +0000 Received: by mail-wm0-x236.google.com with SMTP id e199so281950wmd.0 for ; Thu, 27 Jul 2017 09:23:36 -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=JefjErEsc5lQ/DkCwtz/Lk/e6BHtYkZjaDXn+9cvh6DoIeHIAyolUgSJWUH9ZN3rld 5fbHINrJEhgCf0Zufh9ME+UPq4sZNMr5OTlhlllXDh+OcqhBrpBGGASg5K/XJYM68ti3 bj0TXnzMgisU+dafwAyWJmgJ0N0Ec6DjNfpvcIqHx9sISKjRTmYMjPYpypyFPKps1P34 y2VbGiAToNeAXC3YYNUMFv8iq1S9lMQFXW3lklwpJdm1fX1nZVbSBEMtuTlqE4yA/Xm9 RIOgFX5RKi9bTMZKYv8pKYRtcTBWFnIvZ2Urib/f3GB8KLnc3l4U8yUOdhNzi+bGCAgQ A+8w== X-Gm-Message-State: AIVw1129RE2/o3vxY9d9OuvNDVeoNT5lBSmcV1bJ24WRh4zhAEKivNE+ sWnpMYrARSQeNRuP0vs= 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_092357_658922_07836111 X-CRM114-Status: UNSURE ( 9.84 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=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, };