Skip to content

Commit 78a7349

Browse files
krzkmiquelraynal
authored andcommitted
mtd: rawnand: gpmi: 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> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200901142535.12819-3-krzk@kernel.org
1 parent 1caa752 commit 78a7349

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,10 +1004,8 @@ static int acquire_dma_channels(struct gpmi_nand_data *this)
10041004
/* request dma channel */
10051005
dma_chan = dma_request_chan(&pdev->dev, "rx-tx");
10061006
if (IS_ERR(dma_chan)) {
1007-
ret = PTR_ERR(dma_chan);
1008-
if (ret != -EPROBE_DEFER)
1009-
dev_err(this->dev, "DMA channel request failed: %d\n",
1010-
ret);
1007+
ret = dev_err_probe(this->dev, PTR_ERR(dma_chan),
1008+
"DMA channel request failed\n");
10111009
release_dma_channels(this);
10121010
} else {
10131011
this->dma_chans[0] = dma_chan;

0 commit comments

Comments
 (0)