From patchwork Mon Aug 17 15:15:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 266388 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAE88C433E1 for ; Mon, 17 Aug 2020 16:04:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA12020866 for ; Mon, 17 Aug 2020 16:04:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597680251; bh=U7cUe149+oKVFDMQFypevGk4UfBFfRVuFM0ffKU6T4A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=zzQgcGIh0lMaUVN/g7F4aSjY0QtPfWcq7vV4R1WHjBFF02wwknTywA0Y6mkY5EyYi vU4kTJ2REkvq45CV/Q65FHX3P+Wp282vCWsbB/tIs1T6CZFWiYWSox+XaKqwju8Xu6 yTKvQwTo5kK0ievFGP3wXtTEpcH+8oCCyHSvswz0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388271AbgHQQDz (ORCPT ); Mon, 17 Aug 2020 12:03:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:51564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388265AbgHQQDv (ORCPT ); Mon, 17 Aug 2020 12:03:51 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 926B52053B; Mon, 17 Aug 2020 16:03:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597680231; bh=U7cUe149+oKVFDMQFypevGk4UfBFfRVuFM0ffKU6T4A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JRSUU7JjgwEUXOnlu6yzQFQOl6o8mIULwMcrFT52upumA7S5MeZAkhtJ5MuosSXfP /+df1i0Jary6xQEXmHLMeEmVMkHjqJVf9OcaPqn2tiJP81hvHHBdjDwPIJkEkQkEW7 N1ZP3HI/SAPx2J+Qe3d34wJAs1LD0vOZEsKt4ihY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= , Florian Fainelli , Stephen Boyd , Sasha Levin Subject: [PATCH 5.4 104/270] clk: bcm63xx-gate: fix last clock availability Date: Mon, 17 Aug 2020 17:15:05 +0200 Message-Id: <20200817143800.963796057@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143755.807583758@linuxfoundation.org> References: <20200817143755.807583758@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Álvaro Fernández Rojas [ Upstream commit cf8030d7035bd3e89c9e66f7193a7fc8057a9b9a ] In order to make the last clock available, maxbit has to be set to the highest bit value plus 1. Fixes: 1c099779c1e2 ("clk: add BCM63XX gated clock controller driver") Signed-off-by: Álvaro Fernández Rojas Link: https://lore.kernel.org/r/20200609110846.4029620-1-noltari@gmail.com Reviewed-by: Florian Fainelli Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/bcm/clk-bcm63xx-gate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/bcm/clk-bcm63xx-gate.c b/drivers/clk/bcm/clk-bcm63xx-gate.c index 98e884957db87..911a29bd744ef 100644 --- a/drivers/clk/bcm/clk-bcm63xx-gate.c +++ b/drivers/clk/bcm/clk-bcm63xx-gate.c @@ -155,6 +155,7 @@ static int clk_bcm63xx_probe(struct platform_device *pdev) for (entry = table; entry->name; entry++) maxbit = max_t(u8, maxbit, entry->bit); + maxbit++; hw = devm_kzalloc(&pdev->dev, struct_size(hw, data.hws, maxbit), GFP_KERNEL);