diff options
-rw-r--r-- | drivers/ata/sata_dwc_460ex.c | 2 | ||||
-rw-r--r-- | drivers/dma/dw/core.c | 9 | ||||
-rw-r--r-- | drivers/dma/dw/pci.c | 5 | ||||
-rw-r--r-- | drivers/dma/dw/platform.c | 5 | ||||
-rw-r--r-- | include/linux/dma/dw.h | 5 | ||||
-rw-r--r-- | sound/soc/intel/common/sst-firmware.c | 2 |
6 files changed, 17 insertions, 11 deletions
diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c index 80bdcabc293f..2cb6f7e04b5c 100644 --- a/drivers/ata/sata_dwc_460ex.c +++ b/drivers/ata/sata_dwc_460ex.c | |||
@@ -1248,7 +1248,7 @@ static int sata_dwc_probe(struct platform_device *ofdev) | |||
1248 | hsdev->dma->dev = &ofdev->dev; | 1248 | hsdev->dma->dev = &ofdev->dev; |
1249 | 1249 | ||
1250 | /* Initialize AHB DMAC */ | 1250 | /* Initialize AHB DMAC */ |
1251 | err = dw_dma_probe(hsdev->dma, NULL); | 1251 | err = dw_dma_probe(hsdev->dma); |
1252 | if (err) | 1252 | if (err) |
1253 | goto error_dma_iomap; | 1253 | goto error_dma_iomap; |
1254 | 1254 | ||
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c index 30843a17b438..edf053f73a49 100644 --- a/drivers/dma/dw/core.c +++ b/drivers/dma/dw/core.c | |||
@@ -1439,8 +1439,9 @@ EXPORT_SYMBOL(dw_dma_cyclic_free); | |||
1439 | 1439 | ||
1440 | /*----------------------------------------------------------------------*/ | 1440 | /*----------------------------------------------------------------------*/ |
1441 | 1441 | ||
1442 | int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata) | 1442 | int dw_dma_probe(struct dw_dma_chip *chip) |
1443 | { | 1443 | { |
1444 | struct dw_dma_platform_data *pdata; | ||
1444 | struct dw_dma *dw; | 1445 | struct dw_dma *dw; |
1445 | bool autocfg = false; | 1446 | bool autocfg = false; |
1446 | unsigned int dw_params; | 1447 | unsigned int dw_params; |
@@ -1460,7 +1461,7 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata) | |||
1460 | 1461 | ||
1461 | pm_runtime_get_sync(chip->dev); | 1462 | pm_runtime_get_sync(chip->dev); |
1462 | 1463 | ||
1463 | if (!pdata) { | 1464 | if (!chip->pdata) { |
1464 | dw_params = dma_readl(dw, DW_PARAMS); | 1465 | dw_params = dma_readl(dw, DW_PARAMS); |
1465 | dev_dbg(chip->dev, "DW_PARAMS: 0x%08x\n", dw_params); | 1466 | dev_dbg(chip->dev, "DW_PARAMS: 0x%08x\n", dw_params); |
1466 | 1467 | ||
@@ -1487,11 +1488,11 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata) | |||
1487 | pdata->is_memcpy = true; | 1488 | pdata->is_memcpy = true; |
1488 | pdata->chan_allocation_order = CHAN_ALLOCATION_ASCENDING; | 1489 | pdata->chan_allocation_order = CHAN_ALLOCATION_ASCENDING; |
1489 | pdata->chan_priority = CHAN_PRIORITY_ASCENDING; | 1490 | pdata->chan_priority = CHAN_PRIORITY_ASCENDING; |
1490 | } else if (pdata->nr_channels > DW_DMA_MAX_NR_CHANNELS) { | 1491 | } else if (chip->pdata->nr_channels > DW_DMA_MAX_NR_CHANNELS) { |
1491 | err = -EINVAL; | 1492 | err = -EINVAL; |
1492 | goto err_pdata; | 1493 | goto err_pdata; |
1493 | } else { | 1494 | } else { |
1494 | memcpy(dw->pdata, pdata, sizeof(*dw->pdata)); | 1495 | memcpy(dw->pdata, chip->pdata, sizeof(*dw->pdata)); |
1495 | 1496 | ||
1496 | /* Reassign the platform data pointer */ | 1497 | /* Reassign the platform data pointer */ |
1497 | pdata = dw->pdata; | 1498 | pdata = dw->pdata; |
diff --git a/drivers/dma/dw/pci.c b/drivers/dma/dw/pci.c index 358f9689a3f5..0ae6c3b1d34e 100644 --- a/drivers/dma/dw/pci.c +++ b/drivers/dma/dw/pci.c | |||
@@ -17,8 +17,8 @@ | |||
17 | 17 | ||
18 | static int dw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid) | 18 | static int dw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid) |
19 | { | 19 | { |
20 | const struct dw_dma_platform_data *pdata = (void *)pid->driver_data; | ||
20 | struct dw_dma_chip *chip; | 21 | struct dw_dma_chip *chip; |
21 | struct dw_dma_platform_data *pdata = (void *)pid->driver_data; | ||
22 | int ret; | 22 | int ret; |
23 | 23 | ||
24 | ret = pcim_enable_device(pdev); | 24 | ret = pcim_enable_device(pdev); |
@@ -49,8 +49,9 @@ static int dw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
49 | chip->dev = &pdev->dev; | 49 | chip->dev = &pdev->dev; |
50 | chip->regs = pcim_iomap_table(pdev)[0]; | 50 | chip->regs = pcim_iomap_table(pdev)[0]; |
51 | chip->irq = pdev->irq; | 51 | chip->irq = pdev->irq; |
52 | chip->pdata = pdata; | ||
52 | 53 | ||
53 | ret = dw_dma_probe(chip, pdata); | 54 | ret = dw_dma_probe(chip); |
54 | if (ret) | 55 | if (ret) |
55 | return ret; | 56 | return ret; |
56 | 57 | ||
diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c index 0a49011633b9..5bda0eb9f393 100644 --- a/drivers/dma/dw/platform.c +++ b/drivers/dma/dw/platform.c | |||
@@ -161,7 +161,7 @@ static int dw_probe(struct platform_device *pdev) | |||
161 | struct dw_dma_chip *chip; | 161 | struct dw_dma_chip *chip; |
162 | struct device *dev = &pdev->dev; | 162 | struct device *dev = &pdev->dev; |
163 | struct resource *mem; | 163 | struct resource *mem; |
164 | struct dw_dma_platform_data *pdata; | 164 | const struct dw_dma_platform_data *pdata; |
165 | int err; | 165 | int err; |
166 | 166 | ||
167 | chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL); | 167 | chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL); |
@@ -186,6 +186,7 @@ static int dw_probe(struct platform_device *pdev) | |||
186 | pdata = dw_dma_parse_dt(pdev); | 186 | pdata = dw_dma_parse_dt(pdev); |
187 | 187 | ||
188 | chip->dev = dev; | 188 | chip->dev = dev; |
189 | chip->pdata = pdata; | ||
189 | 190 | ||
190 | chip->clk = devm_clk_get(chip->dev, "hclk"); | 191 | chip->clk = devm_clk_get(chip->dev, "hclk"); |
191 | if (IS_ERR(chip->clk)) | 192 | if (IS_ERR(chip->clk)) |
@@ -196,7 +197,7 @@ static int dw_probe(struct platform_device *pdev) | |||
196 | 197 | ||
197 | pm_runtime_enable(&pdev->dev); | 198 | pm_runtime_enable(&pdev->dev); |
198 | 199 | ||
199 | err = dw_dma_probe(chip, pdata); | 200 | err = dw_dma_probe(chip); |
200 | if (err) | 201 | if (err) |
201 | goto err_dw_dma_probe; | 202 | goto err_dw_dma_probe; |
202 | 203 | ||
diff --git a/include/linux/dma/dw.h b/include/linux/dma/dw.h index 71456442ebe3..f2e538aaddad 100644 --- a/include/linux/dma/dw.h +++ b/include/linux/dma/dw.h | |||
@@ -27,6 +27,7 @@ struct dw_dma; | |||
27 | * @regs: memory mapped I/O space | 27 | * @regs: memory mapped I/O space |
28 | * @clk: hclk clock | 28 | * @clk: hclk clock |
29 | * @dw: struct dw_dma that is filed by dw_dma_probe() | 29 | * @dw: struct dw_dma that is filed by dw_dma_probe() |
30 | * @pdata: pointer to platform data | ||
30 | */ | 31 | */ |
31 | struct dw_dma_chip { | 32 | struct dw_dma_chip { |
32 | struct device *dev; | 33 | struct device *dev; |
@@ -34,10 +35,12 @@ struct dw_dma_chip { | |||
34 | void __iomem *regs; | 35 | void __iomem *regs; |
35 | struct clk *clk; | 36 | struct clk *clk; |
36 | struct dw_dma *dw; | 37 | struct dw_dma *dw; |
38 | |||
39 | const struct dw_dma_platform_data *pdata; | ||
37 | }; | 40 | }; |
38 | 41 | ||
39 | /* Export to the platform drivers */ | 42 | /* Export to the platform drivers */ |
40 | int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata); | 43 | int dw_dma_probe(struct dw_dma_chip *chip); |
41 | int dw_dma_remove(struct dw_dma_chip *chip); | 44 | int dw_dma_remove(struct dw_dma_chip *chip); |
42 | 45 | ||
43 | /* DMA API extensions */ | 46 | /* DMA API extensions */ |
diff --git a/sound/soc/intel/common/sst-firmware.c b/sound/soc/intel/common/sst-firmware.c index ef4881e7753a..25993527370b 100644 --- a/sound/soc/intel/common/sst-firmware.c +++ b/sound/soc/intel/common/sst-firmware.c | |||
@@ -203,7 +203,7 @@ static struct dw_dma_chip *dw_probe(struct device *dev, struct resource *mem, | |||
203 | 203 | ||
204 | chip->dev = dev; | 204 | chip->dev = dev; |
205 | 205 | ||
206 | err = dw_dma_probe(chip, NULL); | 206 | err = dw_dma_probe(chip); |
207 | if (err) | 207 | if (err) |
208 | return ERR_PTR(err); | 208 | return ERR_PTR(err); |
209 | 209 | ||