Commit 7993e65f authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'mtd/fixes-for-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux

Pull MTD fixes from Miquel Raynal:
 "MTD changes:

   - Qcom:
      - Don't print error message on -EPROBE_DEFER
      - Fix kernel panic on skipped partition
      - Fix missing free for pparts in cleanup

   - phram: Prevent divide by zero bug in phram_setup()

  Raw NAND controller changes:

   - ingenic: Fix missing put_device in ingenic_ecc_get

   - qcom: Fix clock sequencing in qcom_nandc_probe()

   - omap2: Prevent invalid configuration and build error

   - gpmi: Don't leak PM reference in error path

   - brcmnand: Fix incorrect sub-page ECC status"

* tag 'mtd/fixes-for-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux:
  mtd: rawnand: brcmnand: Fixed incorrect sub-page ECC status
  mtd: rawnand: gpmi: don't leak PM reference in error path
  mtd: phram: Prevent divide by zero bug in phram_setup()
  mtd: rawnand: omap2: Prevent invalid configuration and build error
  mtd: parsers: qcom: Fix missing free for pparts in cleanup
  mtd: parsers: qcom: Fix kernel panic on skipped partition
  mtd: parsers: qcom: Don't print error message on -EPROBE_DEFER
  mtd: rawnand: qcom: Fix clock sequencing in qcom_nandc_probe()
  mtd: rawnand: ingenic: Fix missing put_device in ingenic_ecc_get
parents b9889768 36415a79
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -264,16 +264,20 @@ static int phram_setup(const char *val)
		}
	}

	if (erasesize)
		div_u64_rem(len, (uint32_t)erasesize, &rem);

	if (len == 0 || erasesize == 0 || erasesize > len
	    || erasesize > UINT_MAX || rem) {
	    || erasesize > UINT_MAX) {
		parse_err("illegal erasesize or len\n");
		ret = -EINVAL;
		goto error;
	}

	div_u64_rem(len, (uint32_t)erasesize, &rem);
	if (rem) {
		parse_err("len is not multiple of erasesize\n");
		ret = -EINVAL;
		goto error;
	}

	ret = register_device(name, start, len, (uint32_t)erasesize);
	if (ret)
		goto error;
+2 −1
Original line number Diff line number Diff line
@@ -42,7 +42,8 @@ config MTD_NAND_OMAP2
	tristate "OMAP2, OMAP3, OMAP4 and Keystone NAND controller"
	depends on ARCH_OMAP2PLUS || ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST
	depends on HAS_IOMEM
	select OMAP_GPMC if ARCH_K3
	select MEMORY
	select OMAP_GPMC
	help
	  Support for NAND flash on Texas Instruments OMAP2, OMAP3, OMAP4
	  and Keystone platforms.
+1 −1
Original line number Diff line number Diff line
@@ -2106,7 +2106,7 @@ static int brcmnand_read_by_pio(struct mtd_info *mtd, struct nand_chip *chip,
					mtd->oobsize / trans,
					host->hwcfg.sector_size_1k);

		if (!ret) {
		if (ret != -EBADMSG) {
			*err_addr = brcmnand_get_uncorrecc_addr(ctrl);

			if (*err_addr)
+2 −1
Original line number Diff line number Diff line
@@ -2285,7 +2285,7 @@ static int gpmi_nfc_exec_op(struct nand_chip *chip,
		this->hw.must_apply_timings = false;
		ret = gpmi_nfc_apply_timings(this);
		if (ret)
			return ret;
			goto out_pm;
	}

	dev_dbg(this->dev, "%s: %d instructions\n", __func__, op->ninstrs);
@@ -2414,6 +2414,7 @@ static int gpmi_nfc_exec_op(struct nand_chip *chip,

	this->bch = false;

out_pm:
	pm_runtime_mark_last_busy(this->dev);
	pm_runtime_put_autosuspend(this->dev);

+6 −1
Original line number Diff line number Diff line
@@ -68,9 +68,14 @@ static struct ingenic_ecc *ingenic_ecc_get(struct device_node *np)
	struct ingenic_ecc *ecc;

	pdev = of_find_device_by_node(np);
	if (!pdev || !platform_get_drvdata(pdev))
	if (!pdev)
		return ERR_PTR(-EPROBE_DEFER);

	if (!platform_get_drvdata(pdev)) {
		put_device(&pdev->dev);
		return ERR_PTR(-EPROBE_DEFER);
	}

	ecc = platform_get_drvdata(pdev);
	clk_prepare_enable(ecc->clk);

Loading