lkml.org 
[lkml]   [2012]   [Feb]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] dma: imx-sdma: Add error check on sdma_get_firmware
On Mon, Feb 20, 2012 at 02:49:50PM -0200, Fabio Estevam wrote:
> Add error check on sdma_get_firmware for the pdata case.
>
> While at it, distinguish the error message between the pdata and dt cases.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> drivers/dma/imx-sdma.c | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index bf736ad..52a4e6a 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -1388,7 +1388,11 @@ static int __init sdma_probe(struct platform_device *pdev)
> sdma_add_scripts(sdma, pdata->script_addrs);
>
> if (pdata) {
> - sdma_get_firmware(sdma, pdata->fw_name);
> + ret = sdma_get_firmware(sdma, pdata->fw_name);
> + if (ret) {
> + dev_err(&pdev->dev, "failed to get firmware from pdata\n");
> + goto err_init;
> + }

No, you shouldn't bail out here. A failure in sdma_get_firmware only
means that we don't have the RAM scripts, but we can continue with the
ROM scripts and still do useful things in the driver.

Sascha


--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |


\
 
 \ /
  Last update: 2012-02-29 09:41    [W:0.033 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site