[PATCH 2/3] pinctrl: single: Allow probe to continue if mem region busy

Billy Tsai
2025-12-22T12:09:43Z

Skip exclusive memory region reservation failure during probe and
continue initialization with a warning. This enables support for
systems where the memory region may already be reserved, improving
probe robustness.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
---
drivers/pinctrl/pinctrl-single.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index 757c22cc09f3..e65ae737b4c5 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -1910,13 +1910,13 @@ static int pcs_probe(struct platform_device *pdev)

pcs->res = devm_request_mem_region(pcs->dev, res->start,
resource_size(res), DRIVER_NAME);
- if (!pcs->res) {
- dev_err(pcs->dev, "could not get mem_region\n");
- return -EBUSY;
- }
+ if (!pcs->res)
+ dev_warn(pcs->dev, "mem_region busy, continuing without reservation\n");
+ else
+ res = pcs->res;

- pcs->size = resource_size(pcs->res);
- pcs->base = devm_ioremap(pcs->dev, pcs->res->start, pcs->size);
+ pcs->size = resource_size(res);
+ pcs->base = devm_ioremap(pcs->dev, res->start, pcs->size);
if (!pcs->base) {
dev_err(pcs->dev, "could not ioremap\n");
return -ENODEV;

--
2.34.1