[U-Boot] [PATCH v2 2/3] spi: davinci: Full dm conversion

Jagan Teki jagannadh.teki at gmail.com
Thu Apr 26 11:00:19 UTC 2018


On Thu, Apr 26, 2018 at 1:45 PM, Gajjar Akash <gajjar04aka at gmail.com> wrote:
> Hi Jagan,
>
>
>> +#if CONFIG_IS_ENABLED(OF_CONTROL)
>>  static int davinci_ofdata_to_platadata(struct udevice *bus)
>>  {
>> -       struct davinci_spi_slave *ds = dev_get_priv(bus);
>> -       const void *blob = gd->fdt_blob;
>> -       int node = dev_of_offset(bus);
>> +       struct davinci_spi_platdata *plat = bus->platdata;
>> +       fdt_addr_t addr;
>>
>> -       ds->regs = devfdt_map_physmem(bus, sizeof(struct
>> davinci_spi_regs));
>> -       if (!ds->regs) {
>> -               printf("%s: could not map device address\n", __func__);
>> +       addr = devfdt_get_addr(bus);
>> +       if (addr == FDT_ADDR_T_NONE)
>>                 return -EINVAL;
>> -       }
>> -       ds->num_cs = fdtdec_get_int(blob, node, "num-cs", 4);
>> +
>> +       plat->regs = (struct davinci_spi_regs *)addr;
>> +       plat->num_cs = fdtdec_get_int(gd->fdt_blob, dev_of_offset(bus),
>> "num-cs", 4);
>>
>>         return 0;
>>  }
>> @@ -566,14 +426,17 @@ static const struct udevice_id davinci_spi_ids[] = {
>>         { .compatible = "ti,da830-spi" },
>>         { }
>>  };
>> +#endif
>>
>>  U_BOOT_DRIVER(davinci_spi) = {
>>         .name = "davinci_spi",
>>         .id = UCLASS_SPI,
>> +#if CONFIG_IS_ENABLED(OF_CONTROL)
>>         .of_match = davinci_spi_ids,
>> -       .ops = &davinci_spi_ops,
>>         .ofdata_to_platdata = davinci_ofdata_to_platadata,
>> -       .priv_auto_alloc_size = sizeof(struct davinci_spi_slave),
>> +        .platdata_auto_alloc_size = sizeof(struct davinci_spi_platdata),
>> +#endif
>>         .probe = davinci_spi_probe,
>> +       .ops = &davinci_spi_ops,
>>
>
> In this patch definition of davinci_spi_ops is being guarded by OF_CONTROL,
> It should be out side of OF_CONTROL.

Nice catch, will fix it on next version.

thanks, Jagan.


More information about the U-Boot mailing list