[PATCH 1/2] staging: greybus: sdio: Convert to devm_mmc_alloc_host()

From: Ulf Hansson

Date: Tue Sep 15 2026 - 09:46:32 EST


From: Ulf Hansson <ulfh@xxxxxxxxxx>

Simplify the code by converting from mmc_alloc_host() to the resource
managed devm_mmc_alloc_host().

Signed-off-by: Ulf Hansson <ulfh@xxxxxxxxxx>
---
drivers/staging/greybus/sdio.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/greybus/sdio.c b/drivers/staging/greybus/sdio.c
index 3952f3d225db..642d785fe918 100644
--- a/drivers/staging/greybus/sdio.c
+++ b/drivers/staging/greybus/sdio.c
@@ -767,17 +767,15 @@ static int gb_sdio_probe(struct gbphy_device *gbphy_dev,
struct gb_sdio_host *host;
int ret = 0;

- mmc = mmc_alloc_host(sizeof(*host), &gbphy_dev->dev);
+ mmc = devm_mmc_alloc_host(&gbphy_dev->dev, sizeof(*host));
if (!mmc)
return -ENOMEM;

connection = gb_connection_create(gbphy_dev->bundle,
le16_to_cpu(gbphy_dev->cport_desc->id),
gb_sdio_request_handler);
- if (IS_ERR(connection)) {
- ret = PTR_ERR(connection);
- goto exit_mmc_free;
- }
+ if (IS_ERR(connection))
+ return PTR_ERR(connection);

host = mmc_priv(mmc);
host->mmc = mmc;
@@ -835,8 +833,6 @@ static int gb_sdio_probe(struct gbphy_device *gbphy_dev,
gb_connection_disable(connection);
exit_connection_destroy:
gb_connection_destroy(connection);
-exit_mmc_free:
- mmc_free_host(mmc);

return ret;
}
@@ -863,7 +859,6 @@ static void gb_sdio_remove(struct gbphy_device *gbphy_dev)
mmc_remove_host(mmc);
gb_connection_disable(connection);
gb_connection_destroy(connection);
- mmc_free_host(mmc);
}

static const struct gbphy_device_id gb_sdio_id_table[] = {
--
2.43.0