mmc: atmel-mci: Delete an error message for a failed memory allocation in atmci_of_init()
Subsystems (4)
PATCH 1/1 mmc: atmel-mci: Delete an error message for a failed memory allocation in atmci_of_init()
From: Markus Elfring <[email protected]>
Date: Sat, 13 May 2017 15:05:28 +0200
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>
--- drivers/mmc/host/atmel-mci.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mmc/host/atmel-mci.c +1 -3
@@ -667,10 +667,8 @@ atmci_of_init(struct platform_device *pdev) } pdata =devm_kzalloc (&pdev->dev,sizeof (*pdata),GFP_KERNEL ); -if (!pdata) { -dev_err (&pdev->dev,"could not allocate memory for pdata\n" ); +if (!pdata)return ERR_PTR (-ENOMEM ); - }for_each_child_of_node (np, cnp) {if (of_property_read_u32 (cnp,"reg" , &slot_id)) {
Signature · 1 line
2.12.3
Ulf Hansson
AppliedQuoted 9 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Sat, 13 May 2017 15:05:28 +0200Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Thanks applied for next!
Kind regards
Uffe
Quoted 23 lines
--- drivers/mmc/host/atmel-mci.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/mmc/host/atmel-mci.c +1
-4@@ -667,10 +667,8 @@ atmci_of_init(struct platform_device *pdev) } pdata =devm_kzalloc (&pdev->dev,sizeof (*pdata),GFP_KERNEL ); -if (!pdata) { -dev_err (&pdev->dev,"could not allocate memory for pdata\n" ); +if (!pdata)return ERR_PTR (-ENOMEM ); - }for_each_child_of_node (np, cnp) {if (of_property_read_u32 (cnp,"reg" , &slot_id)) { --2.12.3