Skip to content

Commit 2ebc36b

Browse files
fancervinodkoul
authored andcommitted
dmaengine: dw: Unify ret-val local variables naming
Currently there are two names utilized in the driver to keep the functions call status: ret and err. For the sake of unification convert to using the first version only. Signed-off-by: Serge Semin <[email protected]> Acked-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent d8fa080 commit 2ebc36b

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

drivers/dma/dw/core.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@ int do_dma_probe(struct dw_dma_chip *chip)
11551155
bool autocfg = false;
11561156
unsigned int dw_params;
11571157
unsigned int i;
1158-
int err;
1158+
int ret;
11591159

11601160
dw->pdata = devm_kzalloc(chip->dev, sizeof(*dw->pdata), GFP_KERNEL);
11611161
if (!dw->pdata)
@@ -1171,7 +1171,7 @@ int do_dma_probe(struct dw_dma_chip *chip)
11711171

11721172
autocfg = dw_params >> DW_PARAMS_EN & 1;
11731173
if (!autocfg) {
1174-
err = -EINVAL;
1174+
ret = -EINVAL;
11751175
goto err_pdata;
11761176
}
11771177

@@ -1191,7 +1191,7 @@ int do_dma_probe(struct dw_dma_chip *chip)
11911191
pdata->chan_allocation_order = CHAN_ALLOCATION_ASCENDING;
11921192
pdata->chan_priority = CHAN_PRIORITY_ASCENDING;
11931193
} else if (chip->pdata->nr_channels > DW_DMA_MAX_NR_CHANNELS) {
1194-
err = -EINVAL;
1194+
ret = -EINVAL;
11951195
goto err_pdata;
11961196
} else {
11971197
memcpy(dw->pdata, chip->pdata, sizeof(*dw->pdata));
@@ -1203,7 +1203,7 @@ int do_dma_probe(struct dw_dma_chip *chip)
12031203
dw->chan = devm_kcalloc(chip->dev, pdata->nr_channels, sizeof(*dw->chan),
12041204
GFP_KERNEL);
12051205
if (!dw->chan) {
1206-
err = -ENOMEM;
1206+
ret = -ENOMEM;
12071207
goto err_pdata;
12081208
}
12091209

@@ -1221,15 +1221,15 @@ int do_dma_probe(struct dw_dma_chip *chip)
12211221
sizeof(struct dw_desc), 4, 0);
12221222
if (!dw->desc_pool) {
12231223
dev_err(chip->dev, "No memory for descriptors dma pool\n");
1224-
err = -ENOMEM;
1224+
ret = -ENOMEM;
12251225
goto err_pdata;
12261226
}
12271227

12281228
tasklet_setup(&dw->tasklet, dw_dma_tasklet);
12291229

1230-
err = request_irq(chip->irq, dw_dma_interrupt, IRQF_SHARED,
1230+
ret = request_irq(chip->irq, dw_dma_interrupt, IRQF_SHARED,
12311231
dw->name, dw);
1232-
if (err)
1232+
if (ret)
12331233
goto err_pdata;
12341234

12351235
INIT_LIST_HEAD(&dw->dma.channels);
@@ -1341,8 +1341,8 @@ int do_dma_probe(struct dw_dma_chip *chip)
13411341
*/
13421342
dma_set_max_seg_size(dw->dma.dev, dw->chan[0].block_size);
13431343

1344-
err = dma_async_device_register(&dw->dma);
1345-
if (err)
1344+
ret = dma_async_device_register(&dw->dma);
1345+
if (ret)
13461346
goto err_dma_register;
13471347

13481348
dev_info(chip->dev, "DesignWare DMA Controller, %d channels\n",
@@ -1356,7 +1356,7 @@ int do_dma_probe(struct dw_dma_chip *chip)
13561356
free_irq(chip->irq, dw);
13571357
err_pdata:
13581358
pm_runtime_put_sync_suspend(chip->dev);
1359-
return err;
1359+
return ret;
13601360
}
13611361

13621362
int do_dma_remove(struct dw_dma_chip *chip)

drivers/dma/dw/platform.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static int dw_probe(struct platform_device *pdev)
2929
struct dw_dma_chip_pdata *data;
3030
struct dw_dma_chip *chip;
3131
struct device *dev = &pdev->dev;
32-
int err;
32+
int ret;
3333

3434
match = device_get_match_data(dev);
3535
if (!match)
@@ -51,9 +51,9 @@ static int dw_probe(struct platform_device *pdev)
5151
if (IS_ERR(chip->regs))
5252
return PTR_ERR(chip->regs);
5353

54-
err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
55-
if (err)
56-
return err;
54+
ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
55+
if (ret)
56+
return ret;
5757

5858
if (!data->pdata)
5959
data->pdata = dev_get_platdata(dev);
@@ -69,14 +69,14 @@ static int dw_probe(struct platform_device *pdev)
6969
chip->clk = devm_clk_get_optional(chip->dev, "hclk");
7070
if (IS_ERR(chip->clk))
7171
return PTR_ERR(chip->clk);
72-
err = clk_prepare_enable(chip->clk);
73-
if (err)
74-
return err;
72+
ret = clk_prepare_enable(chip->clk);
73+
if (ret)
74+
return ret;
7575

7676
pm_runtime_enable(&pdev->dev);
7777

78-
err = data->probe(chip);
79-
if (err)
78+
ret = data->probe(chip);
79+
if (ret)
8080
goto err_dw_dma_probe;
8181

8282
platform_set_drvdata(pdev, data);
@@ -90,7 +90,7 @@ static int dw_probe(struct platform_device *pdev)
9090
err_dw_dma_probe:
9191
pm_runtime_disable(&pdev->dev);
9292
clk_disable_unprepare(chip->clk);
93-
return err;
93+
return ret;
9494
}
9595

9696
static void dw_remove(struct platform_device *pdev)

0 commit comments

Comments
 (0)