[U-Boot] [PATCH 4/8] dm-sf: use mtd_ops, drop dm_spi_flash_ops

Simon Glass sjg at chromium.org
Fri Nov 6 04:15:46 CET 2015


Hi Jagan,

On 29 October 2015 at 07:11, Jagan Teki <jteki at openedev.com> wrote:
> Hi Heiko,
>
> On 29 October 2015 at 12:05, Heiko Schocher <hs at denx.de> wrote:
>> Hello Jagan,
>>
>> Am 12.10.2015 um 21:54 schrieb Jagan Teki:
>>>
>>> Since mtd_info ops got introduced, just drop the unneeded
>>> dm_spi_flash operations.
>>>
>>> Signed-off-by: Jagan Teki <jteki at openedev.com>
>>> ---
>>>   drivers/mtd/spi/sf-uclass.c | 16 --------
>>>   drivers/mtd/spi/sf_probe.c  | 30 ---------------
>>>   include/spi_flash.h         | 91
>>> +++++++--------------------------------------
>>>   3 files changed, 14 insertions(+), 123 deletions(-)
>>
>>
>> Does this not break: drivers/mtd/spi/sf-uclass.c ?
>
> This wouldn't break the dm because mtd_info ops are common to dm or
> non-dm spi-flash which I tuned in this series[1] That means the tuned
> sf series is prior to this MTD.
>
>>
>> added simon to cc.
>>
>>
>>>
>>> diff --git a/drivers/mtd/spi/sf-uclass.c b/drivers/mtd/spi/sf-uclass.c
>>> index 350e21a..5cdbd1b 100644
>>> --- a/drivers/mtd/spi/sf-uclass.c
>>> +++ b/drivers/mtd/spi/sf-uclass.c
>>> @@ -11,22 +11,6 @@
>>>   #include <dm/device-internal.h>
>>>   #include "sf_internal.h"
>>>
>>> -int spi_flash_read_dm(struct udevice *dev, u32 offset, size_t len, void
>>> *buf)
>>> -{
>>> -       return sf_get_ops(dev)->read(dev, offset, len, buf);
>>> -}
>>> -
>>> -int spi_flash_write_dm(struct udevice *dev, u32 offset, size_t len,
>>> -                      const void *buf)
>>> -{
>>> -       return sf_get_ops(dev)->write(dev, offset, len, buf);
>>> -}
>>> -
>>> -int spi_flash_erase_dm(struct udevice *dev, u32 offset, size_t len)
>>> -{
>>> -       return sf_get_ops(dev)->erase(dev, offset, len);
>>> -}
>>> -

These are the functions that we should keep. It is the the ones that
don't take a struct udevice parameter which should be removed...

Regards,
Simon


More information about the U-Boot mailing list