Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2452183imd; Fri, 2 Nov 2018 11:38:19 -0700 (PDT) X-Google-Smtp-Source: AJdET5crwDyA4uymCJXadEdsUR4GkwSaoqluVfILDVQtjQu35RZQAQeufzBPc14lWiNewMcgG6CK X-Received: by 2002:a17:902:b943:: with SMTP id h3-v6mr12047384pls.124.1541183899672; Fri, 02 Nov 2018 11:38:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541183899; cv=none; d=google.com; s=arc-20160816; b=SiTZxUyJ0fwGsTzu+jCLKAU9fQnz76GmLOhgvy3WIjIIKKqswo+sumBrTtK+Qv4w8p MNctOud6vuetgEN1LspH4TDkWKp8kdVe8Uig0g+59cAnj94g69uu9ADMpKx5OdkTfZcH kXrvfv7psPWdRi9qHpPuXUTHkp9WxPwgpZ0njst4oZ9x1j4lYu6TXg+sKQGXn0HqvrId 16Jb8ar4xfZhOT89+oWqnwtKYXbjglH5puw4yolKuqPPkXVJLUYSbOOAT5haUusQCIz5 Rvo1nCZXIv1ToSly2DhcfkgEx/bU5mQQDt/RTd/lkzHc3pmB5plHAEKdBRHBPhIYmL/b XFCg== 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=+eYcCkgpxxMkisSmExSZM/RRPFFbiIDj7I1bZNLOkQo=; b=vrqtMTADW1FT3zEUhN7RfdbV0wriUoxMWno7cJIh8Vr10hxyOiJUMt4EZLqwpZcV8B 1fBFez5EN9g42GoKAXX7lSM0XrvB7sLyK8KtBqJKXqxD3bVK0XjTJFJ8odMy3OtQihve iH3w9pXzc/VFwwT4WfRE/0InDn8499q2ncGB2gIKidjJ03ffJSwLEpmXB6pTV80HHwXI JVITJNrtenCnpOCrzOPia9kWECqJ0Z0TGCZAHlxRK38gNjTU5VxvNUtj0HbHNzBiIgVv cMK7KhqBxFNY2OXlHGHzw6GbfTH1QhTijxvi/e2gUDF/5cfTNzWIQuhEIp9xJ2hcUeaB zCsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ygVv6Ol+; 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 z5-v6si4242613pln.42.2018.11.02.11.38.04; Fri, 02 Nov 2018 11:38:19 -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=@kernel.org header.s=default header.b=ygVv6Ol+; 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 S1728536AbeKCDpV (ORCPT + 99 others); Fri, 2 Nov 2018 23:45:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:39114 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727556AbeKCDpU (ORCPT ); Fri, 2 Nov 2018 23:45:20 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 50F8E2081B; Fri, 2 Nov 2018 18:37:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541183829; bh=gnS0+UhUOOGhEKtHoOdGhEahidJQST9x3mp3YbJzZHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ygVv6Ol++ZQVf0D8lKAPvt+okQapdO8t2/kAiCMPyudjIYcx/BDI5kH9UTD87O/v3 5tpzL8gqFR6YHR5w8YSLWfS/qIGZQZw8ZzpiGnB5PXXZnLQVuhZN6ZJQMol9LYLhID yNXjrbs6HJLqFdKxV+EISlCT7o8H0jkhp3h5iv0w= 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.19 05/24] net: stmmac: Fix stmmac_mdio_reset() when building stmmac as modules Date: Fri, 2 Nov 2018 19:34:38 +0100 Message-Id: <20181102182840.569386700@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182839.725385066@linuxfoundation.org> References: <20181102182839.725385066@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.19-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 @@ -243,7 +243,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;