From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.7 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 367AAC43331 for ; Fri, 6 Sep 2019 06:26:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1C7782082C for ; Fri, 6 Sep 2019 06:26:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NbQapfqY"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GGNMeOiy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1C7782082C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References: List-Owner; bh=1u9MndtNjfjZa6vB/WelztWGEmtsV8HuOxogSkMJiTc=; b=NbQapfqYNGnlQ/ cdieh2yj8RCMhChVi2S+nCyxV/jV9yVjxAx1DYUy8m39EjvFjJb2hDgA5H2DqO18aClwmIqsXANur CN1KraZy/1rWU+WVaSAxE5CNvWDet2bJq4r0QDjJQX+YPu7KOwERoZYzyUq6kLXWwamoRDWPKIpYt 7CPDP1BiQ+lkMut3Mq8+ooiJdhs7IOXk7PuHIEccimc+lUvwQ9PE2wLGcjsnwKGUCX4lRmU73cxxo TugL4aLkjA5ItqAsw1lQjcURUBzdGuofcJV6BoxQgV5pzsbK/E23Bc5L4DFXT0RltFZv/5KtE/8nm exV7dOu1MRW9LitPxdTQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i67hb-0005ja-4E; Fri, 06 Sep 2019 06:26:35 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i67hY-0005if-6w for linux-arm-kernel@lists.infradead.org; Fri, 06 Sep 2019 06:26:33 +0000 Received: by mail-pl1-x642.google.com with SMTP id y10so2615660pll.7 for ; Thu, 05 Sep 2019 23:26:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VywQQgwoddW91Jq4aMSrybOZ072q9St1Z4i5rxfAKss=; b=GGNMeOiyYHFVFbotkWPcgoumWVou3FxdbVs9/ZllGyRMZj3CYE50mPl9eaGFK1SSJ1 ehwBhp1UScc4KWEVlRPTVx5dcCy+WX7EbS7TTARFNII+ncgxuk21EEMFuOwhgWtIa+hy /f6e7unxpJT7Gy1vtgrYz8B8OK/i7/jJyGmy06Zd2HRGt0nVcQhxLxpf/i6vGD+oGigX CpnNnsbajWYqKej4a5ukjmDX2t/YD8+maxsED7v6pUHoO6keEhTC2ZjlnTfxTkfPQXbD vTYcDqCdcICnYEKy+XEg3z7BLeBcmQK0pGKWBNT+XrnEdIR8+Zot+2wioR+D/zN7vM4n vGtQ== 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:mime-version :content-transfer-encoding; bh=VywQQgwoddW91Jq4aMSrybOZ072q9St1Z4i5rxfAKss=; b=XFX11iLJM1lgiYQJlD3GOsnL3SCOc2ANFp1nLh9ly2LYLFt+nGObQ+pJTFku4cNGvm 0zrL4OgzDU+arwXRvwfj+YlN4chFRiUPYGFqhrXBlOpFxacpf8kGTpKgo2OJBgigLe5W ew6E7rTd9KS8rkcbpNLojw1VrXYa0sT99G3ZJGjHW/1dSrxlu6Y5c3fzJbqicw/vQ4Z1 UwOmhnX+uGzjHqFQDYQURja4TUZSWnTSjU0HKVbGB81J15tDMYRBfadNS5kYiSmaL60g H3WLOJ0j+Lnc6+9V9RCI1yS2XlSZplcMHkYmWwjIX0l+VHyWdlqNVOiTbl3NtFOU1+Dj ItgQ== X-Gm-Message-State: APjAAAUeeYfijyVFpWFQ56nQ7dShy2/piGlDoxQ+nQKrtI98EBWv3maI Cw+NyIOufqNiUZWbkM+2yjs= X-Google-Smtp-Source: APXvYqyB4ARXWSH67d+dolbjyhdZvVBxPlfvR8PsPQ1/637E5ASl4JnhB8dHZykbbS8hKbyHlvXzkg== X-Received: by 2002:a17:902:aa02:: with SMTP id be2mr7780215plb.172.1567751191484; Thu, 05 Sep 2019 23:26:31 -0700 (PDT) Received: from rashmica.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id c64sm1631254pfc.19.2019.09.05.23.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 23:26:30 -0700 (PDT) From: Rashmica Gupta To: linus.walleij@linaro.org Subject: [PATCH v3 2/5] gpio/aspeed: Fix incorrect number of banks Date: Fri, 6 Sep 2019 16:26:22 +1000 Message-Id: <20190906062623.13354-1-rashmica.g@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190905_232632_251258_BB7FFC2A X-CRM114-Status: GOOD ( 11.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "moderated list:ARM/ASPEED MACHINE SUPPORT" , "open list:GPIO SUBSYSTEM" , Andrew Jeffery , open list , Bartosz Golaszewski , Joel Stanley , Rashmica Gupta , "moderated list:ARM/ASPEED MACHINE SUPPORT" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org The current calculation for the number of GPIO banks is only correct if the number of GPIOs is a multiple of 32 (if there were 31 GPIOs we would currently say there are 0 banks, which is incorrect). Fixes: 361b79119a4b7 ('gpio: Add Aspeed driver') Signed-off-by: Rashmica Gupta Reviewed-by: Andrew Jeffery --- drivers/gpio/gpio-aspeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c index 9defe25d4721..b83e23aecd18 100644 --- a/drivers/gpio/gpio-aspeed.c +++ b/drivers/gpio/gpio-aspeed.c @@ -1165,7 +1165,7 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev) gpio->chip.base = -1; /* Allocate a cache of the output registers */ - banks = gpio->config->nr_gpios >> 5; + banks = DIV_ROUND_UP(gpio->config->nr_gpios, 32); gpio->dcache = devm_kcalloc(&pdev->dev, banks, sizeof(u32), GFP_KERNEL); if (!gpio->dcache) -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel