bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Arun Ramadoss <arun.ramadoss@microchip.com>
Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, netdev@vger.kernel.org,
	KP Singh <kpsingh@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Yonghong Song <yhs@fb.com>, Song Liu <songliubraving@fb.com>,
	Martin KaFai Lau <kafai@fb.com>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Woojung Huh <woojung.huh@microchip.com>,
	UNGLinuxDriver@microchip.com, Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Rob Herring <robh+dt@kernel.org>
Subject: Re: [Patch net-next v13 07/13] net: dsa: microchip: add LAN937x SPI driver
Date: Wed, 4 May 2022 23:07:26 +0300	[thread overview]
Message-ID: <20220504200726.pn7y73gt7wc2dpsg@skbuf> (raw)
In-Reply-To: <20220504151755.11737-8-arun.ramadoss@microchip.com>

On Wed, May 04, 2022 at 08:47:49PM +0530, Arun Ramadoss wrote:
> This patch add the SPI driver for the LAN937x switches. It uses the
> lan937x_main.c and lan937x_dev.c functions.
> 
> Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
> ---
>  drivers/net/dsa/microchip/Makefile      |   1 +
>  drivers/net/dsa/microchip/ksz_common.h  |   1 +
>  drivers/net/dsa/microchip/lan937x_dev.c |   7 +
>  drivers/net/dsa/microchip/lan937x_spi.c | 236 ++++++++++++++++++++++++
>  4 files changed, 245 insertions(+)
>  create mode 100644 drivers/net/dsa/microchip/lan937x_spi.c
> 
> diff --git a/drivers/net/dsa/microchip/Makefile b/drivers/net/dsa/microchip/Makefile
> index d32ff38dc240..28d8eb62a795 100644
> --- a/drivers/net/dsa/microchip/Makefile
> +++ b/drivers/net/dsa/microchip/Makefile
> @@ -10,3 +10,4 @@ obj-$(CONFIG_NET_DSA_MICROCHIP_KSZ8863_SMI)	+= ksz8863_smi.o
>  obj-$(CONFIG_NET_DSA_MICROCHIP_LAN937X)		+= lan937x.o
>  lan937x-objs := lan937x_dev.o
>  lan937x-objs += lan937x_main.o
> +lan937x-objs += lan937x_spi.o
> diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h
> index 5671f580948d..fd9e0705d2d2 100644
> --- a/drivers/net/dsa/microchip/ksz_common.h
> +++ b/drivers/net/dsa/microchip/ksz_common.h
> @@ -151,6 +151,7 @@ void ksz_switch_remove(struct ksz_device *dev);
>  int ksz8_switch_register(struct ksz_device *dev);
>  int ksz9477_switch_register(struct ksz_device *dev);
>  int lan937x_switch_register(struct ksz_device *dev);
> +int lan937x_check_device_id(struct ksz_device *dev);
>  
>  void ksz_update_port_member(struct ksz_device *dev, int port);
>  void ksz_init_mib_timer(struct ksz_device *dev);
> diff --git a/drivers/net/dsa/microchip/lan937x_dev.c b/drivers/net/dsa/microchip/lan937x_dev.c
> index 3f1797cc1d16..f430a8711775 100644
> --- a/drivers/net/dsa/microchip/lan937x_dev.c
> +++ b/drivers/net/dsa/microchip/lan937x_dev.c
> @@ -386,8 +386,15 @@ static int lan937x_mdio_register(struct ksz_device *dev)
>  
>  static int lan937x_switch_init(struct ksz_device *dev)
>  {
> +	int ret;
> +
>  	dev->ds->ops = &lan937x_switch_ops;
>  
> +	/* Check device tree */
> +	ret = lan937x_check_device_id(dev);
> +	if (ret < 0)
> +		return ret;
> +

Can't this be called from lan937x_spi_probe() directly, why do you need
to go through lan937x_switch_register() first?

>  	dev->port_mask = (1 << dev->port_cnt) - 1;
>  
>  	dev->ports = devm_kzalloc(dev->dev,

  reply	other threads:[~2022-05-04 20:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04 15:17 [Patch net-next v13 00/13] net: dsa: microchip: DSA driver support for LAN937x Arun Ramadoss
2022-05-04 15:17 ` [Patch net-next v13 01/13] dt-bindings: net: make internal-delay-ps based on phy-mode Arun Ramadoss
2022-05-04 15:17 ` [Patch net-next v13 02/13] dt-bindings: net: dsa: dt bindings for microchip lan937x Arun Ramadoss
2022-05-04 15:17 ` [Patch net-next v13 03/13] net: dsa: move mib->cnt_ptr reset code to ksz_common.c Arun Ramadoss
2022-05-04 15:17 ` [Patch net-next v13 04/13] net: dsa: tag_ksz: add tag handling for Microchip LAN937x Arun Ramadoss
2022-05-04 15:17 ` [Patch net-next v13 05/13] net: dsa: microchip: add DSA support for microchip LAN937x Arun Ramadoss
2022-05-04 15:17 ` [Patch net-next v13 06/13] net: dsa: microchip: add support for phy read and write Arun Ramadoss
2022-05-04 15:17 ` [Patch net-next v13 07/13] net: dsa: microchip: add LAN937x SPI driver Arun Ramadoss
2022-05-04 20:07   ` Vladimir Oltean [this message]
2022-05-05 10:32     ` Arun.Ramadoss
2022-05-05 15:15       ` Vladimir Oltean
2022-05-04 15:17 ` [Patch net-next v13 08/13] net: dsa: microchip: add support for MTU configuration and fast_age Arun Ramadoss
2022-05-04 15:17 ` [Patch net-next v13 09/13] net: dsa: microchip: add support for phylink management Arun Ramadoss
2022-05-04 15:17 ` [Patch net-next v13 10/13] net: dsa: microchip: add support for ethtool port counters Arun Ramadoss
2022-05-04 15:17 ` [Patch net-next v13 11/13] net: dsa: microchip: add support for port mirror operations Arun Ramadoss
2022-05-04 15:17 ` [Patch net-next v13 12/13] net: dsa: microchip: add support for fdb and mdb management Arun Ramadoss
2022-05-04 15:17 ` [Patch net-next v13 13/13] net: dsa: microchip: add support for vlan operations Arun Ramadoss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220504200726.pn7y73gt7wc2dpsg@skbuf \
    --to=olteanv@gmail.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=andrii@kernel.org \
    --cc=arun.ramadoss@microchip.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh+dt@kernel.org \
    --cc=songliubraving@fb.com \
    --cc=vivien.didelot@gmail.com \
    --cc=woojung.huh@microchip.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).