Commit 2eb824f6 authored by Linus Torvalds's avatar Linus Torvalds

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()
parents f186fd2f 05e258c6
......@@ -562,7 +562,7 @@ static void mtd_check_of_node(struct mtd_info *mtd)
if (!mtd_is_partition(mtd))
return;
parent = mtd->parent;
parent_dn = dev_of_node(&parent->dev);
parent_dn = of_node_get(dev_of_node(&parent->dev));
if (!parent_dn)
return;
......
......@@ -608,11 +608,12 @@ static int ebu_nand_probe(struct platform_device *pdev)
ret = of_property_read_u32(chip_np, "reg", &cs);
if (ret) {
dev_err(dev, "failed to get chip select: %d\n", ret);
return ret;
goto err_of_node_put;
}
if (cs >= MAX_CS) {
dev_err(dev, "got invalid chip select: %d\n", cs);
return -EINVAL;
ret = -EINVAL;
goto err_of_node_put;
}
ebu_host->cs_num = cs;
......@@ -620,18 +621,22 @@ static int ebu_nand_probe(struct platform_device *pdev)
resname = devm_kasprintf(dev, GFP_KERNEL, "nand_cs%d", cs);
ebu_host->cs[cs].chipaddr = devm_platform_ioremap_resource_byname(pdev,
resname);
if (IS_ERR(ebu_host->cs[cs].chipaddr))
return PTR_ERR(ebu_host->cs[cs].chipaddr);
if (IS_ERR(ebu_host->cs[cs].chipaddr)) {
ret = PTR_ERR(ebu_host->cs[cs].chipaddr);
goto err_of_node_put;
}
ebu_host->clk = devm_clk_get(dev, NULL);
if (IS_ERR(ebu_host->clk))
return dev_err_probe(dev, PTR_ERR(ebu_host->clk),
"failed to get clock\n");
if (IS_ERR(ebu_host->clk)) {
ret = dev_err_probe(dev, PTR_ERR(ebu_host->clk),
"failed to get clock\n");
goto err_of_node_put;
}
ret = clk_prepare_enable(ebu_host->clk);
if (ret) {
dev_err(dev, "failed to enable clock: %d\n", ret);
return ret;
goto err_of_node_put;
}
ebu_host->dma_tx = dma_request_chan(dev, "tx");
......@@ -695,6 +700,8 @@ static int ebu_nand_probe(struct platform_device *pdev)
ebu_dma_cleanup(ebu_host);
err_disable_unprepare_clk:
clk_disable_unprepare(ebu_host->clk);
err_of_node_put:
of_node_put(chip_np);
return ret;
}
......
......@@ -2678,7 +2678,7 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc,
chip->controller = &nfc->controller;
nand_set_flash_node(chip, np);
if (!of_property_read_bool(np, "marvell,nand-keep-config"))
if (of_property_read_bool(np, "marvell,nand-keep-config"))
chip->options |= NAND_KEEP_TIMINGS;
mtd = nand_to_mtd(chip);
......
......@@ -1181,7 +1181,7 @@ static int tegra_nand_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);
err = pm_runtime_resume_and_get(&pdev->dev);
if (err)
return err;
goto err_dis_pm;
err = reset_control_reset(rst);
if (err) {
......@@ -1215,6 +1215,8 @@ static int tegra_nand_probe(struct platform_device *pdev)
err_put_pm:
pm_runtime_put_sync_suspend(ctrl->dev);
pm_runtime_force_suspend(ctrl->dev);
err_dis_pm:
pm_runtime_disable(&pdev->dev);
return err;
}
......
......@@ -233,11 +233,11 @@ static int bcm47xxpart_parse(struct mtd_info *master,
}
/* Read middle of the block */
err = mtd_read(master, offset + 0x8000, 0x4, &bytes_read,
err = mtd_read(master, offset + (blocksize / 2), 0x4, &bytes_read,
(uint8_t *)buf);
if (err && !mtd_is_bitflip(err)) {
pr_err("mtd_read error while parsing (offset: 0x%X): %d\n",
offset + 0x8000, err);
offset + (blocksize / 2), err);
continue;
}
......
......@@ -2724,7 +2724,9 @@ static int spi_nor_init(struct spi_nor *nor)
*/
WARN_ONCE(nor->flags & SNOR_F_BROKEN_RESET,
"enabling reset hack; may not recover from unexpected reboots\n");
return nor->params->set_4byte_addr_mode(nor, true);
err = nor->params->set_4byte_addr_mode(nor, true);
if (err && err != -ENOTSUPP)
return err;
}
return 0;
......
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