Thread (17 messages) flat view 17 messages, 4 authors, 2019-08-15

Re: [PATCH 6/6] driver core: initialize a default DMA mask for platform device

From: Christoph Hellwig <hch@lst.de>
Date: 2019-08-15 13:32:13
Also in: linux-arch, linux-iommu, linux-usb, linuxppc-dev, lkml

On Wed, Aug 14, 2019 at 04:49:13PM +0100, Robin Murphy wrote:
quoted
because we have to support platform_device structures that are
statically allocated.
This would be a good point to also get rid of the long-standing bodge in 
platform_device_register_full().
platform_device_register_full looks odd to start with, especially
as the coumentation is rather lacking..
quoted
  +static void setup_pdev_archdata(struct platform_device *pdev)
Bikeshed: painting the generic DMA API properties as "archdata" feels a bit 
off-target :/
quoted
+{
+	if (!pdev->dev.coherent_dma_mask)
+		pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	if (!pdev->dma_mask)
+		pdev->dma_mask = DMA_BIT_MASK(32);
+	if (!pdev->dev.dma_mask)
+		pdev->dev.dma_mask = &pdev->dma_mask;
+	arch_setup_pdev_archdata(pdev);
AFAICS m68k's implementation of that arch hook becomes entirely redundant 
after this change, so may as well go. That would just leave powerpc's 
actual archdata, which at a glance looks like it could probably be cleaned 
up with not *too* much trouble.
Actually I think we can just kill both off.  At the point archdata
is indeed entirely misnamed.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help