mbox series

[v2,00/15] mtd: maps: physmap cleanups

Message ID 20181019074908.13226-1-boris.brezillon@bootlin.com
Headers show
Series mtd: maps: physmap cleanups | expand

Message

Boris Brezillon Oct. 19, 2018, 7:48 a.m. UTC
Hello,

This is an attempt at merging physmap_of.c, gpio-addr-flash.c and
physmap.c. The rational behind this decision is code sharing and
consistency with what's done in other parts of the kernel:

- physmap_of is just adding OF/DT support to the physmap logic, and we
  usually put that code in the pre-existing driver instead of creating
  a new one

- gpio-addr-flash is just an extension of the physmap logic which is
  needed when the platform does not have enough native ADDR lines
  to address the whole flash. Again, I think this core belongs in the
  physmap driver

Patches 1 to 9 are just cleanups, and are not really related to the
merging of physmap_of and gpio-addr-flash into physmap.c.

Patch 10 to 13 are doing the actual merging work, and patch 14 is
documenting the addr-gpios property that has been added to support
the gpio-addr-flash on DT platforms.

Patch 15 is a cosmetic change proposed by Ricardo.

Regards,

Boris

Boris Brezillon (13):
  mtd: maps: physmap: Add SPDX header
  mtd: maps: physmap: Rename ->map and ->mtd into ->maps and ->mtds
  mtd: maps: physmap: Use platform_get_resource() to retrieve iomem
    resources
  mtd: maps: physmap: Use dev_notice() and a %pR specifier
  mtd: maps: physmap: Use devm_ioremap_resource()
  mtd: maps: physmap: Remove the MAX_RESOURCES limitation
  mtd: maps: physmap: Check mtd_device_{parse_register,unregister}() ret
    code
  mtd: maps: physmap: Return -ENOMEM directly when info allocation fails
  mtd: maps: physmap: Fix coding style issues reported by checkpatch
  mtd: maps: Prepare merging of physmap and physmap_of
  mtd: maps: Merge physmap_of.c into physmap-core.c
  mtd: maps: Rename physmap_of_{versatile,gemini} into
    physmap-{versatile,gemini}
  mtd: maps: Merge gpio-addr-flash.c into physmap-core.c

Ricardo Ribalda Delgado (2):
  dt-binding: mtd: physmap: Document the addr-gpios property
  mtd: maps: physmap: Invert logic on if/else branch

 .../devicetree/bindings/mtd/mtd-physmap.txt        |   2 +
 drivers/mtd/maps/Kconfig                           |  27 +-
 drivers/mtd/maps/Makefile                          |  10 +-
 drivers/mtd/maps/gpio-addr-flash.c                 | 281 ---------
 drivers/mtd/maps/physmap-core.c                    | 655 +++++++++++++++++++++
 .../maps/{physmap_of_gemini.c => physmap-gemini.c} |   2 +-
 .../maps/{physmap_of_gemini.h => physmap-gemini.h} |   2 +-
 ...{physmap_of_versatile.c => physmap-versatile.c} |   2 +-
 ...{physmap_of_versatile.h => physmap-versatile.h} |   2 +-
 drivers/mtd/maps/physmap.c                         | 280 ---------
 drivers/mtd/maps/physmap_of_core.c                 | 368 ------------
 11 files changed, 678 insertions(+), 953 deletions(-)
 delete mode 100644 drivers/mtd/maps/gpio-addr-flash.c
 create mode 100644 drivers/mtd/maps/physmap-core.c
 rename drivers/mtd/maps/{physmap_of_gemini.c => physmap-gemini.c} (98%)
 rename drivers/mtd/maps/{physmap_of_gemini.h => physmap-gemini.h} (90%)
 rename drivers/mtd/maps/{physmap_of_versatile.c => physmap-versatile.c} (99%)
 rename drivers/mtd/maps/{physmap_of_versatile.h => physmap-versatile.h} (90%)
 delete mode 100644 drivers/mtd/maps/physmap.c
 delete mode 100644 drivers/mtd/maps/physmap_of_core.c

Comments

Linus Walleij Oct. 22, 2018, 11:45 a.m. UTC | #1
On Fri, Oct 19, 2018 at 9:49 AM Boris Brezillon
<boris.brezillon@bootlin.com> wrote:

> This is an attempt at merging physmap_of.c, gpio-addr-flash.c and
> physmap.c. The rational behind this decision is code sharing and
> consistency with what's done in other parts of the kernel:
>
> - physmap_of is just adding OF/DT support to the physmap logic, and we
>   usually put that code in the pre-existing driver instead of creating
>   a new one
>
> - gpio-addr-flash is just an extension of the physmap logic which is
>   needed when the platform does not have enough native ADDR lines
>   to address the whole flash. Again, I think this core belongs in the
>   physmap driver
>
> Patches 1 to 9 are just cleanups, and are not really related to the
> merging of physmap_of and gpio-addr-flash into physmap.c.
>
> Patch 10 to 13 are doing the actual merging work, and patch 14 is
> documenting the addr-gpios property that has been added to support
> the gpio-addr-flash on DT platforms.
>
> Patch 15 is a cosmetic change proposed by Ricardo.

This series:
Acked-by: Linus Walleij <linus.walleij@linaro.org>

I expect to test the result when rebasing my patches for Gemini,
so hope for this to hit your devel branch after v4.20-rc1.

Yours,
Linus Walleij
Boris Brezillon Oct. 22, 2018, 1:41 p.m. UTC | #2
Hi Linus,

On Mon, 22 Oct 2018 13:45:49 +0200
Linus Walleij <linus.walleij@linaro.org> wrote:

> On Fri, Oct 19, 2018 at 9:49 AM Boris Brezillon
> <boris.brezillon@bootlin.com> wrote:
> 
> > This is an attempt at merging physmap_of.c, gpio-addr-flash.c and
> > physmap.c. The rational behind this decision is code sharing and
> > consistency with what's done in other parts of the kernel:
> >
> > - physmap_of is just adding OF/DT support to the physmap logic, and we
> >   usually put that code in the pre-existing driver instead of creating
> >   a new one
> >
> > - gpio-addr-flash is just an extension of the physmap logic which is
> >   needed when the platform does not have enough native ADDR lines
> >   to address the whole flash. Again, I think this core belongs in the
> >   physmap driver
> >
> > Patches 1 to 9 are just cleanups, and are not really related to the
> > merging of physmap_of and gpio-addr-flash into physmap.c.
> >
> > Patch 10 to 13 are doing the actual merging work, and patch 14 is
> > documenting the addr-gpios property that has been added to support
> > the gpio-addr-flash on DT platforms.
> >
> > Patch 15 is a cosmetic change proposed by Ricardo.  
> 
> This series:
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> 
> I expect to test the result when rebasing my patches for Gemini,
> so hope for this to hit your devel branch after v4.20-rc1.
> 

I already have a topic branch [1] in case you want to start working on
it before 4.20-rc1.

Regards,

Boris

[1]https://github.com/bbrezillon/linux-0day/tree/mtd/physmap-cleanup
Boris Brezillon Nov. 5, 2018, 9:27 p.m. UTC | #3
On Fri, 19 Oct 2018 09:48:53 +0200
Boris Brezillon <boris.brezillon@bootlin.com> wrote:

> Hello,
> 
> This is an attempt at merging physmap_of.c, gpio-addr-flash.c and
> physmap.c. The rational behind this decision is code sharing and
> consistency with what's done in other parts of the kernel:
> 
> - physmap_of is just adding OF/DT support to the physmap logic, and we
>   usually put that code in the pre-existing driver instead of creating
>   a new one
> 
> - gpio-addr-flash is just an extension of the physmap logic which is
>   needed when the platform does not have enough native ADDR lines
>   to address the whole flash. Again, I think this core belongs in the
>   physmap driver
> 
> Patches 1 to 9 are just cleanups, and are not really related to the
> merging of physmap_of and gpio-addr-flash into physmap.c.
> 
> Patch 10 to 13 are doing the actual merging work, and patch 14 is
> documenting the addr-gpios property that has been added to support
> the gpio-addr-flash on DT platforms.
> 
> Patch 15 is a cosmetic change proposed by Ricardo.
> 
> Regards,
> 
> Boris
> 
> Boris Brezillon (13):
>   mtd: maps: physmap: Add SPDX header
>   mtd: maps: physmap: Rename ->map and ->mtd into ->maps and ->mtds
>   mtd: maps: physmap: Use platform_get_resource() to retrieve iomem
>     resources
>   mtd: maps: physmap: Use dev_notice() and a %pR specifier
>   mtd: maps: physmap: Use devm_ioremap_resource()
>   mtd: maps: physmap: Remove the MAX_RESOURCES limitation
>   mtd: maps: physmap: Check mtd_device_{parse_register,unregister}() ret
>     code
>   mtd: maps: physmap: Return -ENOMEM directly when info allocation fails
>   mtd: maps: physmap: Fix coding style issues reported by checkpatch
>   mtd: maps: Prepare merging of physmap and physmap_of
>   mtd: maps: Merge physmap_of.c into physmap-core.c
>   mtd: maps: Rename physmap_of_{versatile,gemini} into
>     physmap-{versatile,gemini}
>   mtd: maps: Merge gpio-addr-flash.c into physmap-core.c
> 
> Ricardo Ribalda Delgado (2):
>   dt-binding: mtd: physmap: Document the addr-gpios property
>   mtd: maps: physmap: Invert logic on if/else branch

Queued to mtd/next.