Skip to content

Commit 5c81649

Browse files
committed
Merge tag 'reset-fixes-for-v6.14' of git://git.pengutronix.de/pza/linux into arm/fixes
Reset controller fixes for v6.14 * Fix lan966x boot with internal CPU by stopping reset-microchip-sparx5 from indirectly calling devm_request_mem_region() on a memory region shared with other devices. * tag 'reset-fixes-for-v6.14' of git://git.pengutronix.de/pza/linux: reset: mchp: sparx5: Fix for lan966x Link: https://lore.kernel.org/r/20250314164401.743984-1-p.zabel@pengutronix.de Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents 262666c + 0e2268f commit 5c81649

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

drivers/reset/reset-microchip-sparx5.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99
#include <linux/mfd/syscon.h>
1010
#include <linux/of.h>
11+
#include <linux/of_address.h>
1112
#include <linux/module.h>
1213
#include <linux/platform_device.h>
1314
#include <linux/property.h>
@@ -72,14 +73,22 @@ static struct regmap *mchp_lan966x_syscon_to_regmap(struct device *dev,
7273
struct device_node *syscon_np)
7374
{
7475
struct regmap_config regmap_config = mchp_lan966x_syscon_regmap_config;
75-
resource_size_t size;
76+
struct resource res;
7677
void __iomem *base;
78+
int err;
79+
80+
err = of_address_to_resource(syscon_np, 0, &res);
81+
if (err)
82+
return ERR_PTR(err);
7783

78-
base = devm_of_iomap(dev, syscon_np, 0, &size);
79-
if (IS_ERR(base))
80-
return ERR_CAST(base);
84+
/* It is not possible to use devm_of_iomap because this resource is
85+
* shared with other drivers.
86+
*/
87+
base = devm_ioremap(dev, res.start, resource_size(&res));
88+
if (!base)
89+
return ERR_PTR(-ENOMEM);
8190

82-
regmap_config.max_register = size - 4;
91+
regmap_config.max_register = resource_size(&res) - 4;
8392

8493
return devm_regmap_init_mmio(dev, base, &regmap_config);
8594
}

0 commit comments

Comments
 (0)