Commit 242fb2f1 authored by Markus Mayer's avatar Markus Mayer Committed by Florian Fainelli
Browse files

memory: brcmstb: dpfe: support for deferred firmware download



We add support for deferred downloading of the DPFE firmware. It may be
necessary to do this if the root file system containing the firmware
image is not yet available at the time the driver's probe function is
being called.

Signed-off-by: default avatarMarkus Mayer <mmayer@broadcom.com>
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
parent ac2ea9cf
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -614,10 +614,13 @@ static int brcmstb_dpfe_download_firmware(struct brcmstb_dpfe_priv *priv)
	if (!priv->dpfe_api->fw_name)
		return -ENODEV;

	ret = request_firmware(&fw, priv->dpfe_api->fw_name, dev);
	/* request_firmware() prints its own error messages. */
	ret = firmware_request_nowarn(&fw, priv->dpfe_api->fw_name, dev);
	/*
	 * Defer the firmware download if the firmware file couldn't be found.
	 * The root file system may not be available yet.
	 */
	if (ret)
		return ret;
		return (ret == -ENOENT) ? -EPROBE_DEFER : ret;

	ret = __verify_firmware(&init, fw);
	if (ret)
@@ -862,6 +865,7 @@ static int brcmstb_dpfe_probe(struct platform_device *pdev)

	ret = brcmstb_dpfe_download_firmware(priv);
	if (ret) {
		if (ret != -EPROBE_DEFER)
			dev_err(dev, "Couldn't download firmware -- %d\n", ret);
		return ret;
	}