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

Configure Feed

Select the types of activity you want to include in your feed.

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: Conor 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: Krzysztof Kozlowski <krzk@kernel.org>

+14 -8
+6 -4
drivers/firmware/microchip/mpfs-auto-update.c
··· 113 113 * be added here. 114 114 */ 115 115 116 - priv->flash = mpfs_sys_controller_get_flash(priv->sys_controller); 117 - if (!priv->flash) 118 - return FW_UPLOAD_ERR_HW_ERROR; 119 - 120 116 erase_size = round_up(erase_size, (u64)priv->flash->erasesize); 121 117 122 118 /* ··· 422 426 if (IS_ERR(priv->sys_controller)) 423 427 return dev_err_probe(dev, PTR_ERR(priv->sys_controller), 424 428 "Could not register as a sub device of the system controller\n"); 429 + 430 + priv->flash = mpfs_sys_controller_get_flash(priv->sys_controller); 431 + if (IS_ERR_OR_NULL(priv->flash)) { 432 + dev_dbg(dev, "No flash connected to the system controller, auto-update not supported\n"); 433 + return -ENODEV; 434 + } 425 435 426 436 priv->dev = dev; 427 437 platform_set_drvdata(pdev, priv);
+4 -2
drivers/soc/microchip/mpfs-control-scb.c
··· 14 14 { 15 15 struct device *dev = &pdev->dev; 16 16 17 - return mfd_add_devices(dev, PLATFORM_DEVID_NONE, mpfs_control_scb_devs, 18 - ARRAY_SIZE(mpfs_control_scb_devs), NULL, 0, NULL); 17 + return devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE, 18 + mpfs_control_scb_devs, 19 + ARRAY_SIZE(mpfs_control_scb_devs), NULL, 0, 20 + NULL); 19 21 } 20 22 21 23 static const struct of_device_id mpfs_control_scb_of_match[] = {
+4 -2
drivers/soc/microchip/mpfs-mss-top-sysreg.c
··· 16 16 struct device *dev = &pdev->dev; 17 17 int ret; 18 18 19 - ret = mfd_add_devices(dev, PLATFORM_DEVID_NONE, mpfs_mss_top_sysreg_devs, 20 - ARRAY_SIZE(mpfs_mss_top_sysreg_devs) , NULL, 0, NULL); 19 + ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE, 20 + mpfs_mss_top_sysreg_devs, 21 + ARRAY_SIZE(mpfs_mss_top_sysreg_devs), NULL, 22 + 0, NULL); 21 23 if (ret) 22 24 return ret; 23 25