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

From: Christoph Hellwig
Date: Thu Aug 15 2019 - 09:32:14 EST


On Wed, Aug 14, 2019 at 04:49:13PM +0100, Robin Murphy wrote:
>> 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..

>> +static void setup_pdev_archdata(struct platform_device *pdev)
>
> Bikeshed: painting the generic DMA API properties as "archdata" feels a bit
> off-target :/
>
>> +{
>> + 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.