Re: [PATCH v11 2/2] spi: loongson: add bus driver for the loongson spi controller

From: Mark Brown
Date: Wed May 24 2023 - 06:20:48 EST


On Wed, May 24, 2023 at 11:42:34AM +0300, Andy Shevchenko wrote:
> On Wed, May 24, 2023 at 10:52 AM zhuyinbo <zhuyinbo@xxxxxxxxxxx> wrote:

> > >> +#define LOONGSON_SPI_SPCR_REG 0x00
> > >> +#define LOONGSON_SPI_SPSR_REG 0x01
> > >> +#define LOONGSON_SPI_FIFO_REG 0x02
> > >> +#define LOONGSON_SPI_SPER_REG 0x03
> > >> +#define LOONGSON_SPI_PARA_REG 0x04
> > >> +#define LOONGSON_SPI_SFCS_REG 0x05
> > >> +#define LOONGSON_SPI_TIMI_REG 0x06

> > > Where is this used outside of the main driver?

> > These definitions are only used in core.c

> Then the obvious question, why are they located in *.h?

It's absolutely fine to put them in a header file, that's a perfectly
normal way of writing code - it helps keep the driver a bit smaller by
putting big piles of defines in a separate file, that can help make
things a bit more manageable.

Attachment: signature.asc
Description: PGP signature