[PATCH v2 1/6] spi/mpc8xxx: refactor the common code for SPI/eSPI controller

Grant Likely grant.likely at secretlab.ca
Tue Aug 10 16:40:21 EST 2010


On Mon, Aug 2, 2010 at 1:51 AM, Mingkai Hu <Mingkai.hu at freescale.com> wrote:
> Refactor the common code in file spi_mpc8xxx.c to spi_fsl_lib.c
> used by SPI/eSPI controller driver as a library, move the SPI
> controller driver to a new file spi_fsl_spi.c, and leave the
> QE/CPM SPI controller code in this file.
>
> Because the register map of the SPI controller and eSPI controller
> is so different, also leave the code operated the register to the
> driver code, not the common code.
>
> Signed-off-by: Mingkai Hu <Mingkai.hu at freescale.com>
> ---
> v2:
>  - Rename spi_mpc8xxx.c to spi_fsl_lib.c, also the config name
>  - Rename fsl_spi.c to spi_fsl_spi.c, also the config name
>  - Move register map definiton from spi_fsl_lib.c to spi_fsl_spi.c
>  - Break some funcions line in the arguments instead of the declaration
>  - Init bits_per_word to 0 to eliminate the else clause
>  - Add brace for the else clause to match if clause
>  - Drop the last entry's comma in the match table
>  - move module_init() immediately after the init fsl_spi_init() function
>
>  drivers/spi/Kconfig       |   20 +-
>  drivers/spi/Makefile      |    3 +-
>  drivers/spi/spi_fsl_lib.c |  237 ++++++++
>  drivers/spi/spi_fsl_lib.h |  119 ++++
>  drivers/spi/spi_fsl_spi.c | 1173 +++++++++++++++++++++++++++++++++++++
>  drivers/spi/spi_mpc8xxx.c | 1421 ---------------------------------------------

This patch seems pretty good now.  However, the rename from
spi_mpc8xxx.c to spi_fsl_lib.c should be done in a separate patch.  It
is too difficult to track what has changed, when the file gets moved
at the same time.  Move the file in one patch verbatim (with the
required Makefile change), and then move out the fsl_spi specific bits
in a second patch.

g.


More information about the Linuxppc-dev mailing list