Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+31 -11
+4 -2
Documentation/devicetree/bindings/memory-controllers/synopsys,ddrc-ecc.yaml
··· 24 24 properties: 25 25 compatible: 26 26 enum: 27 + - snps,ddrc-3.80a 27 28 - xlnx,zynq-ddrc-a05 28 29 - xlnx,zynqmp-ddrc-2.40a 29 - - snps,ddrc-3.80a 30 30 31 31 interrupts: 32 32 maxItems: 1 ··· 43 43 properties: 44 44 compatible: 45 45 contains: 46 - const: xlnx,zynqmp-ddrc-2.40a 46 + enum: 47 + - snps,ddrc-3.80a 48 + - xlnx,zynqmp-ddrc-2.40a 47 49 then: 48 50 required: 49 51 - interrupts
+17 -6
drivers/memory/atmel-ebi.c
··· 544 544 smc_np = of_parse_phandle(dev->of_node, "atmel,smc", 0); 545 545 546 546 ebi->smc.regmap = syscon_node_to_regmap(smc_np); 547 - if (IS_ERR(ebi->smc.regmap)) 548 - return PTR_ERR(ebi->smc.regmap); 547 + if (IS_ERR(ebi->smc.regmap)) { 548 + ret = PTR_ERR(ebi->smc.regmap); 549 + goto put_node; 550 + } 549 551 550 552 ebi->smc.layout = atmel_hsmc_get_reg_layout(smc_np); 551 - if (IS_ERR(ebi->smc.layout)) 552 - return PTR_ERR(ebi->smc.layout); 553 + if (IS_ERR(ebi->smc.layout)) { 554 + ret = PTR_ERR(ebi->smc.layout); 555 + goto put_node; 556 + } 553 557 554 558 ebi->smc.clk = of_clk_get(smc_np, 0); 555 559 if (IS_ERR(ebi->smc.clk)) { 556 - if (PTR_ERR(ebi->smc.clk) != -ENOENT) 557 - return PTR_ERR(ebi->smc.clk); 560 + if (PTR_ERR(ebi->smc.clk) != -ENOENT) { 561 + ret = PTR_ERR(ebi->smc.clk); 562 + goto put_node; 563 + } 558 564 559 565 ebi->smc.clk = NULL; 560 566 } 567 + of_node_put(smc_np); 561 568 ret = clk_prepare_enable(ebi->smc.clk); 562 569 if (ret) 563 570 return ret; ··· 615 608 } 616 609 617 610 return of_platform_populate(np, NULL, NULL, dev); 611 + 612 + put_node: 613 + of_node_put(smc_np); 614 + return ret; 618 615 } 619 616 620 617 static __maybe_unused int atmel_ebi_resume(struct device *dev)
+1 -2
drivers/memory/fsl_ifc.c
··· 287 287 } 288 288 289 289 /* legacy dts may still use "simple-bus" compatible */ 290 - ret = of_platform_populate(dev->dev.of_node, NULL, NULL, 291 - &dev->dev); 290 + ret = of_platform_default_populate(dev->dev.of_node, NULL, &dev->dev); 292 291 if (ret) 293 292 goto err_free_nandirq; 294 293
+9 -1
drivers/memory/renesas-rpc-if.c
··· 651 651 struct platform_device *vdev; 652 652 struct device_node *flash; 653 653 const char *name; 654 + int ret; 654 655 655 656 flash = of_get_next_child(pdev->dev.of_node, NULL); 656 657 if (!flash) { ··· 675 674 return -ENOMEM; 676 675 vdev->dev.parent = &pdev->dev; 677 676 platform_set_drvdata(pdev, vdev); 678 - return platform_device_add(vdev); 677 + 678 + ret = platform_device_add(vdev); 679 + if (ret) { 680 + platform_device_put(vdev); 681 + return ret; 682 + } 683 + 684 + return 0; 679 685 } 680 686 681 687 static int rpcif_remove(struct platform_device *pdev)