[U-Boot] [U-boot] u-boot dm/spi claim_bus arguments

Haikun.Wang at freescale.com Haikun.Wang at freescale.com
Mon Apr 20 04:29:44 CEST 2015


On 3/10/2015 11:46 AM, Simon Glass wrote:
> Hi Wang,
>
> On 9 March 2015 at 21:41, Haikun.Wang at freescale.com
> <mailto:Haikun.Wang at freescale.com> <Haikun.Wang at freescale.com
> <mailto:Haikun.Wang at freescale.com>> wrote:
>
>     Hi Simon,
>     I am working on converting my SPI driver to driver model.
>     I have some doubt about the arguments of the function pointer member
>     ‘claim_bus’ of structure dm_spi_ops.
>     In function ‘spi_claim_bus’ we call function ‘dm_spi_ops->claim_bus’
>     using the bus device as the input argument in file spi-uclass.c.
>     And the comment of ‘claim_bus’ says the input argument should be the
>     slave device in the definition of the structure dm_spi_ops in file
>     include/spi.h.
>     I use the bus device as the input argument in my instantiation of
>     ‘claim_bus’.
>
>
> It should be 'slave', not 'bus'. I think both of those functions
> (spi_claim_bus() and spi_release_bus()) are wrong.
>
> The old SPI interface passes a spi_slave, so the new DM one should also
> pass a slave, in this case a struct udevice, but not a bus.
>
> I will see if I can do a patch (both Tegra and Exynos need fixing), but
> in the meantime, please change it.
>
> Regards,
> Simon
>
>     *Best regards,*
>     *Wang Haikun*
>
>

Copy to U-boot mailing list.
-- 

Best regards,
Wang Haikun


More information about the U-Boot mailing list