diff mbox

[U-Boot,v8,14/14] sf: Rename sf_ops.c to spi-flash.c

Message ID 1449426866-696-15-git-send-email-jteki@openedev.com
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show

Commit Message

Jagan Teki Dec. 6, 2015, 6:34 p.m. UTC
Since all spi-flash core operations are moved into
sf_ops.c then it's better to renamed as spi-flash.c

Signed-off-by: Jagan Teki <jteki@openedev.com>
---
 drivers/mtd/spi/Makefile                  | 2 +-
 drivers/mtd/spi/{sf_ops.c => spi-flash.c} | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 rename drivers/mtd/spi/{sf_ops.c => spi-flash.c} (99%)

Comments

Simon Glass Dec. 9, 2015, 4:54 a.m. UTC | #1
On 6 December 2015 at 11:34, Jagan Teki <jteki@openedev.com> wrote:
> Since all spi-flash core operations are moved into
> sf_ops.c then it's better to renamed as spi-flash.c
>
> Signed-off-by: Jagan Teki <jteki@openedev.com>
> ---
>  drivers/mtd/spi/Makefile                  | 2 +-
>  drivers/mtd/spi/{sf_ops.c => spi-flash.c} | 7 ++++---
>  2 files changed, 5 insertions(+), 4 deletions(-)
>  rename drivers/mtd/spi/{sf_ops.c => spi-flash.c} (99%)

Reviewed-by: Simon Glass <sjg@chromium.org>

(but I suggest spi_flash.c is better as it fits with the other files)
Jagan Teki Dec. 9, 2015, 1:48 p.m. UTC | #2
On 9 December 2015 at 10:24, Simon Glass <sjg@chromium.org> wrote:
> On 6 December 2015 at 11:34, Jagan Teki <jteki@openedev.com> wrote:
>> Since all spi-flash core operations are moved into
>> sf_ops.c then it's better to renamed as spi-flash.c
>>
>> Signed-off-by: Jagan Teki <jteki@openedev.com>
>> ---
>>  drivers/mtd/spi/Makefile                  | 2 +-
>>  drivers/mtd/spi/{sf_ops.c => spi-flash.c} | 7 ++++---
>>  2 files changed, 5 insertions(+), 4 deletions(-)
>>  rename drivers/mtd/spi/{sf_ops.c => spi-flash.c} (99%)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
>
> (but I suggest spi_flash.c is better as it fits with the other files)

I too thought the same, but will rename the remaining to proper have a
plan for the same.

thanks!
Bin Meng Dec. 10, 2015, 1:31 a.m. UTC | #3
On Wed, Dec 9, 2015 at 12:54 PM, Simon Glass <sjg@chromium.org> wrote:
> On 6 December 2015 at 11:34, Jagan Teki <jteki@openedev.com> wrote:
>> Since all spi-flash core operations are moved into
>> sf_ops.c then it's better to renamed as spi-flash.c
>>
>> Signed-off-by: Jagan Teki <jteki@openedev.com>
>> ---
>>  drivers/mtd/spi/Makefile                  | 2 +-
>>  drivers/mtd/spi/{sf_ops.c => spi-flash.c} | 7 ++++---
>>  2 files changed, 5 insertions(+), 4 deletions(-)
>>  rename drivers/mtd/spi/{sf_ops.c => spi-flash.c} (99%)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
>
> (but I suggest spi_flash.c is better as it fits with the other files)

Agreed. spi_flash.c makes more sense. So far it looks that only driver
model uclass driver is using - in the file name, others are using _.

Other than this,

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Jagan Teki Dec. 10, 2015, 3:13 p.m. UTC | #4
On 10 December 2015 at 07:01, Bin Meng <bmeng.cn@gmail.com> wrote:
> On Wed, Dec 9, 2015 at 12:54 PM, Simon Glass <sjg@chromium.org> wrote:
>> On 6 December 2015 at 11:34, Jagan Teki <jteki@openedev.com> wrote:
>>> Since all spi-flash core operations are moved into
>>> sf_ops.c then it's better to renamed as spi-flash.c
>>>
>>> Signed-off-by: Jagan Teki <jteki@openedev.com>
>>> ---
>>>  drivers/mtd/spi/Makefile                  | 2 +-
>>>  drivers/mtd/spi/{sf_ops.c => spi-flash.c} | 7 ++++---
>>>  2 files changed, 5 insertions(+), 4 deletions(-)
>>>  rename drivers/mtd/spi/{sf_ops.c => spi-flash.c} (99%)
>>
>> Reviewed-by: Simon Glass <sjg@chromium.org>
>>
>> (but I suggest spi_flash.c is better as it fits with the other files)
>
> Agreed. spi_flash.c makes more sense. So far it looks that only driver
> model uclass driver is using - in the file name, others are using _.

Clear, but this file will handle common spi-flash core functionalities
it shouldn't be dm even now or later and more over underlying sf_probe
which is calling this through spi_flash_scan has a driver model on it.

>
> Other than this,
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

thanks!
Bin Meng Dec. 11, 2015, 6:23 a.m. UTC | #5
Hi Jagan,

On Thu, Dec 10, 2015 at 11:13 PM, Jagan Teki <jteki@openedev.com> wrote:
> On 10 December 2015 at 07:01, Bin Meng <bmeng.cn@gmail.com> wrote:
>> On Wed, Dec 9, 2015 at 12:54 PM, Simon Glass <sjg@chromium.org> wrote:
>>> On 6 December 2015 at 11:34, Jagan Teki <jteki@openedev.com> wrote:
>>>> Since all spi-flash core operations are moved into
>>>> sf_ops.c then it's better to renamed as spi-flash.c
>>>>
>>>> Signed-off-by: Jagan Teki <jteki@openedev.com>
>>>> ---
>>>>  drivers/mtd/spi/Makefile                  | 2 +-
>>>>  drivers/mtd/spi/{sf_ops.c => spi-flash.c} | 7 ++++---
>>>>  2 files changed, 5 insertions(+), 4 deletions(-)
>>>>  rename drivers/mtd/spi/{sf_ops.c => spi-flash.c} (99%)
>>>
>>> Reviewed-by: Simon Glass <sjg@chromium.org>
>>>
>>> (but I suggest spi_flash.c is better as it fits with the other files)
>>
>> Agreed. spi_flash.c makes more sense. So far it looks that only driver
>> model uclass driver is using - in the file name, others are using _.
>
> Clear, but this file will handle common spi-flash core functionalities
> it shouldn't be dm even now or later and more over underlying sf_probe
> which is calling this through spi_flash_scan has a driver model on it.

Sorry, I don't quite understand what you mean. But my comment is to
rename sf_ops.c to sf_flash.c, not sf-flash.c.

>
>>
>> Other than this,
>>
>> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>
> thanks!
> --

Regards,
Bin
Jagan Teki Dec. 11, 2015, 6:28 a.m. UTC | #6
On Friday 11 December 2015 11:53 AM, Bin Meng wrote:
> Hi Jagan,
>
> On Thu, Dec 10, 2015 at 11:13 PM, Jagan Teki <jteki@openedev.com> wrote:
>> On 10 December 2015 at 07:01, Bin Meng <bmeng.cn@gmail.com> wrote:
>>> On Wed, Dec 9, 2015 at 12:54 PM, Simon Glass <sjg@chromium.org> wrote:
>>>> On 6 December 2015 at 11:34, Jagan Teki <jteki@openedev.com> wrote:
>>>>> Since all spi-flash core operations are moved into
>>>>> sf_ops.c then it's better to renamed as spi-flash.c
>>>>>
>>>>> Signed-off-by: Jagan Teki <jteki@openedev.com>
>>>>> ---
>>>>>   drivers/mtd/spi/Makefile                  | 2 +-
>>>>>   drivers/mtd/spi/{sf_ops.c => spi-flash.c} | 7 ++++---
>>>>>   2 files changed, 5 insertions(+), 4 deletions(-)
>>>>>   rename drivers/mtd/spi/{sf_ops.c => spi-flash.c} (99%)
>>>>
>>>> Reviewed-by: Simon Glass <sjg@chromium.org>
>>>>
>>>> (but I suggest spi_flash.c is better as it fits with the other files)
>>>
>>> Agreed. spi_flash.c makes more sense. So far it looks that only driver
>>> model uclass driver is using - in the file name, others are using _.
>>
>> Clear, but this file will handle common spi-flash core functionalities
>> it shouldn't be dm even now or later and more over underlying sf_probe
>> which is calling this through spi_flash_scan has a driver model on it.
>
> Sorry, I don't quite understand what you mean. But my comment is to
> rename sf_ops.c to sf_flash.c, not sf-flash.c.


spi-flash.c (the function spi_flash_scan from sf_probe, so this never be 
a dm driver and it handles all core functionalities
======================================================================
sf_probe.c (this has dm support)
=================================

Since you're saying dm has - and ie the reason I'm saying spi-flash.c 
should technically a dm supported core.

Let me know if you're not clear though.

thanks!
Bin Meng Dec. 11, 2015, 6:51 a.m. UTC | #7
Hi Jagan,

On Fri, Dec 11, 2015 at 2:28 PM, Jagan Teki <jteki@openedev.com> wrote:
>
>
> On Friday 11 December 2015 11:53 AM, Bin Meng wrote:
>>
>> Hi Jagan,
>>
>> On Thu, Dec 10, 2015 at 11:13 PM, Jagan Teki <jteki@openedev.com> wrote:
>>>
>>> On 10 December 2015 at 07:01, Bin Meng <bmeng.cn@gmail.com> wrote:
>>>>
>>>> On Wed, Dec 9, 2015 at 12:54 PM, Simon Glass <sjg@chromium.org> wrote:
>>>>>
>>>>> On 6 December 2015 at 11:34, Jagan Teki <jteki@openedev.com> wrote:
>>>>>>
>>>>>> Since all spi-flash core operations are moved into
>>>>>> sf_ops.c then it's better to renamed as spi-flash.c
>>>>>>
>>>>>> Signed-off-by: Jagan Teki <jteki@openedev.com>
>>>>>> ---
>>>>>>   drivers/mtd/spi/Makefile                  | 2 +-
>>>>>>   drivers/mtd/spi/{sf_ops.c => spi-flash.c} | 7 ++++---
>>>>>>   2 files changed, 5 insertions(+), 4 deletions(-)
>>>>>>   rename drivers/mtd/spi/{sf_ops.c => spi-flash.c} (99%)
>>>>>
>>>>>
>>>>> Reviewed-by: Simon Glass <sjg@chromium.org>
>>>>>
>>>>> (but I suggest spi_flash.c is better as it fits with the other files)
>>>>
>>>>
>>>> Agreed. spi_flash.c makes more sense. So far it looks that only driver
>>>> model uclass driver is using - in the file name, others are using _.
>>>
>>>
>>> Clear, but this file will handle common spi-flash core functionalities
>>> it shouldn't be dm even now or later and more over underlying sf_probe
>>> which is calling this through spi_flash_scan has a driver model on it.
>>
>>
>> Sorry, I don't quite understand what you mean. But my comment is to
>> rename sf_ops.c to sf_flash.c, not sf-flash.c.
>
>
>
> spi-flash.c (the function spi_flash_scan from sf_probe, so this never be a
> dm driver and it handles all core functionalities
> ======================================================================
> sf_probe.c (this has dm support)
> =================================
>
> Since you're saying dm has - and ie the reason I'm saying spi-flash.c should
> technically a dm supported core.
>

I was saying it looks to me that only dm uclass driver is allowed to
have -, like sf-uclass.c or pci-uclass.c. Other files we should use _.

> Let me know if you're not clear though.
>

Regards,
Bin
Jagan Teki Dec. 11, 2015, 7:02 a.m. UTC | #8
On Friday 11 December 2015 12:21 PM, Bin Meng wrote:
> Hi Jagan,
>
> On Fri, Dec 11, 2015 at 2:28 PM, Jagan Teki <jteki@openedev.com> wrote:
>>
>>
>> On Friday 11 December 2015 11:53 AM, Bin Meng wrote:
>>>
>>> Hi Jagan,
>>>
>>> On Thu, Dec 10, 2015 at 11:13 PM, Jagan Teki <jteki@openedev.com> wrote:
>>>>
>>>> On 10 December 2015 at 07:01, Bin Meng <bmeng.cn@gmail.com> wrote:
>>>>>
>>>>> On Wed, Dec 9, 2015 at 12:54 PM, Simon Glass <sjg@chromium.org> wrote:
>>>>>>
>>>>>> On 6 December 2015 at 11:34, Jagan Teki <jteki@openedev.com> wrote:
>>>>>>>
>>>>>>> Since all spi-flash core operations are moved into
>>>>>>> sf_ops.c then it's better to renamed as spi-flash.c
>>>>>>>
>>>>>>> Signed-off-by: Jagan Teki <jteki@openedev.com>
>>>>>>> ---
>>>>>>>    drivers/mtd/spi/Makefile                  | 2 +-
>>>>>>>    drivers/mtd/spi/{sf_ops.c => spi-flash.c} | 7 ++++---
>>>>>>>    2 files changed, 5 insertions(+), 4 deletions(-)
>>>>>>>    rename drivers/mtd/spi/{sf_ops.c => spi-flash.c} (99%)
>>>>>>
>>>>>>
>>>>>> Reviewed-by: Simon Glass <sjg@chromium.org>
>>>>>>
>>>>>> (but I suggest spi_flash.c is better as it fits with the other files)
>>>>>
>>>>>
>>>>> Agreed. spi_flash.c makes more sense. So far it looks that only driver
>>>>> model uclass driver is using - in the file name, others are using _.
>>>>
>>>>
>>>> Clear, but this file will handle common spi-flash core functionalities
>>>> it shouldn't be dm even now or later and more over underlying sf_probe
>>>> which is calling this through spi_flash_scan has a driver model on it.
>>>
>>>
>>> Sorry, I don't quite understand what you mean. But my comment is to
>>> rename sf_ops.c to sf_flash.c, not sf-flash.c.
>>
>>
>>
>> spi-flash.c (the function spi_flash_scan from sf_probe, so this never be a
>> dm driver and it handles all core functionalities
>> ======================================================================
>> sf_probe.c (this has dm support)
>> =================================
>>
>> Since you're saying dm has - and ie the reason I'm saying spi-flash.c should
>> technically a dm supported core.
>>
>
> I was saying it looks to me that only dm uclass driver is allowed to
> have -, like sf-uclass.c or pci-uclass.c. Other files we should use _.

sf_probe.c is a dm driver - agree?
If ie the case probably this is the first file has a code moved from dm 
driver into different file which is spi-flash in this case.

thanks!
Simon Glass Dec. 11, 2015, 2:34 p.m. UTC | #9
Hi Jagan,

On 11 December 2015 at 00:02, Jagan Teki <jteki@openedev.com> wrote:
> On Friday 11 December 2015 12:21 PM, Bin Meng wrote:
>>
>> Hi Jagan,
>>
>> On Fri, Dec 11, 2015 at 2:28 PM, Jagan Teki <jteki@openedev.com> wrote:
>>>
>>>
>>>
>>> On Friday 11 December 2015 11:53 AM, Bin Meng wrote:
>>>>
>>>>
>>>> Hi Jagan,
>>>>
>>>> On Thu, Dec 10, 2015 at 11:13 PM, Jagan Teki <jteki@openedev.com> wrote:
>>>>>
>>>>>
>>>>> On 10 December 2015 at 07:01, Bin Meng <bmeng.cn@gmail.com> wrote:
>>>>>>
>>>>>>
>>>>>> On Wed, Dec 9, 2015 at 12:54 PM, Simon Glass <sjg@chromium.org> wrote:
>>>>>>>
>>>>>>>
>>>>>>> On 6 December 2015 at 11:34, Jagan Teki <jteki@openedev.com> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>> Since all spi-flash core operations are moved into
>>>>>>>> sf_ops.c then it's better to renamed as spi-flash.c
>>>>>>>>
>>>>>>>> Signed-off-by: Jagan Teki <jteki@openedev.com>
>>>>>>>> ---
>>>>>>>>    drivers/mtd/spi/Makefile                  | 2 +-
>>>>>>>>    drivers/mtd/spi/{sf_ops.c => spi-flash.c} | 7 ++++---
>>>>>>>>    2 files changed, 5 insertions(+), 4 deletions(-)
>>>>>>>>    rename drivers/mtd/spi/{sf_ops.c => spi-flash.c} (99%)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Reviewed-by: Simon Glass <sjg@chromium.org>
>>>>>>>
>>>>>>> (but I suggest spi_flash.c is better as it fits with the other files)
>>>>>>
>>>>>>
>>>>>>
>>>>>> Agreed. spi_flash.c makes more sense. So far it looks that only driver
>>>>>> model uclass driver is using - in the file name, others are using _.
>>>>>
>>>>>
>>>>>
>>>>> Clear, but this file will handle common spi-flash core functionalities
>>>>> it shouldn't be dm even now or later and more over underlying sf_probe
>>>>> which is calling this through spi_flash_scan has a driver model on it.
>>>>
>>>>
>>>>
>>>> Sorry, I don't quite understand what you mean. But my comment is to
>>>> rename sf_ops.c to sf_flash.c, not sf-flash.c.
>>>
>>>
>>>
>>>
>>> spi-flash.c (the function spi_flash_scan from sf_probe, so this never be
>>> a
>>> dm driver and it handles all core functionalities
>>> ======================================================================
>>> sf_probe.c (this has dm support)
>>> =================================
>>>
>>> Since you're saying dm has - and ie the reason I'm saying spi-flash.c
>>> should
>>> technically a dm supported core.
>>>
>>
>> I was saying it looks to me that only dm uclass driver is allowed to
>> have -, like sf-uclass.c or pci-uclass.c. Other files we should use _.
>
>
> sf_probe.c is a dm driver - agree?
> If ie the case probably this is the first file has a code moved from dm
> driver into different file which is spi-flash in this case.

The current convention is that the uclass driver has a hyphen. There
is a different between the *single* uclass driver for a uclass, and
all the 'normal' drivers that use it. Also all the uclass drivers have
UCLASS_DRIVER() defined in then, and end in '-uclass.c'. Please can
you rename the file to spi_flash.c?

Regards,
Simon
diff mbox

Patch

diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
index a24f761..7bc76a2 100644
--- a/drivers/mtd/spi/Makefile
+++ b/drivers/mtd/spi/Makefile
@@ -12,7 +12,7 @@  obj-$(CONFIG_SPL_SPI_LOAD)	+= spi_spl_load.o
 obj-$(CONFIG_SPL_SPI_BOOT)	+= fsl_espi_spl.o
 endif
 
-obj-$(CONFIG_SPI_FLASH) += sf_probe.o sf_ops.o sf_params.o sf.o
+obj-$(CONFIG_SPI_FLASH) += sf_probe.o spi-flash.o sf_params.o sf.o
 obj-$(CONFIG_SPI_FLASH_DATAFLASH) += sf_dataflash.o
 obj-$(CONFIG_SPI_FLASH_MTD) += sf_mtd.o
 obj-$(CONFIG_SPI_FLASH_SANDBOX) += sandbox.o
diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/spi-flash.c
similarity index 99%
rename from drivers/mtd/spi/sf_ops.c
rename to drivers/mtd/spi/spi-flash.c
index c065858..7ffa136 100644
--- a/drivers/mtd/spi/sf_ops.c
+++ b/drivers/mtd/spi/spi-flash.c
@@ -1,9 +1,10 @@ 
 /*
- * SPI flash operations
+ * SPI Flash Core
  *
- * Copyright (C) 2008 Atmel Corporation
- * Copyright (C) 2010 Reinhard Meyer, EMK Elektronik
+ * Copyright (C) 2015 Jagan Teki <jteki@openedev.com>
  * Copyright (C) 2013 Jagannadha Sutradharudu Teki, Xilinx Inc.
+ * Copyright (C) 2010 Reinhard Meyer, EMK Elektronik
+ * Copyright (C) 2008 Atmel Corporation
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */