* [PATCH] mtd: spi-nor: hisi: do not ignore clk_prepare_enable() failure
@ 2017-02-17 22:08 Alexey Khoroshilov
2017-02-18 15:23 ` Marek Vasut
0 siblings, 1 reply; 3+ messages in thread
From: Alexey Khoroshilov @ 2017-02-17 22:08 UTC (permalink / raw)
To: Cyrille Pitchen, Marek Vasut
Cc: Alexey Khoroshilov, David Woodhouse, Brian Norris,
Boris Brezillon, Richard Weinberger, linux-mtd, linux-kernel,
ldv-project
hisi_spi_nor_probe() ignores clk_prepare_enable() error code.
The patch fixes that.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
drivers/mtd/spi-nor/hisi-sfc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/spi-nor/hisi-sfc.c b/drivers/mtd/spi-nor/hisi-sfc.c
index 20378b0d55e9..a286350627a6 100644
--- a/drivers/mtd/spi-nor/hisi-sfc.c
+++ b/drivers/mtd/spi-nor/hisi-sfc.c
@@ -448,8 +448,11 @@ static int hisi_spi_nor_probe(struct platform_device *pdev)
if (!host->buffer)
return -ENOMEM;
+ ret = clk_prepare_enable(host->clk);
+ if (ret)
+ return ret;
+
mutex_init(&host->lock);
- clk_prepare_enable(host->clk);
hisi_spi_nor_init(host);
ret = hisi_spi_nor_register_all(host);
if (ret)
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: spi-nor: hisi: do not ignore clk_prepare_enable() failure
2017-02-17 22:08 [PATCH] mtd: spi-nor: hisi: do not ignore clk_prepare_enable() failure Alexey Khoroshilov
@ 2017-02-18 15:23 ` Marek Vasut
2017-03-07 20:57 ` Cyrille Pitchen
0 siblings, 1 reply; 3+ messages in thread
From: Marek Vasut @ 2017-02-18 15:23 UTC (permalink / raw)
To: Alexey Khoroshilov, Cyrille Pitchen
Cc: David Woodhouse, Brian Norris, Boris Brezillon,
Richard Weinberger, linux-mtd, linux-kernel, ldv-project
On 02/17/2017 11:08 PM, Alexey Khoroshilov wrote:
> hisi_spi_nor_probe() ignores clk_prepare_enable() error code.
> The patch fixes that.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
> ---
> drivers/mtd/spi-nor/hisi-sfc.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/spi-nor/hisi-sfc.c b/drivers/mtd/spi-nor/hisi-sfc.c
> index 20378b0d55e9..a286350627a6 100644
> --- a/drivers/mtd/spi-nor/hisi-sfc.c
> +++ b/drivers/mtd/spi-nor/hisi-sfc.c
> @@ -448,8 +448,11 @@ static int hisi_spi_nor_probe(struct platform_device *pdev)
> if (!host->buffer)
> return -ENOMEM;
>
> + ret = clk_prepare_enable(host->clk);
> + if (ret)
> + return ret;
> +
> mutex_init(&host->lock);
> - clk_prepare_enable(host->clk);
> hisi_spi_nor_init(host);
> ret = hisi_spi_nor_register_all(host);
> if (ret)
>
--
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: spi-nor: hisi: do not ignore clk_prepare_enable() failure
2017-02-18 15:23 ` Marek Vasut
@ 2017-03-07 20:57 ` Cyrille Pitchen
0 siblings, 0 replies; 3+ messages in thread
From: Cyrille Pitchen @ 2017-03-07 20:57 UTC (permalink / raw)
To: Marek Vasut, Alexey Khoroshilov, Cyrille Pitchen
Cc: ldv-project, Boris Brezillon, Richard Weinberger, linux-kernel,
linux-mtd, Brian Norris, David Woodhouse
Le 18/02/2017 à 16:23, Marek Vasut a écrit :
> On 02/17/2017 11:08 PM, Alexey Khoroshilov wrote:
>> hisi_spi_nor_probe() ignores clk_prepare_enable() error code.
>> The patch fixes that.
>>
>> Found by Linux Driver Verification project (linuxtesting.org).
>>
>> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
>
> Acked-by: Marek Vasut <marek.vasut@gmail.com>
>
Applied to spi-nor/next
Thanks!
>> ---
>> drivers/mtd/spi-nor/hisi-sfc.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mtd/spi-nor/hisi-sfc.c b/drivers/mtd/spi-nor/hisi-sfc.c
>> index 20378b0d55e9..a286350627a6 100644
>> --- a/drivers/mtd/spi-nor/hisi-sfc.c
>> +++ b/drivers/mtd/spi-nor/hisi-sfc.c
>> @@ -448,8 +448,11 @@ static int hisi_spi_nor_probe(struct platform_device *pdev)
>> if (!host->buffer)
>> return -ENOMEM;
>>
>> + ret = clk_prepare_enable(host->clk);
>> + if (ret)
>> + return ret;
>> +
>> mutex_init(&host->lock);
>> - clk_prepare_enable(host->clk);
>> hisi_spi_nor_init(host);
>> ret = hisi_spi_nor_register_all(host);
>> if (ret)
>>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-03-08 3:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-17 22:08 [PATCH] mtd: spi-nor: hisi: do not ignore clk_prepare_enable() failure Alexey Khoroshilov
2017-02-18 15:23 ` Marek Vasut
2017-03-07 20:57 ` Cyrille Pitchen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®