of: restricted dma: Don't fail device probe on rmem init failure
authorWill Deacon <will@kernel.org>
Mon, 16 Aug 2021 13:26:17 +0000 (14:26 +0100)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 23 Aug 2021 10:32:04 +0000 (06:32 -0400)
commitf3cfd136aef0184919464b49d5b74d43605abcbc
treeae36fc12ee82720324fd473c292aea4d5ddbce4a
parentce5cb67c664fbc93d1af20b3fbd7a07eda9f6ee6
of: restricted dma: Don't fail device probe on rmem init failure

If CONFIG_DMA_RESTRICTED_POOL=n then probing a device with a reference
to a "restricted-dma-pool" will fail with a reasonably cryptic error:

  | pci-host-generic: probe of 10000.pci failed with error -22

Rework of_dma_set_restricted_buffer() so that it does not cause probing
failure and instead either returns early if CONFIG_DMA_RESTRICTED_POOL=n
or emits a diagnostic if the reserved DMA pool fails to initialise.

Cc: Claire Chang <tientzu@chromium.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/of/device.c