From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from verein.lst.de ([213.95.11.211]:46747 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730635AbfHONcM (ORCPT ); Thu, 15 Aug 2019 09:32:12 -0400 Date: Thu, 15 Aug 2019 15:32:04 +0200 From: Christoph Hellwig Subject: Re: [PATCH 6/6] driver core: initialize a default DMA mask for platform device Message-ID: <20190815133204.GD12036@lst.de> References: <20190811080520.21712-1-hch@lst.de> <20190811080520.21712-7-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: Robin Murphy Cc: Christoph Hellwig , Greg Kroah-Hartman , Maxime Chevallier , linux-arch@vger.kernel.org, Olav Kongas , Gavin Li , linuxppc-dev@lists.ozlabs.org, Mathias Nyman , Geoff Levand , Fabio Estevam , Sascha Hauer , linux-usb@vger.kernel.org, Michal Simek , linux-kernel@vger.kernel.org, Tony Prisk , iommu@lists.linux-foundation.org, Alan Stern , NXP Linux Team , Pengutronix Kernel Team , Minas Harutyunyan , Shawn Guo , Bin Liu , linux-arm-kernel@lists.infradead.org Message-ID: <20190815133204.adzxp-eWiZFz3Xv4F88JHlw4xAc2hNQWU_Qmg7t9tyg@z> 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.