2024-04-25 17:09:33

by Andy Shevchenko

[permalink] [raw]
Subject: [PATCH v2 0/2] mmc: atmel-mci: Get rid of leftovers and clean up

I used to have some patches against the driver, but it appears that part
of it has been applied (in different form as done by someone else).
However, there is still room to improve, hence this spring cleanup series.

In v2:
- dropped applied patches
- fixed kernel-doc issue (LKP)

Andy Shevchenko (2):
mmc: atmel-mci: Incapsulate used to be a platform data into host
structure
mmc: atmel-mci: Switch to use dev_err_probe()

drivers/mmc/host/atmel-mci.c | 72 ++++++++++++++----------------------
1 file changed, 28 insertions(+), 44 deletions(-)

--
2.43.0.rc1.1336.g36b5255a03ac



2024-04-25 19:11:01

by Andy Shevchenko

[permalink] [raw]
Subject: [PATCH v2 2/2] 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]>
---
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


2024-04-26 04:52:51

by Ulf Hansson

[permalink] [raw]
Subject: Re: [PATCH v2 0/2] mmc: atmel-mci: Get rid of leftovers and clean up

On Thu, 25 Apr 2024 at 19:09, Andy Shevchenko
<[email protected]> wrote:
>
> I used to have some patches against the driver, but it appears that part
> of it has been applied (in different form as done by someone else).
> However, there is still room to improve, hence this spring cleanup series.
>
> In v2:
> - dropped applied patches
> - fixed kernel-doc issue (LKP)
>
> Andy Shevchenko (2):
> mmc: atmel-mci: Incapsulate used to be a platform data into host
> structure
> mmc: atmel-mci: Switch to use dev_err_probe()
>
> drivers/mmc/host/atmel-mci.c | 72 ++++++++++++++----------------------
> 1 file changed, 28 insertions(+), 44 deletions(-)
>

The series applied for next, thanks!

Kind regards
Uffe