Skip to contentSkip to conversation

macmace: Set platform device coherent_dma_mask

PATCH New Finn Thain 1 participant 1 message May 3, 2018 Network drivers

lore
Share & tools
lore

Finn Thain

author
#0 lore raw

PATCH 1/1 macmace: Set platform device coherent_dma_mask

Set the device's coherent_dma_mask to avoid a WARNING splat. Please see commit 205e1b7f51e4 ("dma-mapping: warn when there is no coherent_dma_mask").

---
 drivers/net/ethernet/apple/macmace.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ethernet/apple/macmace.c +4 -0
index 137cbb470af2..98292c49ecf0 100644
@@ -203,6 +203,10 @@ static int mace_probe(struct platform_device *pdev)
 	unsigned char checksum = 0;
 	int err;
 
+	err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+	if (err)
+		return err;
+
 	dev = alloc_etherdev(PRIV_BYTES);
 	if (!dev)
 		return -ENOMEM;
Signature · 1 line
2.16.1