[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <39e99d0b-9a5a-446d-aed7-efee21216ec1@sirena.org.uk>
Date: Wed, 24 May 2023 11:19:09 +0100
From: Mark Brown <broonie@...nel.org>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: zhuyinbo <zhuyinbo@...ngson.cn>, Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
linux-spi@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, Jianmin Lv <lvjianmin@...ngson.cn>,
wanghongliang@...ngson.cn, Liu Peibao <liupeibao@...ngson.cn>,
loongson-kernel@...ts.loongnix.cn
Subject: Re: [PATCH v11 2/2] spi: loongson: add bus driver for the loongson
spi controller
On Wed, May 24, 2023 at 11:42:34AM +0300, Andy Shevchenko wrote:
> On Wed, May 24, 2023 at 10:52 AM zhuyinbo <zhuyinbo@...ngson.cn> 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.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists