Skip to content

Commit 8880398

Browse files
185264646storulf
authored andcommitted
mmc: core: Use a struct device* as in-param to mmc_of_parse_clk_phase()
Parsing dt usually happens very early, sometimes even before the struct mmc_host has been allocated (e.g. dw_mci_probe() and dw_mci_parse_dt() in dw_mmc.c). Looking at the source of mmc_of_parse_clk_phase(), it's actually not needed to have an initialized mmc_host, let's therefore pass a struct device* to it instead. Also update the only current user, sdhci-of-aspeed. Reviewed-by: Paul Menzel <[email protected]> Acked-by: Andrew Jeffery <[email protected]> Signed-off-by: Yang Xiwen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent ae5004a commit 8880398

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

drivers/mmc/core/host.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,8 @@ static void mmc_of_parse_timing_phase(struct device *dev, const char *prop,
234234
}
235235

236236
void
237-
mmc_of_parse_clk_phase(struct mmc_host *host, struct mmc_clk_phase_map *map)
237+
mmc_of_parse_clk_phase(struct device *dev, struct mmc_clk_phase_map *map)
238238
{
239-
struct device *dev = host->parent;
240-
241239
mmc_of_parse_timing_phase(dev, "clk-phase-legacy",
242240
&map->phase[MMC_TIMING_LEGACY]);
243241
mmc_of_parse_timing_phase(dev, "clk-phase-mmc-hs",

drivers/mmc/host/sdhci-of-aspeed.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ static int aspeed_sdhci_probe(struct platform_device *pdev)
435435
goto err_sdhci_add;
436436

437437
if (dev->phase_desc)
438-
mmc_of_parse_clk_phase(host->mmc, &dev->phase_map);
438+
mmc_of_parse_clk_phase(&pdev->dev, &dev->phase_map);
439439

440440
ret = sdhci_add_host(host);
441441
if (ret)

include/linux/mmc/host.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ struct mmc_host *devm_mmc_alloc_host(struct device *dev, int extra);
539539
int mmc_add_host(struct mmc_host *);
540540
void mmc_remove_host(struct mmc_host *);
541541
void mmc_free_host(struct mmc_host *);
542-
void mmc_of_parse_clk_phase(struct mmc_host *host,
542+
void mmc_of_parse_clk_phase(struct device *dev,
543543
struct mmc_clk_phase_map *map);
544544
int mmc_of_parse(struct mmc_host *host);
545545
int mmc_of_parse_voltage(struct mmc_host *host, u32 *mask);

0 commit comments

Comments
 (0)