Skip to content

Commit 1c1114d

Browse files
ambarusvinodkoul
authored andcommitted
dmaengine: at_hdmac: Rename "dma_common" to "dma_device"
"dma_common" name was misleading and did not suggest that's actually a struct dma_device underneath. Rename it so that readers can follow the code easier. One may see some checks and a warning when running checkpatch. Those have nothing to do with the rename and will be addressed in a further patch. Signed-off-by: Tudor Ambarus <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent d8840a7 commit 1c1114d

File tree

1 file changed

+46
-46
lines changed

1 file changed

+46
-46
lines changed

drivers/dma/at_hdmac.c

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ static inline u8 convert_buswidth(enum dma_slave_buswidth addr_width)
338338

339339
/**
340340
* struct at_dma - internal representation of an Atmel HDMA Controller
341-
* @chan_common: common dmaengine dma_device object members
341+
* @dma_device: dmaengine dma_device object members
342342
* @atdma_devtype: identifier of DMA controller compatibility
343343
* @ch_regs: memory mapped register base
344344
* @clk: dma controller clock
@@ -348,7 +348,7 @@ static inline u8 convert_buswidth(enum dma_slave_buswidth addr_width)
348348
* @chan: channels table to store at_dma_chan structures
349349
*/
350350
struct at_dma {
351-
struct dma_device dma_common;
351+
struct dma_device dma_device;
352352
void __iomem *regs;
353353
struct clk *clk;
354354
u32 save_imr;
@@ -368,7 +368,7 @@ struct at_dma {
368368

369369
static inline struct at_dma *to_at_dma(struct dma_device *ddev)
370370
{
371-
return container_of(ddev, struct at_dma, dma_common);
371+
return container_of(ddev, struct at_dma, dma_device);
372372
}
373373

374374

@@ -1069,11 +1069,11 @@ static irqreturn_t at_dma_interrupt(int irq, void *dev_id)
10691069
if (!pending)
10701070
break;
10711071

1072-
dev_vdbg(atdma->dma_common.dev,
1072+
dev_vdbg(atdma->dma_device.dev,
10731073
"interrupt: status = 0x%08x, 0x%08x, 0x%08x\n",
10741074
status, imr, pending);
10751075

1076-
for (i = 0; i < atdma->dma_common.chancnt; i++) {
1076+
for (i = 0; i < atdma->dma_device.chancnt; i++) {
10771077
atchan = &atdma->chan[i];
10781078
if (pending & (AT_DMA_BTC(i) | AT_DMA_ERR(i))) {
10791079
if (pending & AT_DMA_ERR(i)) {
@@ -2000,7 +2000,7 @@ static int atc_alloc_chan_resources(struct dma_chan *chan)
20002000
* We need controller-specific data to set up slave
20012001
* transfers.
20022002
*/
2003-
BUG_ON(!atslave->dma_dev || atslave->dma_dev != atdma->dma_common.dev);
2003+
BUG_ON(!atslave->dma_dev || atslave->dma_dev != atdma->dma_device.dev);
20042004

20052005
/* if cfg configuration specified take it instead of default */
20062006
if (atslave->cfg)
@@ -2011,7 +2011,7 @@ static int atc_alloc_chan_resources(struct dma_chan *chan)
20112011
for (i = 0; i < init_nr_desc_per_channel; i++) {
20122012
desc = atc_alloc_descriptor(chan, GFP_KERNEL);
20132013
if (!desc) {
2014-
dev_err(atdma->dma_common.dev,
2014+
dev_err(atdma->dma_device.dev,
20152015
"Only %d initial descriptors\n", i);
20162016
break;
20172017
}
@@ -2255,7 +2255,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
22552255
return irq;
22562256

22572257
/* discover transaction capabilities */
2258-
atdma->dma_common.cap_mask = plat_dat->cap_mask;
2258+
atdma->dma_device.cap_mask = plat_dat->cap_mask;
22592259
atdma->all_chan_mask = (1 << plat_dat->nr_channels) - 1;
22602260

22612261
atdma->clk = devm_clk_get(&pdev->dev, "dma_clk");
@@ -2299,16 +2299,16 @@ static int __init at_dma_probe(struct platform_device *pdev)
22992299
cpu_relax();
23002300

23012301
/* initialize channels related values */
2302-
INIT_LIST_HEAD(&atdma->dma_common.channels);
2302+
INIT_LIST_HEAD(&atdma->dma_device.channels);
23032303
for (i = 0; i < plat_dat->nr_channels; i++) {
23042304
struct at_dma_chan *atchan = &atdma->chan[i];
23052305

23062306
atchan->mem_if = AT_DMA_MEM_IF;
23072307
atchan->per_if = AT_DMA_PER_IF;
2308-
atchan->chan_common.device = &atdma->dma_common;
2308+
atchan->chan_common.device = &atdma->dma_device;
23092309
dma_cookie_init(&atchan->chan_common);
23102310
list_add_tail(&atchan->chan_common.device_node,
2311-
&atdma->dma_common.channels);
2311+
&atdma->dma_device.channels);
23122312

23132313
atchan->ch_regs = atdma->regs + ch_regs(i);
23142314
spin_lock_init(&atchan->lock);
@@ -2323,49 +2323,49 @@ static int __init at_dma_probe(struct platform_device *pdev)
23232323
}
23242324

23252325
/* set base routines */
2326-
atdma->dma_common.device_alloc_chan_resources = atc_alloc_chan_resources;
2327-
atdma->dma_common.device_free_chan_resources = atc_free_chan_resources;
2328-
atdma->dma_common.device_tx_status = atc_tx_status;
2329-
atdma->dma_common.device_issue_pending = atc_issue_pending;
2330-
atdma->dma_common.dev = &pdev->dev;
2326+
atdma->dma_device.device_alloc_chan_resources = atc_alloc_chan_resources;
2327+
atdma->dma_device.device_free_chan_resources = atc_free_chan_resources;
2328+
atdma->dma_device.device_tx_status = atc_tx_status;
2329+
atdma->dma_device.device_issue_pending = atc_issue_pending;
2330+
atdma->dma_device.dev = &pdev->dev;
23312331

23322332
/* set prep routines based on capability */
2333-
if (dma_has_cap(DMA_INTERLEAVE, atdma->dma_common.cap_mask))
2334-
atdma->dma_common.device_prep_interleaved_dma = atc_prep_dma_interleaved;
2333+
if (dma_has_cap(DMA_INTERLEAVE, atdma->dma_device.cap_mask))
2334+
atdma->dma_device.device_prep_interleaved_dma = atc_prep_dma_interleaved;
23352335

2336-
if (dma_has_cap(DMA_MEMCPY, atdma->dma_common.cap_mask))
2337-
atdma->dma_common.device_prep_dma_memcpy = atc_prep_dma_memcpy;
2336+
if (dma_has_cap(DMA_MEMCPY, atdma->dma_device.cap_mask))
2337+
atdma->dma_device.device_prep_dma_memcpy = atc_prep_dma_memcpy;
23382338

2339-
if (dma_has_cap(DMA_MEMSET, atdma->dma_common.cap_mask)) {
2340-
atdma->dma_common.device_prep_dma_memset = atc_prep_dma_memset;
2341-
atdma->dma_common.device_prep_dma_memset_sg = atc_prep_dma_memset_sg;
2342-
atdma->dma_common.fill_align = DMAENGINE_ALIGN_4_BYTES;
2339+
if (dma_has_cap(DMA_MEMSET, atdma->dma_device.cap_mask)) {
2340+
atdma->dma_device.device_prep_dma_memset = atc_prep_dma_memset;
2341+
atdma->dma_device.device_prep_dma_memset_sg = atc_prep_dma_memset_sg;
2342+
atdma->dma_device.fill_align = DMAENGINE_ALIGN_4_BYTES;
23432343
}
23442344

2345-
if (dma_has_cap(DMA_SLAVE, atdma->dma_common.cap_mask)) {
2346-
atdma->dma_common.device_prep_slave_sg = atc_prep_slave_sg;
2345+
if (dma_has_cap(DMA_SLAVE, atdma->dma_device.cap_mask)) {
2346+
atdma->dma_device.device_prep_slave_sg = atc_prep_slave_sg;
23472347
/* controller can do slave DMA: can trigger cyclic transfers */
2348-
dma_cap_set(DMA_CYCLIC, atdma->dma_common.cap_mask);
2349-
atdma->dma_common.device_prep_dma_cyclic = atc_prep_dma_cyclic;
2350-
atdma->dma_common.device_config = atc_config;
2351-
atdma->dma_common.device_pause = atc_pause;
2352-
atdma->dma_common.device_resume = atc_resume;
2353-
atdma->dma_common.device_terminate_all = atc_terminate_all;
2354-
atdma->dma_common.src_addr_widths = ATC_DMA_BUSWIDTHS;
2355-
atdma->dma_common.dst_addr_widths = ATC_DMA_BUSWIDTHS;
2356-
atdma->dma_common.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
2357-
atdma->dma_common.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
2348+
dma_cap_set(DMA_CYCLIC, atdma->dma_device.cap_mask);
2349+
atdma->dma_device.device_prep_dma_cyclic = atc_prep_dma_cyclic;
2350+
atdma->dma_device.device_config = atc_config;
2351+
atdma->dma_device.device_pause = atc_pause;
2352+
atdma->dma_device.device_resume = atc_resume;
2353+
atdma->dma_device.device_terminate_all = atc_terminate_all;
2354+
atdma->dma_device.src_addr_widths = ATC_DMA_BUSWIDTHS;
2355+
atdma->dma_device.dst_addr_widths = ATC_DMA_BUSWIDTHS;
2356+
atdma->dma_device.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
2357+
atdma->dma_device.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
23582358
}
23592359

23602360
dma_writel(atdma, EN, AT_DMA_ENABLE);
23612361

23622362
dev_info(&pdev->dev, "Atmel AHB DMA Controller ( %s%s%s), %d channels\n",
2363-
dma_has_cap(DMA_MEMCPY, atdma->dma_common.cap_mask) ? "cpy " : "",
2364-
dma_has_cap(DMA_MEMSET, atdma->dma_common.cap_mask) ? "set " : "",
2365-
dma_has_cap(DMA_SLAVE, atdma->dma_common.cap_mask) ? "slave " : "",
2363+
dma_has_cap(DMA_MEMCPY, atdma->dma_device.cap_mask) ? "cpy " : "",
2364+
dma_has_cap(DMA_MEMSET, atdma->dma_device.cap_mask) ? "set " : "",
2365+
dma_has_cap(DMA_SLAVE, atdma->dma_device.cap_mask) ? "slave " : "",
23662366
plat_dat->nr_channels);
23672367

2368-
err = dma_async_device_register(&atdma->dma_common);
2368+
err = dma_async_device_register(&atdma->dma_device);
23692369
if (err) {
23702370
dev_err(&pdev->dev, "Unable to register: %d.\n", err);
23712371
goto err_dma_async_device_register;
@@ -2388,7 +2388,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
23882388
return 0;
23892389

23902390
err_of_dma_controller_register:
2391-
dma_async_device_unregister(&atdma->dma_common);
2391+
dma_async_device_unregister(&atdma->dma_device);
23922392
err_dma_async_device_register:
23932393
dma_pool_destroy(atdma->memset_pool);
23942394
err_memset_pool_create:
@@ -2408,13 +2408,13 @@ static int at_dma_remove(struct platform_device *pdev)
24082408
at_dma_off(atdma);
24092409
if (pdev->dev.of_node)
24102410
of_dma_controller_free(pdev->dev.of_node);
2411-
dma_async_device_unregister(&atdma->dma_common);
2411+
dma_async_device_unregister(&atdma->dma_device);
24122412

24132413
dma_pool_destroy(atdma->memset_pool);
24142414
dma_pool_destroy(atdma->dma_desc_pool);
24152415
free_irq(platform_get_irq(pdev, 0), atdma);
24162416

2417-
list_for_each_entry_safe(chan, _chan, &atdma->dma_common.channels,
2417+
list_for_each_entry_safe(chan, _chan, &atdma->dma_device.channels,
24182418
device_node) {
24192419
struct at_dma_chan *atchan = to_at_dma_chan(chan);
24202420

@@ -2443,7 +2443,7 @@ static int at_dma_prepare(struct device *dev)
24432443
struct at_dma *atdma = dev_get_drvdata(dev);
24442444
struct dma_chan *chan, *_chan;
24452445

2446-
list_for_each_entry_safe(chan, _chan, &atdma->dma_common.channels,
2446+
list_for_each_entry_safe(chan, _chan, &atdma->dma_device.channels,
24472447
device_node) {
24482448
struct at_dma_chan *atchan = to_at_dma_chan(chan);
24492449
/* wait for transaction completion (except in cyclic case) */
@@ -2478,7 +2478,7 @@ static int at_dma_suspend_noirq(struct device *dev)
24782478
struct dma_chan *chan, *_chan;
24792479

24802480
/* preserve data */
2481-
list_for_each_entry_safe(chan, _chan, &atdma->dma_common.channels,
2481+
list_for_each_entry_safe(chan, _chan, &atdma->dma_device.channels,
24822482
device_node) {
24832483
struct at_dma_chan *atchan = to_at_dma_chan(chan);
24842484

@@ -2528,7 +2528,7 @@ static int at_dma_resume_noirq(struct device *dev)
25282528

25292529
/* restore saved data */
25302530
dma_writel(atdma, EBCIER, atdma->save_imr);
2531-
list_for_each_entry_safe(chan, _chan, &atdma->dma_common.channels,
2531+
list_for_each_entry_safe(chan, _chan, &atdma->dma_device.channels,
25322532
device_node) {
25332533
struct at_dma_chan *atchan = to_at_dma_chan(chan);
25342534

0 commit comments

Comments
 (0)