Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3983992imm; Mon, 30 Jul 2018 06:51:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd1z/Qg1BM4pGYNBcmh9XzhS2p4uAbWIEsSnKLLK/d5QPrBVRbv7/FNPWS65+NYnDdS5vi5 X-Received: by 2002:a63:f657:: with SMTP id u23-v6mr7899195pgj.258.1532958692390; Mon, 30 Jul 2018 06:51:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532958692; cv=none; d=google.com; s=arc-20160816; b=EfYBFaf9fjhlcYXI1oC/JUPdr7nY7lC87wykgzGUNWhNLewiHJ8PdJXe+Q1HNLqMXi iBDolP1aZIuWtFU36LSOGXabCC9UrMZH3D5Vf+UvOSmLVKX4ILLYNm10vzXSOqn/RTcU N6kGB7WGVS6Aa248RnmIjZaWj1pA0nkEvs/CVTnu6DDUilMis2q1a0Hp6hcVnbG5inTg yNozlrj+/q90g74xMnE/GP+5NcKaz+boTo+Eq5m1oo/QEU1k0TVKM8WJVlLuu8bwdSrx qdMtBltSf3IzoxO9t9XGOAG0zX14DBM7MtMAtVaI8RwIHMOalpsh7vyQIwFqN0o3zKMF r7Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=U3oipQDuKhWXq1o6qVl/9OolBNXLVPhtpVyoIhKPzuI=; b=xscqiqbWq2CvmU8HGs5eRtYi/uTQglqBSmywJHlOOYqA+HCRssF1jO2tlq5OyQ85mq XlbEBY/se5cB6wa5oyThwcWusw1/IginuA7FWcPI88yBxLGoO8qtnRYFwSYLp7cqwquk YdKtutqDGWpdbXihtH8E+g4CORouu0n6REyMbjPIwI9J4sk7eSXqmgqVBjKcXN3KFMtK ADvvo+WUsgGyp0YIpEdXcg7bu7o3lLSzOVODSUkR7fJhNjVjoJPO/xGhKVQ11738zXTc sHScWc9sb24vl7MCrPsOo5iA6vduB606nS1d3fUQVVZZAi4we9X8Cm+FlAX+daW7uEmS 0qLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Ekizksp6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y126-v6si10600098pgb.23.2018.07.30.06.51.17; Mon, 30 Jul 2018 06:51:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Ekizksp6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727057AbeG3PZd (ORCPT + 99 others); Mon, 30 Jul 2018 11:25:33 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:50431 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726535AbeG3PZd (ORCPT ); Mon, 30 Jul 2018 11:25:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=U3oipQDuKhWXq1o6qVl/9OolBNXLVPhtpVyoIhKPzuI=; b=Ekizksp68Ckc3otkrt30ClAdVFlQQGHlmssJZyGB6iaNArf1vcx88XX4qTD8IODmPSWBKEsbtQ7bKBCRLGlrqJaxcSod7bXXnFB4ZHRTHQOx+w87pE0/M7p0I+K4mfYknwJkehAGqx3OQqkhbT3QKv1o3JPn+hrXjUN/PV0Vqjw=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1fk8Z0-0008Ce-0N; Mon, 30 Jul 2018 15:50:18 +0200 Date: Mon, 30 Jul 2018 15:50:18 +0200 From: Andrew Lunn To: Quentin Schulz Cc: alexandre.belloni@bootlin.com, ralf@linux-mips.org, paul.burton@mips.com, jhogan@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, davem@davemloft.net, kishon@ti.com, f.fainelli@gmail.com, linux-mips@linux-mips.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, allan.nielsen@microsemi.com, thomas.petazzoni@bootlin.com Subject: Re: [PATCH net-next 10/10] net: mscc: ocelot: make use of SerDes PHYs for handling their configuration Message-ID: <20180730135018.GF13198@lunn.ch> References: <0ce1b3e8466064741dc6e484f87bbe48542cb978.1532954208.git-series.quentin.schulz@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0ce1b3e8466064741dc6e484f87bbe48542cb978.1532954208.git-series.quentin.schulz@bootlin.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 30, 2018 at 02:43:55PM +0200, Quentin Schulz wrote: > + err = of_get_phy_mode(portnp); > + if (err < 0) > + ocelot->ports[port]->phy_mode = PHY_INTERFACE_MODE_NA; > + else > + ocelot->ports[port]->phy_mode = err; > + > + if (ocelot->ports[port]->phy_mode == PHY_INTERFACE_MODE_NA) > + continue; > + > + if (ocelot->ports[port]->phy_mode == PHY_INTERFACE_MODE_SGMII) > + phy_mode = PHY_MODE_SGMII; > + else > + phy_mode = PHY_MODE_QSGMII; Hi Quentin Say somebody puts RGMII as the phy-mode? It would be better to verify it is only SGMII or QSGMII and return -EINVAL otherwise. > + > + serdes = devm_of_phy_get(ocelot->dev, portnp, NULL); > + if (IS_ERR(serdes)) { > + if (PTR_ERR(serdes) == -EPROBE_DEFER) { > + dev_err(ocelot->dev, "deferring probe\n"); dev_dbg() ? It is not really an error. > + err = -EPROBE_DEFER; > + goto err_probe_ports; > + } > + > + dev_err(ocelot->dev, "missing SerDes phys for port%d\n", > + port); > + err = -ENODEV; err = PTR_ERR(serdes) so we get the actual error? > goto err_probe_ports; > } > + > + ocelot->ports[port]->serdes = serdes; > } > > register_netdevice_notifier(&ocelot_netdevice_nb); Andrew