diff mbox

[-next] spi: imx: fix error return code in spi_imx_probe()

Message ID 1475074218-13164-1-git-send-email-weiyj.lk@gmail.com (mailing list archive)
State Accepted
Commit 446576f9ea5308c671eafb1cdc2a977b406c1dc5
Headers show

Commit Message

Wei Yongjun Sept. 28, 2016, 2:50 p.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

Fix to return error code -EINVAL if no CS GPIOs available
instead of 0, as done elsewhere in this function.

Fixes: f13d4e189d20 ("spi: imx: Gracefully handle NULL master->cs_gpios")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/spi/spi-imx.c | 1 +
 1 file changed, 1 insertion(+)

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Marek Vasut Sept. 28, 2016, 3:29 p.m. UTC | #1
On 09/28/2016 04:50 PM, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Fix to return error code -EINVAL if no CS GPIOs available
> instead of 0, as done elsewhere in this function.
> 
> Fixes: f13d4e189d20 ("spi: imx: Gracefully handle NULL master->cs_gpios")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Oops, good catch, thanks.

Acked-by: Marek Vasut <marex@denx.de>

> ---
>  drivers/spi/spi-imx.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
> index 1ef5429..deb782f 100644
> --- a/drivers/spi/spi-imx.c
> +++ b/drivers/spi/spi-imx.c
> @@ -1270,6 +1270,7 @@ static int spi_imx_probe(struct platform_device *pdev)
>  
>  	if (!master->cs_gpios) {
>  		dev_err(&pdev->dev, "No CS GPIOs available\n");
> +		ret = -EINVAL;
>  		goto out_clk_put;
>  	}
>
diff mbox

Patch

diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 1ef5429..deb782f 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -1270,6 +1270,7 @@  static int spi_imx_probe(struct platform_device *pdev)
 
 	if (!master->cs_gpios) {
 		dev_err(&pdev->dev, "No CS GPIOs available\n");
+		ret = -EINVAL;
 		goto out_clk_put;
 	}