Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions drivers/firmware/microchip/mpfs-auto-update.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*
Expand Down Expand Up @@ -427,6 +423,11 @@ 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))
return dev_err_probe(dev, -ENODEV,
"No flash connected to the system controller, auto-update not supported\n");

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

Expand Down