Commit e38063b9 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Ulf Hansson

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240425170900.3767990-3-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 0a454e95
...@@ -632,10 +632,8 @@ static int atmci_of_init(struct atmel_mci *host) ...@@ -632,10 +632,8 @@ static int atmci_of_init(struct atmel_mci *host)
u32 slot_id; u32 slot_id;
int err; int err;
if (!np) { if (!np)
dev_err(dev, "device node not found\n"); return dev_err_probe(dev, -EINVAL, "device node not found\n");
return ERR_PTR(-EINVAL);
}
for_each_child_of_node(np, cnp) { for_each_child_of_node(np, cnp) {
if (of_property_read_u32(cnp, "reg", &slot_id)) { if (of_property_read_u32(cnp, "reg", &slot_id)) {
...@@ -2551,7 +2549,7 @@ static int atmci_probe(struct platform_device *pdev) ...@@ -2551,7 +2549,7 @@ static int atmci_probe(struct platform_device *pdev)
} }
if (!nr_slots) { 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; goto err_init_slot;
} }
...@@ -2560,8 +2558,7 @@ static int atmci_probe(struct platform_device *pdev) ...@@ -2560,8 +2558,7 @@ static int atmci_probe(struct platform_device *pdev)
&host->buf_phys_addr, &host->buf_phys_addr,
GFP_KERNEL); GFP_KERNEL);
if (!host->buffer) { if (!host->buffer) {
ret = -ENOMEM; ret = dev_err_probe(dev, -ENOMEM, "buffer allocation failed\n");
dev_err(dev, "buffer allocation failed\n");
goto err_dma_alloc; goto err_dma_alloc;
} }
} }
......
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