Subject: Re: question about of_platform vs 'platform'

From: Scott Wood <[email-masked]>
Date: Wed, 19 Mar 2008 17:43:45 -0500

On Wed, Mar 19, 2008 at 04:49:18PM -0500, Mike Hench wrote:
> bus: 'of_platform': driver_probe_device: matching device e0007000.spi
> with drive
> r fsl-elbc
> bus: 'platform': driver_probe_device: matching device fsl-usb2-udc.0
> with driver
>  mpc83xx_spi
> bus: 'platform': driver_probe_device: matching device mpc83xx_wdt.0 with
> driver
> mpc83xx_spi
> bus: 'platform': driver_probe_device: matching device fsl-i2c.0 with
> driver mpc8
> 3xx_spi
> bus: 'platform': driver_probe_device: matching device fsl-i2c.1 with
> driver mpc8
> 3xx_spi
> bus: 'platform': driver_probe_device: matching device Fixed MDIO bus.0
> with driv
> er mpc83xx_spi
> 
> it seems there is some sort of mismatch
> how did the kernel decide that SPI was an 'of_platform' device.

It will try to match all device nodes under probed buses to an of_platform
device.

> The DTS file spi entry look similar to the i2c entries.
> Those are treated as 'platform' devices.

There is glue code in arch/powerpc/sysdev/fsl_soc.c:of_fsl_spi_probe() to
create platform devices from the device nodes.

It doesn't seem to be registered as an initcall, though -- you need to call
it from platform code.  See mpc832x_rdb.c for an example.

-Scott