Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2458377imd; Fri, 2 Nov 2018 11:45:18 -0700 (PDT) X-Google-Smtp-Source: AJdET5cwDIn61R7cnXlH5EAEj+gVV6KH+ZPVwZXOjY14hRkW367ib7vBNXz/xAwl87L+l0Gh9RD+ X-Received: by 2002:a17:902:a717:: with SMTP id w23-v6mr12663917plq.24.1541184318498; Fri, 02 Nov 2018 11:45:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184318; cv=none; d=google.com; s=arc-20160816; b=nD2fpmOefs8cFbjmvvqbt1e5RAuQDHGBKbITwiBMc6lRFhUwC49M2xtTFmmzeHdYpb dl8jWtBtxX11JnrR0g6WPUr/uiqK83V+1Do9h5ef3W2q5h391cooKaoG3bklawvX4Khg 5oGQg/9QhO4mKPCk3Gx5x4pXNpaxaq2rYn/nwEm5YfhFtGlKo1d7BA7XO9ZRXUV0+dDk MbmUrPdTX83Fk1UpnWhBg1IQ4ZAFz4XijQxMf2HvnX9IBLVlBq/1x0Ff0qRg6zWI8mAa lXvnPVDXynROZ4bTmvQ2IqD2jLPK3bkqRqTjOxvz/a8GNJkNTxDIW/UrpQNDgst8sCHt u7TQ== 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=C4hoASNpChYHh1QUohiqFiWKDOLtnEAbARpPDuO5umo=; b=fJ8hIdnWJ2O8ZWinkxqmITyCS3vWNo76ToAy8bkGHZAK+4SU84WiU6r8487dXBk3l5 wonS9z2555e0QFJHzs89bDu1UURMSOKUNWmht4DlgS8ujqQ7kxE3Kit5eOj3HmXgIeKf gDLbh99z0QMZLTEMo2cOtxD3Twzz/PKnm0s7xyEPsj2l6Nc81ITgNgYbkIjDGRDT3WJb PoRddw/dvz47dqgqNPcGWHkVpFMNOxbhfxwtqbPoUcX7KsF2OFns0sehdpmsVIkbpwVT 1mB/rD20LtbjIkCmuDdzhf9IjklQ/O0XBdSclFoXSrvlSYPn758kO25D+ku/SELwmiQx mfwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YAjmu+xV; 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 z67-v6si36619497pfz.5.2018.11.02.11.45.03; Fri, 02 Nov 2018 11:45:18 -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=YAjmu+xV; 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 S1730007AbeKCDwO (ORCPT + 99 others); Fri, 2 Nov 2018 23:52:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:47544 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726849AbeKCDwN (ORCPT ); Fri, 2 Nov 2018 23:52:13 -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 75A832084A; Fri, 2 Nov 2018 18:44:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541184241; bh=/onpXZFavm8KKCIrTGGj1/B3r9wvv1K53uZevfI9Rnw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YAjmu+xVlDTbuNIJKoxihWgyhAQoHPtyesx7ja8ve9PJZqZF+bOCa8MdjkdtFQlAC oF8O5LkSnp5ylybroaAlBWiUs3WT+pBoKaqkZe/1oVio5Vxz+mCfuY/Sb3SuWA1IIV 2qP83Obhxy1ugeukq7N/6TMZo4KsbD61A8t1A+nQ= 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.18 113/150] net: stmmac: Fix stmmac_mdio_reset() when building stmmac as modules Date: Fri, 2 Nov 2018 19:34:35 +0100 Message-Id: <20181102182911.037582613@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182902.250560510@linuxfoundation.org> References: <20181102182902.250560510@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.18-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 @@ -133,7 +133,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;