From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754239AbeDZVJY (ORCPT ); Thu, 26 Apr 2018 17:09:24 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:42269 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751496AbeDZVJW (ORCPT ); Thu, 26 Apr 2018 17:09:22 -0400 Date: Thu, 26 Apr 2018 23:09:15 +0200 From: Andrew Lunn To: Alexandre Belloni Cc: "David S . Miller" , Allan Nielsen , razvan.stefanescu@nxp.com, po.liu@nxp.com, Thomas Petazzoni , Florian Fainelli , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org Subject: Re: [PATCH net-next v2 4/7] net: mscc: Add initial Ocelot switch support Message-ID: <20180426210915.GE23481@lunn.ch> References: <20180426195931.5393-1-alexandre.belloni@bootlin.com> <20180426195931.5393-5-alexandre.belloni@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180426195931.5393-5-alexandre.belloni@bootlin.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +/* Checks if the net_device instance given to us originate from our driver. */ > +static bool ocelot_netdevice_dev_check(const struct net_device *dev) > +{ > + return dev->netdev_ops == &ocelot_port_netdev_ops; > +} This is probably O.K. now, but when you add support for controlling the switch over PCIe, i think it breaks. A board could have two switches... It might be possible to do something with dev->parent. All ports of a switch should have the same parent. Andrew