diff mbox series

spi: bcm2835: Remove spi_alloc_master() error printing

Message ID 1557477738-20634-1-git-send-email-na-hoan@jinso.co.jp (mailing list archive)
State Accepted
Commit bfada2080b6439e997bfeae43ed73a3e41c351fd
Headers show
Series spi: bcm2835: Remove spi_alloc_master() error printing | expand

Commit Message

グェン・アン・ホァン May 10, 2019, 8:42 a.m. UTC
From: Hoan Nguyen An <na-hoan@jinso.co.jp>

Printing an error on memory allocation failure is unnecessary,
as the memory allocation core code already takes care of that.

Signed-off-by: Hoan Nguyen An <na-hoan@jinso.co.jp>
---
 drivers/spi/spi-bcm2835.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Geert Uytterhoeven May 10, 2019, 8:58 a.m. UTC | #1
On Fri, May 10, 2019 at 10:44 AM Nguyen An Hoan <na-hoan@jinso.co.jp> wrote:
> From: Hoan Nguyen An <na-hoan@jinso.co.jp>
>
> Printing an error on memory allocation failure is unnecessary,
> as the memory allocation core code already takes care of that.
>
> Signed-off-by: Hoan Nguyen An <na-hoan@jinso.co.jp>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert
Stefan Wahren May 10, 2019, 9:05 a.m. UTC | #2
Hi,

On 10.05.19 10:42, Nguyen An Hoan wrote:
> From: Hoan Nguyen An <na-hoan@jinso.co.jp>
>
> Printing an error on memory allocation failure is unnecessary,
> as the memory allocation core code already takes care of that.
>
> Signed-off-by: Hoan Nguyen An <na-hoan@jinso.co.jp>

looks like more spi drivers are affected.

Could you please take care at least of spi-bcm2835aux ?

Stefan
グェン・アン・ホァン May 10, 2019, 9:23 a.m. UTC | #3
Dear Mr. Stefan!

On 2019/05/10 18:05, Stefan Wahren wrote:
> Hi,
>
> On 10.05.19 10:42, Nguyen An Hoan wrote:
>> From: Hoan Nguyen An <na-hoan@jinso.co.jp>
>>
>> Printing an error on memory allocation failure is unnecessary,
>> as the memory allocation core code already takes care of that.
>>
>> Signed-off-by: Hoan Nguyen An <na-hoan@jinso.co.jp>
> looks like more spi drivers are affected.
>
> Could you please take care at least of spi-bcm2835aux ?
Thanks! I have just updated it!


Thank You!
Martin Sperl May 10, 2019, 10:11 a.m. UTC | #4
> On 10.05.2019, at 10:42, Nguyen An Hoan <na-hoan@jinso.co.jp> wrote:
> 
> From: Hoan Nguyen An <na-hoan@jinso.co.jp>
> 
> Printing an error on memory allocation failure is unnecessary,
> as the memory allocation core code already takes care of that.
> 
> Signed-off-by: Hoan Nguyen An <na-hoan@jinso.co.jp>
Reviewed-by: Martin Sperl <kernel@martin.sperl.org>
diff mbox series

Patch

diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
index 35aebdf..0b779c2 100644
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
@@ -932,10 +932,8 @@  static int bcm2835_spi_probe(struct platform_device *pdev)
 	int err;
 
 	master = spi_alloc_master(&pdev->dev, sizeof(*bs));
-	if (!master) {
-		dev_err(&pdev->dev, "spi_alloc_master() failed\n");
+	if (!master)
 		return -ENOMEM;
-	}
 
 	platform_set_drvdata(pdev, master);