Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EFD39C6FD19 for ; Thu, 16 Mar 2023 16:46:11 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B17A085C3C; Thu, 16 Mar 2023 17:46:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZOQ+3BKG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 674C985CCB; Thu, 16 Mar 2023 17:46:06 +0100 (CET) Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EDDBF85CA2 for ; Thu, 16 Mar 2023 17:46:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-ed1-x52b.google.com with SMTP id x13so10182721edd.1 for ; Thu, 16 Mar 2023 09:46:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678985163; h=content-transfer-encoding:content-language:cc:to:subject:from :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=LbMNE9GwvFaoxvVfMfkpMUY7xxX3yXBjbulPe6tgah8=; b=ZOQ+3BKGm7EcpdedlQkkiE39TQNZ1MqSf99E50fHDCWp4hOoqmin3+bTGv5nfE4ikl s/78sea16GWo9Aq46r4utKWu1DcNMVGvTT4sPAzlkB14fM8m2oAgB4SKy9YrNVtmpPZh HbOL2QKtyJTL5CI7RO2DisEGAROcCYYfLnOYQ5hEwfk0/PEYz/GHVSL+MHueDQdcWYdD atRo4bSocYgyuQwZfhZli/MP36hkfkFNDKQk1AmadgaEfE0EfnoYpMlFaf7SXAEiJCNj tCSlm7CpawWRr2u4lLrHyw60XF21xkwpeyWLOxdL62l6bHeIq2XmvWOXgaLnLoC5qrAH 8j2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678985163; h=content-transfer-encoding:content-language:cc:to:subject:from :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=LbMNE9GwvFaoxvVfMfkpMUY7xxX3yXBjbulPe6tgah8=; b=XVGxIwr0NyjXHXxLI22vkrPa/jIXzbE3RIXOjS3kumKNs5m8k0ETPiYNsOlG9iPlc7 q/G4aTtjuqY5ugSoGQhJzPXywSB4EpbLnopNESohmn9F2P8REtqft5oJTIpSnZHCJ6uI R3CewMkfnOq6hFnrGcSl1JHzTwkoJo0A/rizQtH9WigZRSKMoG0w9wRkv9QSPIf4wSkL Y3rKxKO5gwVf5rfKTgz73zx2036TQwzxfHT+dIInI3kxn5AbIrtYSr1to04qOEsQcIY3 6rgRyt4WruEPCotwtTdQbK59/kYK0pJiXlf/EBqe092+91jVfSD0nM4CcGutaJ38UOJw 6T1w== X-Gm-Message-State: AO0yUKUizbiccv90tZlWPl/QLULOYQZ72mM2DEAEvxvSXGuWlr/xKzYL N5ngXXqc0UeJzeqG7pH4hwM= X-Google-Smtp-Source: AK7set+NxS+bkk5NFKuxtp/H6WbiSmZ6GH/5RJZESp7OAtF3WuaQ23lkLqZNDLdOPqJISz/e1/+Lxw== X-Received: by 2002:aa7:cf10:0:b0:4fb:3ab9:fe81 with SMTP id a16-20020aa7cf10000000b004fb3ab9fe81mr182000edy.30.1678985163360; Thu, 16 Mar 2023 09:46:03 -0700 (PDT) Received: from [192.168.2.2] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id bt20-20020a0564020a5400b004fb419921e2sm4045889edb.57.2023.03.16.09.46.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Mar 2023 09:46:02 -0700 (PDT) Message-ID: Date: Thu, 16 Mar 2023 17:46:01 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 From: Johan Jonker Subject: [PATCH v1 1/6] rockchip: gpio: rk_gpio: use ROCKCHIP_GPIOS_PER_BANK as divider To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, u-boot@lists.denx.de Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The current divider to calculate the bank ID can change. Use a constant ROCKCHIP_GPIOS_PER_BANK as fixed divider. Signed-off-by: Johan Jonker --- drivers/gpio/rk_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/rk_gpio.c b/drivers/gpio/rk_gpio.c index f7ad4d68..0a2acf18 100644 --- a/drivers/gpio/rk_gpio.c +++ b/drivers/gpio/rk_gpio.c @@ -160,7 +160,7 @@ static int rockchip_gpio_probe(struct udevice *dev) 0, &args); if (!ret || ret != -ENOENT) { uc_priv->gpio_count = args.args[2]; - priv->bank = args.args[1] / args.args[2]; + priv->bank = args.args[1] / ROCKCHIP_GPIOS_PER_BANK; } else { uc_priv->gpio_count = ROCKCHIP_GPIOS_PER_BANK; end = strrchr(dev->name, '@'); -- 2.20.1