* [PATCH] spi/sirf: fix error propagation in spi_sirfsoc_probe()
@ 2013-06-05 21:29 Alexey Khoroshilov
2013-06-06 1:36 ` Barry Song
0 siblings, 1 reply; 3+ messages in thread
From: Alexey Khoroshilov @ 2013-06-05 21:29 UTC (permalink / raw)
To: Barry Song
Cc: Alexey Khoroshilov, Mark Brown, Grant Likely, linux-arm-kernel,
spi-devel-general, linux-kernel, ldv-project
If pinctrl_get_select_default() fails, spi_sirfsoc_probe()
returns IS_ERR(sspi->p) instead of PTR_ERR(sspi->p).
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
drivers/spi/spi-sirf.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
index 0808cd5..94c3920 100644
--- a/drivers/spi/spi-sirf.c
+++ b/drivers/spi/spi-sirf.c
@@ -559,9 +559,10 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
sspi->bitbang.master->dev.of_node = pdev->dev.of_node;
sspi->p = pinctrl_get_select_default(&pdev->dev);
- ret = IS_ERR(sspi->p);
- if (ret)
+ if (IS_ERR(sspi->p)) {
+ ret = PTR_ERR(sspi->p);
goto free_master;
+ }
sspi->clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(sspi->clk)) {
--
1.8.1.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] spi/sirf: fix error propagation in spi_sirfsoc_probe()
2013-06-05 21:29 [PATCH] spi/sirf: fix error propagation in spi_sirfsoc_probe() Alexey Khoroshilov
@ 2013-06-06 1:36 ` Barry Song
2013-06-06 1:40 ` Barry Song
0 siblings, 1 reply; 3+ messages in thread
From: Barry Song @ 2013-06-06 1:36 UTC (permalink / raw)
To: Alexey Khoroshilov
Cc: Barry Song, ldv-project, linux-kernel, Mark Brown, Grant Likely,
spi-devel-general, linux-arm-kernel, DL-SHA-WorkGroupLinux
2013/6/6 Alexey Khoroshilov <khoroshilov@ispras.ru>:
> If pinctrl_get_select_default() fails, spi_sirfsoc_probe()
> returns IS_ERR(sspi->p) instead of PTR_ERR(sspi->p).
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: Barry Song <Baohua.Song@csr.com>
> ---
> drivers/spi/spi-sirf.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
> index 0808cd5..94c3920 100644
> --- a/drivers/spi/spi-sirf.c
> +++ b/drivers/spi/spi-sirf.c
> @@ -559,9 +559,10 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
> sspi->bitbang.master->dev.of_node = pdev->dev.of_node;
>
> sspi->p = pinctrl_get_select_default(&pdev->dev);
> - ret = IS_ERR(sspi->p);
> - if (ret)
> + if (IS_ERR(sspi->p)) {
> + ret = PTR_ERR(sspi->p);
> goto free_master;
> + }
>
> sspi->clk = clk_get(&pdev->dev, NULL);
> if (IS_ERR(sspi->clk)) {
> --
> 1.8.1.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] spi/sirf: fix error propagation in spi_sirfsoc_probe()
2013-06-06 1:36 ` Barry Song
@ 2013-06-06 1:40 ` Barry Song
0 siblings, 0 replies; 3+ messages in thread
From: Barry Song @ 2013-06-06 1:40 UTC (permalink / raw)
To: Alexey Khoroshilov
Cc: Barry Song, ldv-project, linux-kernel, Mark Brown, Grant Likely,
spi-devel-general, linux-arm-kernel, DL-SHA-WorkGroupLinux
2013/6/6 Barry Song <21cnbao@gmail.com>:
> 2013/6/6 Alexey Khoroshilov <khoroshilov@ispras.ru>:
>> If pinctrl_get_select_default() fails, spi_sirfsoc_probe()
>> returns IS_ERR(sspi->p) instead of PTR_ERR(sspi->p).
>>
>> Found by Linux Driver Verification project (linuxtesting.org).
>>
>> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
>
> Acked-by: Barry Song <Baohua.Song@csr.com>
sorry. nack, i think pinctrl_get_select_default(&pdev->dev) should
have been dropped in another patch.
>
>> ---
>> drivers/spi/spi-sirf.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
>> index 0808cd5..94c3920 100644
>> --- a/drivers/spi/spi-sirf.c
>> +++ b/drivers/spi/spi-sirf.c
>> @@ -559,9 +559,10 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
>> sspi->bitbang.master->dev.of_node = pdev->dev.of_node;
>>
>> sspi->p = pinctrl_get_select_default(&pdev->dev);
>> - ret = IS_ERR(sspi->p);
>> - if (ret)
>> + if (IS_ERR(sspi->p)) {
>> + ret = PTR_ERR(sspi->p);
>> goto free_master;
>> + }
>>
>> sspi->clk = clk_get(&pdev->dev, NULL);
>> if (IS_ERR(sspi->clk)) {
>> --
>> 1.8.1.2
-barry
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-06-06 1:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-05 21:29 [PATCH] spi/sirf: fix error propagation in spi_sirfsoc_probe() Alexey Khoroshilov
2013-06-06 1:36 ` Barry Song
2013-06-06 1:40 ` Barry Song
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).