Skip to content

Commit 5b16251

Browse files
krzkambarus
authored andcommitted
spi: atmel: Simplify with dev_err_probe()
Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and the error value gets printed. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20200901152713.18629-3-krzk@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit 9618947) Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
1 parent 1b487dc commit 5b16251

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/spi/spi-atmel.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,8 @@ static int atmel_spi_configure_dma(struct spi_master *master,
513513

514514
master->dma_tx = dma_request_chan(dev, "tx");
515515
if (IS_ERR(master->dma_tx)) {
516-
err = PTR_ERR(master->dma_tx);
517-
if (err != -EPROBE_DEFER)
518-
dev_err(dev, "No TX DMA channel, DMA is disabled\n");
516+
err = dev_err_probe(dev, PTR_ERR(master->dma_tx),
517+
"No TX DMA channel, DMA is disabled\n");
519518
goto error_clear;
520519
}
521520

0 commit comments

Comments
 (0)