Re: [PATCH 2/2] mmc: core: Turn mmc_alloc|free_host() into static functions
From: Johan Hovold
Date: Wed Sep 16 2026 - 03:43:59 EST
On Tue, Sep 15, 2026 at 03:20:46PM +0200, Ulf Hansson wrote:
> From: Ulf Hansson <ulfh@xxxxxxxxxx>
>
> As there are no longer any users of these functions, let's make them
> internal to the mmc core.
Why would you want to do that? The devres helpers should just be simple
wrappers around these and sometimes devres just isn't a good fit.
Especially with the work cancellations present in mmc_free_host() (which
I have pointed out elsewhere should not be there), a driver may need to
free the host before tearing down other non-devres managed resources
during unbind.
This may even be needed for greybus which currently destroys the
connection before freeing the host.
I suggest you just keep the non-devres interface around (after updating
the prototype).
> While at it, let's also flip the order of the
> in-parameters to mmc_alloc_host() to be consistent with devm_alloc_host().
Johan