summaryrefslogtreecommitdiff
path: root/drivers/mmc/host/atmel-mci.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2024-04-25 20:08:45 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2024-04-26 06:51:09 +0200
commite38063b94324bc1409a29d699c73938c3d008126 (patch)
tree9ffde3e978d2e539c0cb4a1676477a44147b2719 /drivers/mmc/host/atmel-mci.c
parent0a454e952308867ddf0ced08b9745bddb5156998 (diff)
mmc: atmel-mci: Switch to use dev_err_probe()
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> Link: https://lore.kernel.org/r/20240425170900.3767990-3-andriy.shevchenko@linux.intel.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/atmel-mci.c')
-rw-r--r--drivers/mmc/host/atmel-mci.c11
1 files 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;
}
}