From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: Aubin Constans <aubin.constans@microchip.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Claudiu Beznea <claudiu.beznea@tuxon.dev>
Subject: [PATCH v2 2/2] mmc: atmel-mci: Switch to use dev_err_probe()
Date: Thu, 25 Apr 2024 20:08:45 +0300 [thread overview]
Message-ID: <20240425170900.3767990-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20240425170900.3767990-1-andriy.shevchenko@linux.intel.com>
Switch to use dev_err_probe() to simplify the error path and
unify a message template.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/mmc/host/atmel-mci.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 9ae3ce14db50..8199d9620075 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -632,10 +632,8 @@ static int atmci_of_init(struct atmel_mci *host)
u32 slot_id;
int err;
- if (!np) {
- dev_err(dev, "device node not found\n");
- return ERR_PTR(-EINVAL);
- }
+ if (!np)
+ return dev_err_probe(dev, -EINVAL, "device node not found\n");
for_each_child_of_node(np, cnp) {
if (of_property_read_u32(cnp, "reg", &slot_id)) {
@@ -2551,7 +2549,7 @@ static int atmci_probe(struct platform_device *pdev)
}
if (!nr_slots) {
- dev_err(dev, "init failed: no slot defined\n");
+ dev_err_probe(dev, ret, "init failed: no slot defined\n");
goto err_init_slot;
}
@@ -2560,8 +2558,7 @@ static int atmci_probe(struct platform_device *pdev)
&host->buf_phys_addr,
GFP_KERNEL);
if (!host->buffer) {
- ret = -ENOMEM;
- dev_err(dev, "buffer allocation failed\n");
+ ret = dev_err_probe(dev, -ENOMEM, "buffer allocation failed\n");
goto err_dma_alloc;
}
}
--
2.43.0.rc1.1336.g36b5255a03ac
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-04-25 17:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-25 17:08 [PATCH v2 0/2] mmc: atmel-mci: Get rid of leftovers and clean up Andy Shevchenko
2024-04-25 17:08 ` [PATCH v2 1/2] mmc: atmel-mci: Incapsulate used to be a platform data into host structure Andy Shevchenko
2024-04-25 17:08 ` Andy Shevchenko [this message]
2024-04-26 4:52 ` [PATCH v2 0/2] mmc: atmel-mci: Get rid of leftovers and clean up Ulf Hansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240425170900.3767990-3-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=alexandre.belloni@bootlin.com \
--cc=aubin.constans@microchip.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).