Commit e1df7ae3 authored by Markus Elfring's avatar Markus Elfring Committed by Ulf Hansson

mmc: core: Delete error messages for failed memory allocations

Omit an extra message for memory allocation failures.

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdfSigned-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 9b344ba4
...@@ -3220,8 +3220,6 @@ static int __mmc_test_register_dbgfs_file(struct mmc_card *card, ...@@ -3220,8 +3220,6 @@ static int __mmc_test_register_dbgfs_file(struct mmc_card *card,
df = kmalloc(sizeof(*df), GFP_KERNEL); df = kmalloc(sizeof(*df), GFP_KERNEL);
if (!df) { if (!df) {
debugfs_remove(file); debugfs_remove(file);
dev_err(&card->dev,
"Can't allocate memory for internal usage.\n");
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -294,12 +294,8 @@ static int mmc_read_switch(struct mmc_card *card) ...@@ -294,12 +294,8 @@ static int mmc_read_switch(struct mmc_card *card)
err = -EIO; err = -EIO;
status = kmalloc(64, GFP_KERNEL); status = kmalloc(64, GFP_KERNEL);
if (!status) { if (!status)
pr_err("%s: could not allocate a buffer for "
"switch capabilities.\n",
mmc_hostname(card->host));
return -ENOMEM; return -ENOMEM;
}
/* /*
* Find out the card's support bits with a mode 0 operation. * Find out the card's support bits with a mode 0 operation.
...@@ -359,11 +355,8 @@ int mmc_sd_switch_hs(struct mmc_card *card) ...@@ -359,11 +355,8 @@ int mmc_sd_switch_hs(struct mmc_card *card)
return 0; return 0;
status = kmalloc(64, GFP_KERNEL); status = kmalloc(64, GFP_KERNEL);
if (!status) { if (!status)
pr_err("%s: could not allocate a buffer for "
"switch capabilities.\n", mmc_hostname(card->host));
return -ENOMEM; return -ENOMEM;
}
err = mmc_sd_switch(card, 1, 0, 1, status); err = mmc_sd_switch(card, 1, 0, 1, status);
if (err) if (err)
...@@ -596,11 +589,8 @@ static int mmc_sd_init_uhs_card(struct mmc_card *card) ...@@ -596,11 +589,8 @@ static int mmc_sd_init_uhs_card(struct mmc_card *card)
return 0; return 0;
status = kmalloc(64, GFP_KERNEL); status = kmalloc(64, GFP_KERNEL);
if (!status) { if (!status)
pr_err("%s: could not allocate a buffer for "
"switch capabilities.\n", mmc_hostname(card->host));
return -ENOMEM; return -ENOMEM;
}
/* Set 4-bit bus width */ /* Set 4-bit bus width */
if ((card->host->caps & MMC_CAP_4_BIT_DATA) && if ((card->host->caps & MMC_CAP_4_BIT_DATA) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment