Commit 44e4a2c7 authored by Arnd Bergmann's avatar Arnd Bergmann

Merge tag 'memory-controller-drv-fixes-5.18' of...

Merge tag 'memory-controller-drv-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into arm/fixes

Memory controller drivers - fixes for v5.18

Issues in v5.18:
1. Freescale/NXP: fix populating children of Integrated Flash Controller
   DT nodes.

Issues existing before:
1. Renesas: fix platform-device leak in probe's error path.
2. Atmel: fix of_node reference leak in probe's error path.
3. Synopsys: correct the bindings for snps,ddrc-3.80a (interrupts are
   required).

* tag 'memory-controller-drv-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl:
  memory: fsl_ifc: populate child nodes of buses and mfd devices
  dt-bindings: memory: snps,ddrc-3.80a compatible also need interrupts
  memory: atmel-ebi: Fix missing of_node_put in atmel_ebi_probe
  memory: renesas-rpc-if: fix platform-device leak in error path

Link: https://lore.kernel.org/r/20220407081448.113208-1-krzysztof.kozlowski@linaro.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents 02481c7b dd8adc71
...@@ -24,9 +24,9 @@ description: | ...@@ -24,9 +24,9 @@ description: |
properties: properties:
compatible: compatible:
enum: enum:
- snps,ddrc-3.80a
- xlnx,zynq-ddrc-a05 - xlnx,zynq-ddrc-a05
- xlnx,zynqmp-ddrc-2.40a - xlnx,zynqmp-ddrc-2.40a
- snps,ddrc-3.80a
interrupts: interrupts:
maxItems: 1 maxItems: 1
...@@ -43,7 +43,9 @@ allOf: ...@@ -43,7 +43,9 @@ allOf:
properties: properties:
compatible: compatible:
contains: contains:
const: xlnx,zynqmp-ddrc-2.40a enum:
- snps,ddrc-3.80a
- xlnx,zynqmp-ddrc-2.40a
then: then:
required: required:
- interrupts - interrupts
......
...@@ -544,20 +544,27 @@ static int atmel_ebi_probe(struct platform_device *pdev) ...@@ -544,20 +544,27 @@ static int atmel_ebi_probe(struct platform_device *pdev)
smc_np = of_parse_phandle(dev->of_node, "atmel,smc", 0); smc_np = of_parse_phandle(dev->of_node, "atmel,smc", 0);
ebi->smc.regmap = syscon_node_to_regmap(smc_np); ebi->smc.regmap = syscon_node_to_regmap(smc_np);
if (IS_ERR(ebi->smc.regmap)) if (IS_ERR(ebi->smc.regmap)) {
return PTR_ERR(ebi->smc.regmap); ret = PTR_ERR(ebi->smc.regmap);
goto put_node;
}
ebi->smc.layout = atmel_hsmc_get_reg_layout(smc_np); ebi->smc.layout = atmel_hsmc_get_reg_layout(smc_np);
if (IS_ERR(ebi->smc.layout)) if (IS_ERR(ebi->smc.layout)) {
return PTR_ERR(ebi->smc.layout); ret = PTR_ERR(ebi->smc.layout);
goto put_node;
}
ebi->smc.clk = of_clk_get(smc_np, 0); ebi->smc.clk = of_clk_get(smc_np, 0);
if (IS_ERR(ebi->smc.clk)) { if (IS_ERR(ebi->smc.clk)) {
if (PTR_ERR(ebi->smc.clk) != -ENOENT) if (PTR_ERR(ebi->smc.clk) != -ENOENT) {
return PTR_ERR(ebi->smc.clk); ret = PTR_ERR(ebi->smc.clk);
goto put_node;
}
ebi->smc.clk = NULL; ebi->smc.clk = NULL;
} }
of_node_put(smc_np);
ret = clk_prepare_enable(ebi->smc.clk); ret = clk_prepare_enable(ebi->smc.clk);
if (ret) if (ret)
return ret; return ret;
...@@ -608,6 +615,10 @@ static int atmel_ebi_probe(struct platform_device *pdev) ...@@ -608,6 +615,10 @@ static int atmel_ebi_probe(struct platform_device *pdev)
} }
return of_platform_populate(np, NULL, NULL, dev); return of_platform_populate(np, NULL, NULL, dev);
put_node:
of_node_put(smc_np);
return ret;
} }
static __maybe_unused int atmel_ebi_resume(struct device *dev) static __maybe_unused int atmel_ebi_resume(struct device *dev)
......
...@@ -287,8 +287,7 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev) ...@@ -287,8 +287,7 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev)
} }
/* legacy dts may still use "simple-bus" compatible */ /* legacy dts may still use "simple-bus" compatible */
ret = of_platform_populate(dev->dev.of_node, NULL, NULL, ret = of_platform_default_populate(dev->dev.of_node, NULL, &dev->dev);
&dev->dev);
if (ret) if (ret)
goto err_free_nandirq; goto err_free_nandirq;
......
...@@ -651,6 +651,7 @@ static int rpcif_probe(struct platform_device *pdev) ...@@ -651,6 +651,7 @@ static int rpcif_probe(struct platform_device *pdev)
struct platform_device *vdev; struct platform_device *vdev;
struct device_node *flash; struct device_node *flash;
const char *name; const char *name;
int ret;
flash = of_get_next_child(pdev->dev.of_node, NULL); flash = of_get_next_child(pdev->dev.of_node, NULL);
if (!flash) { if (!flash) {
...@@ -674,7 +675,14 @@ static int rpcif_probe(struct platform_device *pdev) ...@@ -674,7 +675,14 @@ static int rpcif_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
vdev->dev.parent = &pdev->dev; vdev->dev.parent = &pdev->dev;
platform_set_drvdata(pdev, vdev); platform_set_drvdata(pdev, vdev);
return platform_device_add(vdev);
ret = platform_device_add(vdev);
if (ret) {
platform_device_put(vdev);
return ret;
}
return 0;
} }
static int rpcif_remove(struct platform_device *pdev) static int rpcif_remove(struct platform_device *pdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment