Skip to content

Commit 2eb824f

Browse files
committed
Merge tag 'mtd/fixes-for-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux
Pull mtd fixes from Miquel Raynal: "MTD core: - partitions: Add missing of_node_get() in dynamic partitions code Parser drivers: - bcm47xxpart: Fix halfblock reads Raw NAND controller drivers: - marvell: Use correct logic for nand-keep-config - tegra: Fix PM disable depth imbalance in probe - intel: Add missing of_node_put() in ebu_nand_probe() SPI-NOR core changes: - Ignore -ENOTSUPP in spi_nor_init()" * tag 'mtd/fixes-for-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: mtd: parsers: bcm47xxpart: Fix halfblock reads mtd: rawnand: marvell: Use correct logic for nand-keep-config mtd: rawnand: tegra: Fix PM disable depth imbalance in probe mtd: rawnand: intel: Add missing of_node_put() in ebu_nand_probe() mtd: core: add missing of_node_get() in dynamic partitions code mtd: spi-nor: core: Ignore -ENOTSUPP in spi_nor_init()
2 parents f186fd2 + 05e258c commit 2eb824f

File tree

6 files changed

+25
-14
lines changed

6 files changed

+25
-14
lines changed

drivers/mtd/mtdcore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ static void mtd_check_of_node(struct mtd_info *mtd)
562562
if (!mtd_is_partition(mtd))
563563
return;
564564
parent = mtd->parent;
565-
parent_dn = dev_of_node(&parent->dev);
565+
parent_dn = of_node_get(dev_of_node(&parent->dev));
566566
if (!parent_dn)
567567
return;
568568

drivers/mtd/nand/raw/intel-nand-controller.c

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -608,30 +608,35 @@ static int ebu_nand_probe(struct platform_device *pdev)
608608
ret = of_property_read_u32(chip_np, "reg", &cs);
609609
if (ret) {
610610
dev_err(dev, "failed to get chip select: %d\n", ret);
611-
return ret;
611+
goto err_of_node_put;
612612
}
613613
if (cs >= MAX_CS) {
614614
dev_err(dev, "got invalid chip select: %d\n", cs);
615-
return -EINVAL;
615+
ret = -EINVAL;
616+
goto err_of_node_put;
616617
}
617618

618619
ebu_host->cs_num = cs;
619620

620621
resname = devm_kasprintf(dev, GFP_KERNEL, "nand_cs%d", cs);
621622
ebu_host->cs[cs].chipaddr = devm_platform_ioremap_resource_byname(pdev,
622623
resname);
623-
if (IS_ERR(ebu_host->cs[cs].chipaddr))
624-
return PTR_ERR(ebu_host->cs[cs].chipaddr);
624+
if (IS_ERR(ebu_host->cs[cs].chipaddr)) {
625+
ret = PTR_ERR(ebu_host->cs[cs].chipaddr);
626+
goto err_of_node_put;
627+
}
625628

626629
ebu_host->clk = devm_clk_get(dev, NULL);
627-
if (IS_ERR(ebu_host->clk))
628-
return dev_err_probe(dev, PTR_ERR(ebu_host->clk),
629-
"failed to get clock\n");
630+
if (IS_ERR(ebu_host->clk)) {
631+
ret = dev_err_probe(dev, PTR_ERR(ebu_host->clk),
632+
"failed to get clock\n");
633+
goto err_of_node_put;
634+
}
630635

631636
ret = clk_prepare_enable(ebu_host->clk);
632637
if (ret) {
633638
dev_err(dev, "failed to enable clock: %d\n", ret);
634-
return ret;
639+
goto err_of_node_put;
635640
}
636641

637642
ebu_host->dma_tx = dma_request_chan(dev, "tx");
@@ -695,6 +700,8 @@ static int ebu_nand_probe(struct platform_device *pdev)
695700
ebu_dma_cleanup(ebu_host);
696701
err_disable_unprepare_clk:
697702
clk_disable_unprepare(ebu_host->clk);
703+
err_of_node_put:
704+
of_node_put(chip_np);
698705

699706
return ret;
700707
}

drivers/mtd/nand/raw/marvell_nand.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2678,7 +2678,7 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc,
26782678
chip->controller = &nfc->controller;
26792679
nand_set_flash_node(chip, np);
26802680

2681-
if (!of_property_read_bool(np, "marvell,nand-keep-config"))
2681+
if (of_property_read_bool(np, "marvell,nand-keep-config"))
26822682
chip->options |= NAND_KEEP_TIMINGS;
26832683

26842684
mtd = nand_to_mtd(chip);

drivers/mtd/nand/raw/tegra_nand.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,7 @@ static int tegra_nand_probe(struct platform_device *pdev)
11811181
pm_runtime_enable(&pdev->dev);
11821182
err = pm_runtime_resume_and_get(&pdev->dev);
11831183
if (err)
1184-
return err;
1184+
goto err_dis_pm;
11851185

11861186
err = reset_control_reset(rst);
11871187
if (err) {
@@ -1215,6 +1215,8 @@ static int tegra_nand_probe(struct platform_device *pdev)
12151215
err_put_pm:
12161216
pm_runtime_put_sync_suspend(ctrl->dev);
12171217
pm_runtime_force_suspend(ctrl->dev);
1218+
err_dis_pm:
1219+
pm_runtime_disable(&pdev->dev);
12181220
return err;
12191221
}
12201222

drivers/mtd/parsers/bcm47xxpart.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,11 @@ static int bcm47xxpart_parse(struct mtd_info *master,
233233
}
234234

235235
/* Read middle of the block */
236-
err = mtd_read(master, offset + 0x8000, 0x4, &bytes_read,
236+
err = mtd_read(master, offset + (blocksize / 2), 0x4, &bytes_read,
237237
(uint8_t *)buf);
238238
if (err && !mtd_is_bitflip(err)) {
239239
pr_err("mtd_read error while parsing (offset: 0x%X): %d\n",
240-
offset + 0x8000, err);
240+
offset + (blocksize / 2), err);
241241
continue;
242242
}
243243

drivers/mtd/spi-nor/core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2724,7 +2724,9 @@ static int spi_nor_init(struct spi_nor *nor)
27242724
*/
27252725
WARN_ONCE(nor->flags & SNOR_F_BROKEN_RESET,
27262726
"enabling reset hack; may not recover from unexpected reboots\n");
2727-
return nor->params->set_4byte_addr_mode(nor, true);
2727+
err = nor->params->set_4byte_addr_mode(nor, true);
2728+
if (err && err != -ENOTSUPP)
2729+
return err;
27282730
}
27292731

27302732
return 0;

0 commit comments

Comments
 (0)