Commit 7962fd93 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski
Browse files

Merge tag 'riscv-soc-fixes-for-v7.0-rc6' of...

Merge tag 'riscv-soc-fixes-for-v7.0-rc6' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/conor/linux

 into arm/fixes

RISC-V soc fixes for v7.0-rc6

Microchip:
More resource leak fixes for unlikely scenarios, and a change to the
auto-update "firmware" driver to prevent it probing on systems with
engineering silicon where it cannot be used.

Signed-off-by: default avatarConor Dooley <conor.dooley@microchip.com>

* tag 'riscv-soc-fixes-for-v7.0-rc6' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/conor/linux

:
  firmware: microchip: fail auto-update probe if no flash found
  soc: microchip: mpfs-mss-top-sysreg: Fix resource leak on driver unbind
  soc: microchip: mpfs-control-scb: Fix resource leak on driver unbind

Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
parents 4b2b3f03 c7596f90
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -113,10 +113,6 @@ static enum fw_upload_err mpfs_auto_update_prepare(struct fw_upload *fw_uploader
	 * be added here.
	 */

	priv->flash = mpfs_sys_controller_get_flash(priv->sys_controller);
	if (!priv->flash)
		return FW_UPLOAD_ERR_HW_ERROR;

	erase_size = round_up(erase_size, (u64)priv->flash->erasesize);

	/*
@@ -427,6 +423,12 @@ static int mpfs_auto_update_probe(struct platform_device *pdev)
		return dev_err_probe(dev, PTR_ERR(priv->sys_controller),
				     "Could not register as a sub device of the system controller\n");

	priv->flash = mpfs_sys_controller_get_flash(priv->sys_controller);
	if (IS_ERR_OR_NULL(priv->flash)) {
		dev_dbg(dev, "No flash connected to the system controller, auto-update not supported\n");
		return -ENODEV;
	}

	priv->dev = dev;
	platform_set_drvdata(pdev, priv);

+4 −2
Original line number Diff line number Diff line
@@ -14,8 +14,10 @@ static int mpfs_control_scb_probe(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;

	return mfd_add_devices(dev, PLATFORM_DEVID_NONE, mpfs_control_scb_devs,
			       ARRAY_SIZE(mpfs_control_scb_devs), NULL, 0, NULL);
	return devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE,
				    mpfs_control_scb_devs,
				    ARRAY_SIZE(mpfs_control_scb_devs), NULL, 0,
				    NULL);
}

static const struct of_device_id mpfs_control_scb_of_match[] = {
+4 −2
Original line number Diff line number Diff line
@@ -16,8 +16,10 @@ static int mpfs_mss_top_sysreg_probe(struct platform_device *pdev)
	struct device *dev = &pdev->dev;
	int ret;

	ret = mfd_add_devices(dev, PLATFORM_DEVID_NONE, mpfs_mss_top_sysreg_devs,
			      ARRAY_SIZE(mpfs_mss_top_sysreg_devs) , NULL, 0, NULL);
	ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE,
				   mpfs_mss_top_sysreg_devs,
				   ARRAY_SIZE(mpfs_mss_top_sysreg_devs), NULL,
				   0, NULL);
	if (ret)
		return ret;