mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 20:58:14 -04:00
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>
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
#include <linux/mfd/syscon.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/property.h>
|
||||
@@ -72,14 +73,22 @@ static struct regmap *mchp_lan966x_syscon_to_regmap(struct device *dev,
|
||||
struct device_node *syscon_np)
|
||||
{
|
||||
struct regmap_config regmap_config = mchp_lan966x_syscon_regmap_config;
|
||||
resource_size_t size;
|
||||
struct resource res;
|
||||
void __iomem *base;
|
||||
int err;
|
||||
|
||||
base = devm_of_iomap(dev, syscon_np, 0, &size);
|
||||
if (IS_ERR(base))
|
||||
return ERR_CAST(base);
|
||||
err = of_address_to_resource(syscon_np, 0, &res);
|
||||
if (err)
|
||||
return ERR_PTR(err);
|
||||
|
||||
regmap_config.max_register = size - 4;
|
||||
/* It is not possible to use devm_of_iomap because this resource is
|
||||
* shared with other drivers.
|
||||
*/
|
||||
base = devm_ioremap(dev, res.start, resource_size(&res));
|
||||
if (!base)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
regmap_config.max_register = resource_size(&res) - 4;
|
||||
|
||||
return devm_regmap_init_mmio(dev, base, ®map_config);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user