Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp19328imu; Thu, 8 Nov 2018 14:02:04 -0800 (PST) X-Google-Smtp-Source: AJdET5eRcB6G1YS2jkdYz0+GNVpJar/A4aN7n5qD+cOBQR/ud+EcYTzc82I0ZZBlbedrkTZzvJ1A X-Received: by 2002:a62:302:: with SMTP id 2-v6mr6457678pfd.135.1541714524094; Thu, 08 Nov 2018 14:02:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541714524; cv=none; d=google.com; s=arc-20160816; b=UFKsXuy2zQTDXBd4iBVKvd6JZ6yavIGZYjTMcc3BjCV12DphZfu8xfnraWGqcLb1aQ oTs2EIgQf4jNLCdmT9WpVIWe27050IG1JDCutMjNGBEz7cq9HQEsmwadJo3v/dQWIqem eQMUuZtVu3PaVAe6kqHq9U5wd9A+HD5fl9X0LNzxF3Y6LU3vUEkRuj9hEFzfRfsg28nk PIvsn5VWxh/dl6NJ9YF6pzNNaXs7YImb1RdPynhOPzsr0eayhdi3aD8d0heB5rF2x9mh EvLQghVGfNepSpnCxwiEzBkrAmubv/Fyl2U50LK2VdMQOdziQ6BaTpDnwGZmfVaIKVRi gqkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TJlNJDOrBAN7My2elUozjNgn/WXEAs+mi6Cpli/DXz4=; b=LgsBZwQbBVd9Vv0lasJHnLzaB+d7kfHwJOOBshrE1ljZhlI43r5l4bjMdf4FU7kcOD PZ3GUvhwnWQgPeb7kOci4aUO0JZAWSQOwx6tk5iHMQk97g5QM9wr65S/YTu72pNfB7KS eErP9MA1z2cRQ37aLzA+q5g+037lJn+mjqgiHwhwTu9b2QSY0aSzc1yfTA21t16DqlEg GcSTQ8rSCMN1liXNNyuMBicaFis4xrOJmvj3iZDzZwaIRPPHU443eb6ei5Kc/BUV8Hqr jTmIUjitRwLUbZKRYagEzrbqW91zLVU4nBpc2rsvyzlZI6obVjyi6Qatn57/n+9jP/+D 2aow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vuyo3Szt; 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 a26si1416469pgl.282.2018.11.08.14.01.49; Thu, 08 Nov 2018 14:02:04 -0800 (PST) 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=@kernel.org header.s=default header.b=vuyo3Szt; 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 S1730660AbeKIHiQ (ORCPT + 99 others); Fri, 9 Nov 2018 02:38:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:57376 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730637AbeKIHiP (ORCPT ); Fri, 9 Nov 2018 02:38:15 -0500 Received: from localhost (unknown [208.72.13.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7DEF220892; Thu, 8 Nov 2018 22:00:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714446; bh=omO1MNnFv04BiBcxmqsDAhADljrf5rY1053OQH0JbnA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vuyo3SztD4VD4WTc71HUkOLl4L5yibbJV41MA0O62d41aH3zkMMFXZrMa3RIcGlf/ xYHhsJT81149462Q2x06KKpPdpNoRul8MX2ylOdNLY0YK1mqRXeEzJVl5b4tIfvNIM BQVA7fDJeRPEjanMFgaY7zjMlrprjtoRfaaSlm/M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Niklas Cassel , "David S. Miller" Subject: [PATCH 4.4 095/114] net: stmmac: Fix stmmac_mdio_reset() when building stmmac as modules Date: Thu, 8 Nov 2018 13:51:50 -0800 Message-Id: <20181108215109.325204104@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215059.051093652@linuxfoundation.org> References: <20181108215059.051093652@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Niklas Cassel [ Upstream commit 30549aab146ccb1275230c3b4b4bc6b4181fd54e ] When building stmmac, it is only possible to select CONFIG_DWMAC_GENERIC, or any of the glue drivers, when CONFIG_STMMAC_PLATFORM is set. The only exception is CONFIG_STMMAC_PCI. When calling of_mdiobus_register(), it will call our ->reset() callback, which is set to stmmac_mdio_reset(). Most of the code in stmmac_mdio_reset() is protected by a "#if defined(CONFIG_STMMAC_PLATFORM)", which will evaluate to false when CONFIG_STMMAC_PLATFORM=m. Because of this, the phy reset gpio will only be pulled when stmmac is built as built-in, but not when built as modules. Fix this by using "#if IS_ENABLED()" instead of "#if defined()". Signed-off-by: Niklas Cassel Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c @@ -130,7 +130,7 @@ static int stmmac_mdio_write(struct mii_ */ int stmmac_mdio_reset(struct mii_bus *bus) { -#if defined(CONFIG_STMMAC_PLATFORM) +#if IS_ENABLED(CONFIG_STMMAC_PLATFORM) struct net_device *ndev = bus->priv; struct stmmac_priv *priv = netdev_priv(ndev); unsigned int mii_address = priv->hw->mii.addr;