Skip to content

Commit e38063b

Browse files
andy-shevstorulf
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 0a454e9 commit e38063b

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

drivers/mmc/host/atmel-mci.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -632,10 +632,8 @@ static int atmci_of_init(struct atmel_mci *host)
632632
u32 slot_id;
633633
int err;
634634

635-
if (!np) {
636-
dev_err(dev, "device node not found\n");
637-
return ERR_PTR(-EINVAL);
638-
}
635+
if (!np)
636+
return dev_err_probe(dev, -EINVAL, "device node not found\n");
639637

640638
for_each_child_of_node(np, cnp) {
641639
if (of_property_read_u32(cnp, "reg", &slot_id)) {
@@ -2551,7 +2549,7 @@ static int atmci_probe(struct platform_device *pdev)
25512549
}
25522550

25532551
if (!nr_slots) {
2554-
dev_err(dev, "init failed: no slot defined\n");
2552+
dev_err_probe(dev, ret, "init failed: no slot defined\n");
25552553
goto err_init_slot;
25562554
}
25572555

@@ -2560,8 +2558,7 @@ static int atmci_probe(struct platform_device *pdev)
25602558
&host->buf_phys_addr,
25612559
GFP_KERNEL);
25622560
if (!host->buffer) {
2563-
ret = -ENOMEM;
2564-
dev_err(dev, "buffer allocation failed\n");
2561+
ret = dev_err_probe(dev, -ENOMEM, "buffer allocation failed\n");
25652562
goto err_dma_alloc;
25662563
}
25672564
}

0 commit comments

Comments
 (0)