Commit 2ebc36b9 authored by Serge Semin's avatar Serge Semin Committed by Vinod Koul

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: default avatarSerge Semin <fancer.lancer@gmail.com>
Acked-by: default avatarAndy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240802075100.6475-7-fancer.lancer@gmail.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent d8fa0802
...@@ -1155,7 +1155,7 @@ int do_dma_probe(struct dw_dma_chip *chip) ...@@ -1155,7 +1155,7 @@ int do_dma_probe(struct dw_dma_chip *chip)
bool autocfg = false; bool autocfg = false;
unsigned int dw_params; unsigned int dw_params;
unsigned int i; unsigned int i;
int err; int ret;
dw->pdata = devm_kzalloc(chip->dev, sizeof(*dw->pdata), GFP_KERNEL); dw->pdata = devm_kzalloc(chip->dev, sizeof(*dw->pdata), GFP_KERNEL);
if (!dw->pdata) if (!dw->pdata)
...@@ -1171,7 +1171,7 @@ int do_dma_probe(struct dw_dma_chip *chip) ...@@ -1171,7 +1171,7 @@ int do_dma_probe(struct dw_dma_chip *chip)
autocfg = dw_params >> DW_PARAMS_EN & 1; autocfg = dw_params >> DW_PARAMS_EN & 1;
if (!autocfg) { if (!autocfg) {
err = -EINVAL; ret = -EINVAL;
goto err_pdata; goto err_pdata;
} }
...@@ -1191,7 +1191,7 @@ int do_dma_probe(struct dw_dma_chip *chip) ...@@ -1191,7 +1191,7 @@ int do_dma_probe(struct dw_dma_chip *chip)
pdata->chan_allocation_order = CHAN_ALLOCATION_ASCENDING; pdata->chan_allocation_order = CHAN_ALLOCATION_ASCENDING;
pdata->chan_priority = CHAN_PRIORITY_ASCENDING; pdata->chan_priority = CHAN_PRIORITY_ASCENDING;
} else if (chip->pdata->nr_channels > DW_DMA_MAX_NR_CHANNELS) { } else if (chip->pdata->nr_channels > DW_DMA_MAX_NR_CHANNELS) {
err = -EINVAL; ret = -EINVAL;
goto err_pdata; goto err_pdata;
} else { } else {
memcpy(dw->pdata, chip->pdata, sizeof(*dw->pdata)); memcpy(dw->pdata, chip->pdata, sizeof(*dw->pdata));
...@@ -1203,7 +1203,7 @@ int do_dma_probe(struct dw_dma_chip *chip) ...@@ -1203,7 +1203,7 @@ int do_dma_probe(struct dw_dma_chip *chip)
dw->chan = devm_kcalloc(chip->dev, pdata->nr_channels, sizeof(*dw->chan), dw->chan = devm_kcalloc(chip->dev, pdata->nr_channels, sizeof(*dw->chan),
GFP_KERNEL); GFP_KERNEL);
if (!dw->chan) { if (!dw->chan) {
err = -ENOMEM; ret = -ENOMEM;
goto err_pdata; goto err_pdata;
} }
...@@ -1221,15 +1221,15 @@ int do_dma_probe(struct dw_dma_chip *chip) ...@@ -1221,15 +1221,15 @@ int do_dma_probe(struct dw_dma_chip *chip)
sizeof(struct dw_desc), 4, 0); sizeof(struct dw_desc), 4, 0);
if (!dw->desc_pool) { if (!dw->desc_pool) {
dev_err(chip->dev, "No memory for descriptors dma pool\n"); dev_err(chip->dev, "No memory for descriptors dma pool\n");
err = -ENOMEM; ret = -ENOMEM;
goto err_pdata; goto err_pdata;
} }
tasklet_setup(&dw->tasklet, dw_dma_tasklet); tasklet_setup(&dw->tasklet, dw_dma_tasklet);
err = request_irq(chip->irq, dw_dma_interrupt, IRQF_SHARED, ret = request_irq(chip->irq, dw_dma_interrupt, IRQF_SHARED,
dw->name, dw); dw->name, dw);
if (err) if (ret)
goto err_pdata; goto err_pdata;
INIT_LIST_HEAD(&dw->dma.channels); INIT_LIST_HEAD(&dw->dma.channels);
...@@ -1341,8 +1341,8 @@ int do_dma_probe(struct dw_dma_chip *chip) ...@@ -1341,8 +1341,8 @@ int do_dma_probe(struct dw_dma_chip *chip)
*/ */
dma_set_max_seg_size(dw->dma.dev, dw->chan[0].block_size); dma_set_max_seg_size(dw->dma.dev, dw->chan[0].block_size);
err = dma_async_device_register(&dw->dma); ret = dma_async_device_register(&dw->dma);
if (err) if (ret)
goto err_dma_register; goto err_dma_register;
dev_info(chip->dev, "DesignWare DMA Controller, %d channels\n", dev_info(chip->dev, "DesignWare DMA Controller, %d channels\n",
...@@ -1356,7 +1356,7 @@ int do_dma_probe(struct dw_dma_chip *chip) ...@@ -1356,7 +1356,7 @@ int do_dma_probe(struct dw_dma_chip *chip)
free_irq(chip->irq, dw); free_irq(chip->irq, dw);
err_pdata: err_pdata:
pm_runtime_put_sync_suspend(chip->dev); pm_runtime_put_sync_suspend(chip->dev);
return err; return ret;
} }
int do_dma_remove(struct dw_dma_chip *chip) int do_dma_remove(struct dw_dma_chip *chip)
......
...@@ -29,7 +29,7 @@ static int dw_probe(struct platform_device *pdev) ...@@ -29,7 +29,7 @@ static int dw_probe(struct platform_device *pdev)
struct dw_dma_chip_pdata *data; struct dw_dma_chip_pdata *data;
struct dw_dma_chip *chip; struct dw_dma_chip *chip;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
int err; int ret;
match = device_get_match_data(dev); match = device_get_match_data(dev);
if (!match) if (!match)
...@@ -51,9 +51,9 @@ static int dw_probe(struct platform_device *pdev) ...@@ -51,9 +51,9 @@ static int dw_probe(struct platform_device *pdev)
if (IS_ERR(chip->regs)) if (IS_ERR(chip->regs))
return PTR_ERR(chip->regs); return PTR_ERR(chip->regs);
err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (err) if (ret)
return err; return ret;
if (!data->pdata) if (!data->pdata)
data->pdata = dev_get_platdata(dev); data->pdata = dev_get_platdata(dev);
...@@ -69,14 +69,14 @@ static int dw_probe(struct platform_device *pdev) ...@@ -69,14 +69,14 @@ static int dw_probe(struct platform_device *pdev)
chip->clk = devm_clk_get_optional(chip->dev, "hclk"); chip->clk = devm_clk_get_optional(chip->dev, "hclk");
if (IS_ERR(chip->clk)) if (IS_ERR(chip->clk))
return PTR_ERR(chip->clk); return PTR_ERR(chip->clk);
err = clk_prepare_enable(chip->clk); ret = clk_prepare_enable(chip->clk);
if (err) if (ret)
return err; return ret;
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
err = data->probe(chip); ret = data->probe(chip);
if (err) if (ret)
goto err_dw_dma_probe; goto err_dw_dma_probe;
platform_set_drvdata(pdev, data); platform_set_drvdata(pdev, data);
...@@ -90,7 +90,7 @@ static int dw_probe(struct platform_device *pdev) ...@@ -90,7 +90,7 @@ static int dw_probe(struct platform_device *pdev)
err_dw_dma_probe: err_dw_dma_probe:
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
clk_disable_unprepare(chip->clk); clk_disable_unprepare(chip->clk);
return err; return ret;
} }
static void dw_remove(struct platform_device *pdev) static void dw_remove(struct platform_device *pdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment