Skip to content

Commit b628007

Browse files
committed
Merge tag 'memory-controller-drv-6.12-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into soc/drivers
Memory controller drivers for v6.12, part two 1. Renesas RPC-IF: adjust default setting for pins to accommodate different flash devices, which should fix 4-bit flash writes with Renesas AT25QL128A flash. 2. Simplify a bit probe() in PL172 and PL353-SMC. * tag 'memory-controller-drv-6.12-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: memory: pl353-smc: simplify with scoped for each OF child loop memory: pl172: simplify releasing AMBA regions with devm memory: renesas-rpc-if: Use Hi-Z state as the default setting for IOVF pins Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 13e8744 + 32960b4 commit b628007

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

drivers/memory/pl172.c

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,13 @@ static int pl172_parse_cs_config(struct amba_device *adev,
187187
return -EINVAL;
188188
}
189189

190+
static void pl172_amba_release_regions(void *data)
191+
{
192+
struct amba_device *adev = data;
193+
194+
amba_release_regions(adev);
195+
}
196+
190197
static const char * const pl172_revisions[] = {"r1", "r2", "r2p3", "r2p4"};
191198
static const char * const pl175_revisions[] = {"r1"};
192199
static const char * const pl176_revisions[] = {"r0"};
@@ -232,13 +239,14 @@ static int pl172_probe(struct amba_device *adev, const struct amba_id *id)
232239
return ret;
233240
}
234241

242+
ret = devm_add_action_or_reset(dev, pl172_amba_release_regions, adev);
243+
if (ret)
244+
return ret;
245+
235246
pl172->base = devm_ioremap(dev, adev->res.start,
236247
resource_size(&adev->res));
237-
if (!pl172->base) {
238-
dev_err(dev, "ioremap failed\n");
239-
ret = -ENOMEM;
240-
goto err_no_ioremap;
241-
}
248+
if (!pl172->base)
249+
return dev_err_probe(dev, -ENOMEM, "ioremap failed\n");
242250

243251
amba_set_drvdata(adev, pl172);
244252

@@ -256,15 +264,6 @@ static int pl172_probe(struct amba_device *adev, const struct amba_id *id)
256264
}
257265

258266
return 0;
259-
260-
err_no_ioremap:
261-
amba_release_regions(adev);
262-
return ret;
263-
}
264-
265-
static void pl172_remove(struct amba_device *adev)
266-
{
267-
amba_release_regions(adev);
268267
}
269268

270269
static const struct amba_id pl172_ids[] = {
@@ -292,7 +291,6 @@ static struct amba_driver pl172_driver = {
292291
.name = "memory-pl172",
293292
},
294293
.probe = pl172_probe,
295-
.remove = pl172_remove,
296294
.id_table = pl172_ids,
297295
};
298296
module_amba_driver(pl172_driver);

drivers/memory/pl353-smc.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ static int pl353_smc_probe(struct amba_device *adev, const struct amba_id *id)
7474
struct device_node *of_node = adev->dev.of_node;
7575
const struct of_device_id *match = NULL;
7676
struct pl353_smc_data *pl353_smc;
77-
struct device_node *child;
7877

7978
pl353_smc = devm_kzalloc(&adev->dev, sizeof(*pl353_smc), GFP_KERNEL);
8079
if (!pl353_smc)
@@ -93,22 +92,20 @@ static int pl353_smc_probe(struct amba_device *adev, const struct amba_id *id)
9392
amba_set_drvdata(adev, pl353_smc);
9493

9594
/* Find compatible children. Only a single child is supported */
96-
for_each_available_child_of_node(of_node, child) {
95+
for_each_available_child_of_node_scoped(of_node, child) {
9796
match = of_match_node(pl353_smc_supported_children, child);
9897
if (!match) {
9998
dev_warn(&adev->dev, "unsupported child node\n");
10099
continue;
101100
}
101+
of_platform_device_create(child, NULL, &adev->dev);
102102
break;
103103
}
104104
if (!match) {
105105
dev_err(&adev->dev, "no matching children\n");
106106
return -ENODEV;
107107
}
108108

109-
of_platform_device_create(child, NULL, &adev->dev);
110-
of_node_put(child);
111-
112109
return 0;
113110
}
114111

drivers/memory/renesas-rpc-if.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ int rpcif_hw_init(struct device *dev, bool hyperflash)
367367
regmap_update_bits(rpc->regmap, RPCIF_CMNCR,
368368
RPCIF_CMNCR_MOIIO(3) | RPCIF_CMNCR_IOFV(3) |
369369
RPCIF_CMNCR_BSZ(3),
370-
RPCIF_CMNCR_MOIIO(1) | RPCIF_CMNCR_IOFV(2) |
370+
RPCIF_CMNCR_MOIIO(1) | RPCIF_CMNCR_IOFV(3) |
371371
RPCIF_CMNCR_BSZ(hyperflash ? 1 : 0));
372372
else
373373
regmap_update_bits(rpc->regmap, RPCIF_CMNCR,

0 commit comments

Comments
 (0)