Commit e7836518 authored by Tudor Ambarus's avatar Tudor Ambarus Committed by Herbert Xu

crypto: atmel-{aes,sha,tdes} - Rename labels in probe()

Choose label names which say what the goto does and not from where
the goto was issued. This avoids adding superfluous labels like
"err_aes_buff".
Signed-off-by: default avatarTudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent c9063a02
...@@ -2622,7 +2622,7 @@ static int atmel_aes_probe(struct platform_device *pdev) ...@@ -2622,7 +2622,7 @@ static int atmel_aes_probe(struct platform_device *pdev)
if (!aes_res) { if (!aes_res) {
dev_err(dev, "no MEM resource info\n"); dev_err(dev, "no MEM resource info\n");
err = -ENODEV; err = -ENODEV;
goto res_err; goto err_tasklet_kill;
} }
aes_dd->phys_base = aes_res->start; aes_dd->phys_base = aes_res->start;
...@@ -2630,14 +2630,14 @@ static int atmel_aes_probe(struct platform_device *pdev) ...@@ -2630,14 +2630,14 @@ static int atmel_aes_probe(struct platform_device *pdev)
aes_dd->irq = platform_get_irq(pdev, 0); aes_dd->irq = platform_get_irq(pdev, 0);
if (aes_dd->irq < 0) { if (aes_dd->irq < 0) {
err = aes_dd->irq; err = aes_dd->irq;
goto res_err; goto err_tasklet_kill;
} }
err = devm_request_irq(&pdev->dev, aes_dd->irq, atmel_aes_irq, err = devm_request_irq(&pdev->dev, aes_dd->irq, atmel_aes_irq,
IRQF_SHARED, "atmel-aes", aes_dd); IRQF_SHARED, "atmel-aes", aes_dd);
if (err) { if (err) {
dev_err(dev, "unable to request aes irq.\n"); dev_err(dev, "unable to request aes irq.\n");
goto res_err; goto err_tasklet_kill;
} }
/* Initializing the clock */ /* Initializing the clock */
...@@ -2645,40 +2645,40 @@ static int atmel_aes_probe(struct platform_device *pdev) ...@@ -2645,40 +2645,40 @@ static int atmel_aes_probe(struct platform_device *pdev)
if (IS_ERR(aes_dd->iclk)) { if (IS_ERR(aes_dd->iclk)) {
dev_err(dev, "clock initialization failed.\n"); dev_err(dev, "clock initialization failed.\n");
err = PTR_ERR(aes_dd->iclk); err = PTR_ERR(aes_dd->iclk);
goto res_err; goto err_tasklet_kill;
} }
aes_dd->io_base = devm_ioremap_resource(&pdev->dev, aes_res); aes_dd->io_base = devm_ioremap_resource(&pdev->dev, aes_res);
if (IS_ERR(aes_dd->io_base)) { if (IS_ERR(aes_dd->io_base)) {
dev_err(dev, "can't ioremap\n"); dev_err(dev, "can't ioremap\n");
err = PTR_ERR(aes_dd->io_base); err = PTR_ERR(aes_dd->io_base);
goto res_err; goto err_tasklet_kill;
} }
err = clk_prepare(aes_dd->iclk); err = clk_prepare(aes_dd->iclk);
if (err) if (err)
goto res_err; goto err_tasklet_kill;
err = atmel_aes_hw_version_init(aes_dd); err = atmel_aes_hw_version_init(aes_dd);
if (err) if (err)
goto iclk_unprepare; goto err_iclk_unprepare;
atmel_aes_get_cap(aes_dd); atmel_aes_get_cap(aes_dd);
#if IS_ENABLED(CONFIG_CRYPTO_DEV_ATMEL_AUTHENC) #if IS_ENABLED(CONFIG_CRYPTO_DEV_ATMEL_AUTHENC)
if (aes_dd->caps.has_authenc && !atmel_sha_authenc_is_ready()) { if (aes_dd->caps.has_authenc && !atmel_sha_authenc_is_ready()) {
err = -EPROBE_DEFER; err = -EPROBE_DEFER;
goto iclk_unprepare; goto err_iclk_unprepare;
} }
#endif #endif
err = atmel_aes_buff_init(aes_dd); err = atmel_aes_buff_init(aes_dd);
if (err) if (err)
goto err_aes_buff; goto err_iclk_unprepare;
err = atmel_aes_dma_init(aes_dd, pdata); err = atmel_aes_dma_init(aes_dd, pdata);
if (err) if (err)
goto err_aes_dma; goto err_buff_cleanup;
spin_lock(&atmel_aes.lock); spin_lock(&atmel_aes.lock);
list_add_tail(&aes_dd->list, &atmel_aes.dev_list); list_add_tail(&aes_dd->list, &atmel_aes.dev_list);
...@@ -2699,12 +2699,11 @@ static int atmel_aes_probe(struct platform_device *pdev) ...@@ -2699,12 +2699,11 @@ static int atmel_aes_probe(struct platform_device *pdev)
list_del(&aes_dd->list); list_del(&aes_dd->list);
spin_unlock(&atmel_aes.lock); spin_unlock(&atmel_aes.lock);
atmel_aes_dma_cleanup(aes_dd); atmel_aes_dma_cleanup(aes_dd);
err_aes_dma: err_buff_cleanup:
atmel_aes_buff_cleanup(aes_dd); atmel_aes_buff_cleanup(aes_dd);
err_aes_buff: err_iclk_unprepare:
iclk_unprepare:
clk_unprepare(aes_dd->iclk); clk_unprepare(aes_dd->iclk);
res_err: err_tasklet_kill:
tasklet_kill(&aes_dd->done_task); tasklet_kill(&aes_dd->done_task);
tasklet_kill(&aes_dd->queue_task); tasklet_kill(&aes_dd->queue_task);
......
...@@ -2756,7 +2756,7 @@ static int atmel_sha_probe(struct platform_device *pdev) ...@@ -2756,7 +2756,7 @@ static int atmel_sha_probe(struct platform_device *pdev)
if (!sha_res) { if (!sha_res) {
dev_err(dev, "no MEM resource info\n"); dev_err(dev, "no MEM resource info\n");
err = -ENODEV; err = -ENODEV;
goto res_err; goto err_tasklet_kill;
} }
sha_dd->phys_base = sha_res->start; sha_dd->phys_base = sha_res->start;
...@@ -2764,14 +2764,14 @@ static int atmel_sha_probe(struct platform_device *pdev) ...@@ -2764,14 +2764,14 @@ static int atmel_sha_probe(struct platform_device *pdev)
sha_dd->irq = platform_get_irq(pdev, 0); sha_dd->irq = platform_get_irq(pdev, 0);
if (sha_dd->irq < 0) { if (sha_dd->irq < 0) {
err = sha_dd->irq; err = sha_dd->irq;
goto res_err; goto err_tasklet_kill;
} }
err = devm_request_irq(&pdev->dev, sha_dd->irq, atmel_sha_irq, err = devm_request_irq(&pdev->dev, sha_dd->irq, atmel_sha_irq,
IRQF_SHARED, "atmel-sha", sha_dd); IRQF_SHARED, "atmel-sha", sha_dd);
if (err) { if (err) {
dev_err(dev, "unable to request sha irq.\n"); dev_err(dev, "unable to request sha irq.\n");
goto res_err; goto err_tasklet_kill;
} }
/* Initializing the clock */ /* Initializing the clock */
...@@ -2779,23 +2779,23 @@ static int atmel_sha_probe(struct platform_device *pdev) ...@@ -2779,23 +2779,23 @@ static int atmel_sha_probe(struct platform_device *pdev)
if (IS_ERR(sha_dd->iclk)) { if (IS_ERR(sha_dd->iclk)) {
dev_err(dev, "clock initialization failed.\n"); dev_err(dev, "clock initialization failed.\n");
err = PTR_ERR(sha_dd->iclk); err = PTR_ERR(sha_dd->iclk);
goto res_err; goto err_tasklet_kill;
} }
sha_dd->io_base = devm_ioremap_resource(&pdev->dev, sha_res); sha_dd->io_base = devm_ioremap_resource(&pdev->dev, sha_res);
if (IS_ERR(sha_dd->io_base)) { if (IS_ERR(sha_dd->io_base)) {
dev_err(dev, "can't ioremap\n"); dev_err(dev, "can't ioremap\n");
err = PTR_ERR(sha_dd->io_base); err = PTR_ERR(sha_dd->io_base);
goto res_err; goto err_tasklet_kill;
} }
err = clk_prepare(sha_dd->iclk); err = clk_prepare(sha_dd->iclk);
if (err) if (err)
goto res_err; goto err_tasklet_kill;
err = atmel_sha_hw_version_init(sha_dd); err = atmel_sha_hw_version_init(sha_dd);
if (err) if (err)
goto iclk_unprepare; goto err_iclk_unprepare;
atmel_sha_get_cap(sha_dd); atmel_sha_get_cap(sha_dd);
...@@ -2806,13 +2806,13 @@ static int atmel_sha_probe(struct platform_device *pdev) ...@@ -2806,13 +2806,13 @@ static int atmel_sha_probe(struct platform_device *pdev)
if (IS_ERR(pdata)) { if (IS_ERR(pdata)) {
dev_err(&pdev->dev, "platform data not available\n"); dev_err(&pdev->dev, "platform data not available\n");
err = PTR_ERR(pdata); err = PTR_ERR(pdata);
goto iclk_unprepare; goto err_iclk_unprepare;
} }
} }
err = atmel_sha_dma_init(sha_dd, pdata); err = atmel_sha_dma_init(sha_dd, pdata);
if (err) if (err)
goto err_sha_dma; goto err_iclk_unprepare;
dev_info(dev, "using %s for DMA transfers\n", dev_info(dev, "using %s for DMA transfers\n",
dma_chan_name(sha_dd->dma_lch_in.chan)); dma_chan_name(sha_dd->dma_lch_in.chan));
...@@ -2838,10 +2838,9 @@ static int atmel_sha_probe(struct platform_device *pdev) ...@@ -2838,10 +2838,9 @@ static int atmel_sha_probe(struct platform_device *pdev)
spin_unlock(&atmel_sha.lock); spin_unlock(&atmel_sha.lock);
if (sha_dd->caps.has_dma) if (sha_dd->caps.has_dma)
atmel_sha_dma_cleanup(sha_dd); atmel_sha_dma_cleanup(sha_dd);
err_sha_dma: err_iclk_unprepare:
iclk_unprepare:
clk_unprepare(sha_dd->iclk); clk_unprepare(sha_dd->iclk);
res_err: err_tasklet_kill:
tasklet_kill(&sha_dd->queue_task); tasklet_kill(&sha_dd->queue_task);
tasklet_kill(&sha_dd->done_task); tasklet_kill(&sha_dd->done_task);
......
...@@ -1262,7 +1262,7 @@ static int atmel_tdes_probe(struct platform_device *pdev) ...@@ -1262,7 +1262,7 @@ static int atmel_tdes_probe(struct platform_device *pdev)
if (!tdes_res) { if (!tdes_res) {
dev_err(dev, "no MEM resource info\n"); dev_err(dev, "no MEM resource info\n");
err = -ENODEV; err = -ENODEV;
goto res_err; goto err_tasklet_kill;
} }
tdes_dd->phys_base = tdes_res->start; tdes_dd->phys_base = tdes_res->start;
...@@ -1270,14 +1270,14 @@ static int atmel_tdes_probe(struct platform_device *pdev) ...@@ -1270,14 +1270,14 @@ static int atmel_tdes_probe(struct platform_device *pdev)
tdes_dd->irq = platform_get_irq(pdev, 0); tdes_dd->irq = platform_get_irq(pdev, 0);
if (tdes_dd->irq < 0) { if (tdes_dd->irq < 0) {
err = tdes_dd->irq; err = tdes_dd->irq;
goto res_err; goto err_tasklet_kill;
} }
err = devm_request_irq(&pdev->dev, tdes_dd->irq, atmel_tdes_irq, err = devm_request_irq(&pdev->dev, tdes_dd->irq, atmel_tdes_irq,
IRQF_SHARED, "atmel-tdes", tdes_dd); IRQF_SHARED, "atmel-tdes", tdes_dd);
if (err) { if (err) {
dev_err(dev, "unable to request tdes irq.\n"); dev_err(dev, "unable to request tdes irq.\n");
goto res_err; goto err_tasklet_kill;
} }
/* Initializing the clock */ /* Initializing the clock */
...@@ -1285,25 +1285,25 @@ static int atmel_tdes_probe(struct platform_device *pdev) ...@@ -1285,25 +1285,25 @@ static int atmel_tdes_probe(struct platform_device *pdev)
if (IS_ERR(tdes_dd->iclk)) { if (IS_ERR(tdes_dd->iclk)) {
dev_err(dev, "clock initialization failed.\n"); dev_err(dev, "clock initialization failed.\n");
err = PTR_ERR(tdes_dd->iclk); err = PTR_ERR(tdes_dd->iclk);
goto res_err; goto err_tasklet_kill;
} }
tdes_dd->io_base = devm_ioremap_resource(&pdev->dev, tdes_res); tdes_dd->io_base = devm_ioremap_resource(&pdev->dev, tdes_res);
if (IS_ERR(tdes_dd->io_base)) { if (IS_ERR(tdes_dd->io_base)) {
dev_err(dev, "can't ioremap\n"); dev_err(dev, "can't ioremap\n");
err = PTR_ERR(tdes_dd->io_base); err = PTR_ERR(tdes_dd->io_base);
goto res_err; goto err_tasklet_kill;
} }
err = atmel_tdes_hw_version_init(tdes_dd); err = atmel_tdes_hw_version_init(tdes_dd);
if (err) if (err)
goto res_err; goto err_tasklet_kill;
atmel_tdes_get_cap(tdes_dd); atmel_tdes_get_cap(tdes_dd);
err = atmel_tdes_buff_init(tdes_dd); err = atmel_tdes_buff_init(tdes_dd);
if (err) if (err)
goto err_tdes_buff; goto err_tasklet_kill;
if (tdes_dd->caps.has_dma) { if (tdes_dd->caps.has_dma) {
pdata = pdev->dev.platform_data; pdata = pdev->dev.platform_data;
...@@ -1312,13 +1312,13 @@ static int atmel_tdes_probe(struct platform_device *pdev) ...@@ -1312,13 +1312,13 @@ static int atmel_tdes_probe(struct platform_device *pdev)
if (IS_ERR(pdata)) { if (IS_ERR(pdata)) {
dev_err(&pdev->dev, "platform data not available\n"); dev_err(&pdev->dev, "platform data not available\n");
err = PTR_ERR(pdata); err = PTR_ERR(pdata);
goto err_pdata; goto err_buff_cleanup;
} }
} }
err = atmel_tdes_dma_init(tdes_dd, pdata); err = atmel_tdes_dma_init(tdes_dd, pdata);
if (err) if (err)
goto err_tdes_dma; goto err_buff_cleanup;
dev_info(dev, "using %s, %s for DMA transfers\n", dev_info(dev, "using %s, %s for DMA transfers\n",
dma_chan_name(tdes_dd->dma_lch_in.chan), dma_chan_name(tdes_dd->dma_lch_in.chan),
...@@ -1343,11 +1343,9 @@ static int atmel_tdes_probe(struct platform_device *pdev) ...@@ -1343,11 +1343,9 @@ static int atmel_tdes_probe(struct platform_device *pdev)
spin_unlock(&atmel_tdes.lock); spin_unlock(&atmel_tdes.lock);
if (tdes_dd->caps.has_dma) if (tdes_dd->caps.has_dma)
atmel_tdes_dma_cleanup(tdes_dd); atmel_tdes_dma_cleanup(tdes_dd);
err_tdes_dma: err_buff_cleanup:
err_pdata:
atmel_tdes_buff_cleanup(tdes_dd); atmel_tdes_buff_cleanup(tdes_dd);
err_tdes_buff: err_tasklet_kill:
res_err:
tasklet_kill(&tdes_dd->done_task); tasklet_kill(&tdes_dd->done_task);
tasklet_kill(&tdes_dd->queue_task); tasklet_kill(&tdes_dd->queue_task);
......
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