Re: [PATCH] USB: EHCI: DT support for generic bus glue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday 25 March 2013, Alan Stern wrote:
> >  
> > +     if (!dev->dev.platform_data) {
> > +             dev->dev.platform_data = &ehci_platform_defaults;
> > +             dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
> > +             dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> 
> In view of Felipe's comment, shouldn't these last two lines be 
> controlled by dev->dev.of_node != NULL instead?

We could do that, or alternatively like this

	if (!dev->dev.platform_data) {
		dev->dev.platform_data = &ehci_platform_defaults;
	if (!dev->dev.dma_mask)
		dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
	if (!dev->dev.coherent_dma_mask)
		dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);

which would have the additional advantage that platforms can then
call platform_device_register_resndata() to create the device
and get a reasonable default dma mask (EHCI should always have
32 bit DMA, unless the platform is really screwed), rather than
statically declaring platform devices.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux