From: Shawn Lin Date: Tue, 6 Jan 2026 02:17:00 +0000 (+0800) Subject: mmc: dw_mmc: Remove bus_hz from struct dw_mci_board X-Git-Tag: v7.1-rc1~157^2~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec6d8bb39dc8d8ee976d65349290411cab209764;p=thirdparty%2Fkernel%2Fstable.git mmc: dw_mmc: Remove bus_hz from struct dw_mci_board struct dw_mci already keeps one, reuse it. Now, as dw_mmc-pci still provide struct dw_mci_board, so host->bus_hz will not be overwritten. Signed-off-by: Shawn Lin Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/dw_mmc-pci.c b/drivers/mmc/host/dw_mmc-pci.c index 616804a078211..95e91f816ccf0 100644 --- a/drivers/mmc/host/dw_mmc-pci.c +++ b/drivers/mmc/host/dw_mmc-pci.c @@ -26,7 +26,6 @@ static struct dw_mci_board pci_board_data = { .caps = DW_MCI_CAPABILITIES, - .bus_hz = 33 * 1000 * 1000, }; static int dw_mci_pci_probe(struct pci_dev *pdev, @@ -48,6 +47,7 @@ static int dw_mci_pci_probe(struct pci_dev *pdev, host->pdata = &pci_board_data; host->fifo_depth = 32; host->detect_delay_ms = 200; + host->bus_hz = 33 * 1000 * 1000; ret = pcim_iomap_regions(pdev, 1 << PCI_BAR_NO, pci_name(pdev)); if (ret) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index e67d785a2ff6f..a5a7ef696d528 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -3183,7 +3183,7 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host) host->wm_aligned = true; if (!device_property_read_u32(dev, "clock-frequency", &clock_frequency)) - pdata->bus_hz = clock_frequency; + host->bus_hz = clock_frequency; if (drv_data && drv_data->parse_dt) { ret = drv_data->parse_dt(host); @@ -3273,8 +3273,6 @@ int dw_mci_probe(struct dw_mci *host) ret = PTR_ERR(host->ciu_clk); if (ret == -EPROBE_DEFER) goto err_clk_biu; - - host->bus_hz = host->pdata->bus_hz; } else { ret = clk_prepare_enable(host->ciu_clk); if (ret) { @@ -3282,12 +3280,12 @@ int dw_mci_probe(struct dw_mci *host) goto err_clk_biu; } - if (host->pdata->bus_hz) { - ret = clk_set_rate(host->ciu_clk, host->pdata->bus_hz); + if (host->bus_hz) { + ret = clk_set_rate(host->ciu_clk, host->bus_hz); if (ret) dev_warn(host->dev, "Unable to set bus rate to %uHz\n", - host->pdata->bus_hz); + host->bus_hz); } host->bus_hz = clk_get_rate(host->ciu_clk); } diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h index e364b1696c176..cb0e06b01d22e 100644 --- a/drivers/mmc/host/dw_mmc.h +++ b/drivers/mmc/host/dw_mmc.h @@ -270,8 +270,6 @@ struct dw_mci_dma_ops { /* Board platform data */ struct dw_mci_board { - unsigned int bus_hz; /* Clock speed at the cclk_in pad */ - u32 caps; /* Capabilities */ };