[U-Boot] u-boot dm/spi claim_bus arguments
Simon Glass
sjg at chromium.org
Sun Apr 19 17:02:00 CEST 2015
Hi,
On 9 March 2015 at 21:46, Simon Glass <sjg at chromium.org> wrote:
> Hi Wang,
>
> On 9 March 2015 at 21:41, Haikun.Wang at freescale.com
> <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.
I just realised that this did not go to the U-Boot list, so am copying
it now. I will prepare a patch.
>
> Regards,
> Simon
>
>
>>
>> Best regards,
>> Wang Haikun
>>
>>
>>
>
>
Regards,
Simon
More information about the U-Boot
mailing list