]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: dw_mmc: Remove fifo_depth from struct dw_mci_board
authorShawn Lin <shawn.lin@rock-chips.com>
Tue, 6 Jan 2026 02:16:58 +0000 (10:16 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 23 Feb 2026 11:06:54 +0000 (12:06 +0100)
struct dw_mci already keeps one, so remove it from struct dw_mci_board.
Now, as dw_mmc-pci still provide struct dw_mci_board, so host->fifo_depth
will not be overwritten.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/dw_mmc-pci.c
drivers/mmc/host/dw_mmc.c
drivers/mmc/host/dw_mmc.h

index 24f40369371154f89a78b7778769becc455c1cd3..89ad4993e4e19fb7d0c3b219a2a9424f89724bdf 100644 (file)
@@ -28,7 +28,6 @@ static struct dw_mci_board pci_board_data = {
        .caps                           = DW_MCI_CAPABILITIES,
        .bus_hz                         = 33 * 1000 * 1000,
        .detect_delay_ms                = 200,
-       .fifo_depth                     = 32,
 };
 
 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->irq = pdev->irq;
        host->irq_flags = IRQF_SHARED;
        host->pdata = &pci_board_data;
+       host->fifo_depth = 32;
 
        ret = pcim_iomap_regions(pdev, 1 << PCI_BAR_NO, pci_name(pdev));
        if (ret)
index 4a0b9a6b45f1da291c22efdeb18b4a3a9e79c542..98549a260e377f963863c2e1bbc7d52d2e91f8e6 100644 (file)
@@ -3170,7 +3170,7 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
        if (IS_ERR(host->rstc))
                return ERR_CAST(host->rstc);
 
-       if (device_property_read_u32(dev, "fifo-depth", &pdata->fifo_depth))
+       if (device_property_read_u32(dev, "fifo-depth", &host->fifo_depth))
                dev_info(dev,
                         "fifo-depth property not found, using value of FIFOTH register as default\n");
 
@@ -3373,7 +3373,7 @@ int dw_mci_probe(struct dw_mci *host)
         * FIFO threshold settings  RxMark  = fifo_size / 2 - 1,
         *                          Tx Mark = fifo_size / 2 DMA Size = 8
         */
-       if (!host->pdata->fifo_depth) {
+       if (!host->fifo_depth) {
                /*
                 * Power-on value of RX_WMark is FIFO_DEPTH-1, but this may
                 * have been overwritten by the bootloader, just like we're
@@ -3383,7 +3383,7 @@ int dw_mci_probe(struct dw_mci *host)
                fifo_size = mci_readl(host, FIFOTH);
                fifo_size = 1 + ((fifo_size >> 16) & 0xfff);
        } else {
-               fifo_size = host->pdata->fifo_depth;
+               fifo_size = host->fifo_depth;
        }
        host->fifo_depth = fifo_size;
        host->fifoth_val =
index 3cac7ce7c0706e4bbef181849234c84bab6a16bf..bc82d1df75f0d370e83d8102f63b84a6f81b3088 100644 (file)
@@ -271,12 +271,6 @@ struct dw_mci_board {
        unsigned int bus_hz; /* Clock speed at the cclk_in pad */
 
        u32 caps;       /* Capabilities */
-       /*
-        * Override fifo depth. If 0, autodetect it from the FIFOTH register,
-        * but note that this may not be reliable after a bootloader has used
-        * it.
-        */
-       unsigned int fifo_depth;
 
        /* delay in mS before detecting cards after interrupt */
        u32 detect_delay_ms;