Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932870AbcLHQga (ORCPT ); Thu, 8 Dec 2016 11:36:30 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:34172 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753709AbcLHQgZ (ORCPT ); Thu, 8 Dec 2016 11:36:25 -0500 Date: Thu, 08 Dec 2016 11:36:02 -0500 (EST) Message-Id: <20161208.113602.193796703301981430.davem@davemloft.net> To: niklas.cassel@axis.com Cc: peppe.cavallaro@st.com, alexandre.torgue@st.com, niklass@axis.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RESEND PATCH 3/3] net: stmmac: stmmac_platform: use correct setup function for gmac4 From: David Miller In-Reply-To: <1481114469-4788-3-git-send-email-niklass@axis.com> References: <1481114469-4788-1-git-send-email-niklass@axis.com> <1481114469-4788-3-git-send-email-niklass@axis.com> X-Mailer: Mew version 6.7 on Emacs 25.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 08 Dec 2016 07:36:43 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1174 Lines: 29 From: Niklas Cassel Date: Wed, 7 Dec 2016 13:41:08 +0100 > From: Niklas Cassel > > devicetree binding for stmmac states: > - compatible: Should be "snps,dwmac-", "snps,dwmac" > For backwards compatibility: "st,spear600-gmac" is also supported. > > Previously, when specifying "snps,dwmac-4.10a", "snps,dwmac" as your > compatible string, plat_stmmacenet_data would have both has_gmac and > has_gmac4 set. > > This would lead to stmmac_hw_init calling dwmac1000_setup rather than > dwmac4_setup, resulting in a non-functional driver. > This happened since the check for has_gmac is done before the check for > has_gmac4. However, the order should not matter, so it does not make sense > to have both set. > > If something is valid for both, you should do as the stmmac_interrupt does: > if (priv->plat->has_gmac || priv->plat->has_gmac4) ... > > The places where it was obvious that the author actually meant > if (has_gmac || has_gmac4) rather than if (has_gmac) has been updated. > > Signed-off-by: Niklas Cassel > Acked-by: Alexandre TORGUE Applied.