Re: [PATCH v13 net-next 9/9] mfd: ocelot: add support for the vsc7512 chip via spi

Lee Jones
2022-07-20T08:19:50Z

On Tue, 19 Jul 2022, Colin Foster wrote:

> On Mon, Jul 18, 2022 at 03:18:28PM +0100, Lee Jones wrote:
> > On Tue, 05 Jul 2022, Colin Foster wrote:
> >
> > > +MODULE_IMPORT_NS(MFD_OCELOT_SPI);
> > > diff --git a/drivers/mfd/ocelot-spi.c b/drivers/mfd/ocelot-spi.c
> > > new file mode 100644
> > > index 000000000000..0c1c5215c706
> > > --- /dev/null
> > > +++ b/drivers/mfd/ocelot-spi.c
> > > @@ -0,0 +1,317 @@
> > > +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> > > +/*
> > > + * SPI core driver for the Ocelot chip family.
> > > + *
> > > + * This driver will handle everything necessary to allow for communication over
> > > + * SPI to the VSC7511, VSC7512, VSC7513 and VSC7514 chips. The main functions
> > > + * are to prepare the chip's SPI interface for a specific bus speed, and a host
> > > + * processor's endianness. This will create and distribute regmaps for any
> > > + * children.
> > > + *
> > > + * Copyright 2021, 2022 Innovative Advantage Inc.
> > > + *
> > > + * Author: Colin Foster <colin.foster@in-advantage.com>
> > > + */
> > > +
> > > +#include <linux/ioport.h>
> > > +#include <linux/kconfig.h>
> > > +#include <linux/module.h>
> > > +#include <linux/regmap.h>
> > > +#include <linux/spi/spi.h>
> > > +
> > > +#include <asm/byteorder.h>
> > > +
> > > +#include "ocelot.h"
> > > +
> > > +#define REG_DEV_CPUORG_IF_CTRL 0x0000
> > > +#define REG_DEV_CPUORG_IF_CFGSTAT 0x0004
> > > +
> > > +#define CFGSTAT_IF_NUM_VCORE (0 << 24)
> > > +#define CFGSTAT_IF_NUM_VRAP (1 << 24)
> > > +#define CFGSTAT_IF_NUM_SI (2 << 24)
> > > +#define CFGSTAT_IF_NUM_MIIM (3 << 24)
> > > +
> > > +#define VSC7512_DEVCPU_ORG_RES_START 0x71000000
> > > +#define VSC7512_DEVCPU_ORG_RES_SIZE 0x38
> > > +
> > > +#define VSC7512_CHIP_REGS_RES_START 0x71070000
> > > +#define VSC7512_CHIP_REGS_RES_SIZE 0x14
> > > +
> > > +struct spi_device;
> >
> > Why not just #include?
>
> I mis-understood this to mean drivers/mfd/ocelot-spi.c when it meant
> drivers/mfd/ocelot.h. Thanks.
>
> https://patchwork.kernel.org/project/netdevbpf/patch/20220701192609.3970317-10-colin.foster@in-advantage.com/#24921057
>
> """
> You missed a lot of forward declarations that are used in this file.
>
> Like
>
> struct spi_device;
> """

spi_device is used in *this* file.

You should explicitly add the include file.

--
Lee Jones [李琼斯]
Principal Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog