Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
From 1b63d3a80c412d16198bcb6a71c07786f6ffa36c Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.com>
|
||||
Date: Wed, 15 Nov 2023 14:49:55 +0000
|
||||
Subject: [PATCH 0827/1085] pinctrl: bcm2712: Fix for sparse GPIOs
|
||||
|
||||
BCM2712D0's sparse GPIO map revealed that it is not safe to treat
|
||||
group_selector as the GPIO number - it is an index into the array of
|
||||
pinctrl_pin_descs, and the "number" member says which GPIO it refers to.
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
---
|
||||
drivers/pinctrl/bcm/pinctrl-bcm2712.c | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/pinctrl/bcm/pinctrl-bcm2712.c
|
||||
+++ b/drivers/pinctrl/bcm/pinctrl-bcm2712.c
|
||||
@@ -906,8 +906,13 @@ static int bcm2712_pmx_set(struct pinctr
|
||||
unsigned group_selector)
|
||||
{
|
||||
struct bcm2712_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
|
||||
+ const struct pinctrl_desc *pctldesc = &pc->pctl_desc;
|
||||
+ const struct pinctrl_pin_desc *pindesc;
|
||||
|
||||
- bcm2712_pinctrl_fsel_set(pc, group_selector, func_selector);
|
||||
+ if (group_selector >= pctldesc->npins)
|
||||
+ return -EINVAL;
|
||||
+ pindesc = &pctldesc->pins[group_selector];
|
||||
+ bcm2712_pinctrl_fsel_set(pc, pindesc->number, func_selector);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user