Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp15625imu; Thu, 8 Nov 2018 13:58:56 -0800 (PST) X-Google-Smtp-Source: AJdET5e2x8a8znGIfaMoxDeypwfhEX8IDKhWNthqSwUVEjf0gGwJkJFyyS3kYXMDfr869V3x1s/s X-Received: by 2002:a62:1bcf:: with SMTP id b198-v6mr6361991pfb.102.1541714336928; Thu, 08 Nov 2018 13:58:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541714336; cv=none; d=google.com; s=arc-20160816; b=o2ez0bIU+nGLA3H151I9ZXtxLfKv2foGUiYAknXuTSRBk0UBi2a9dxs0h3zXXx8ZFS HZlYtpDkzFt1JHfyW9P1NETf958SnyT1dIGyV9UFL20uFzSU8CVDME1OQXflmiSEd3TG 32B/dVuTf17G27TAg62dtfihEie1QBrR42bsCE8qNHvtA3k88W99jHJBj7Ty8Ghvq7SN CCXMEgsEGyEf3EE5wKF455lW9KSuHcl28CbERrWuEjT6vPecj7RCaaJ25DjJZMhPHnG0 0CgLIcPMADaGv2NkFCjkPGw29zrg+4ioOyK5mxDbM7Wtw/zRAXOr7a2QnRujIeIU4Lc1 opwg== 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=4Yo8QVxiTcdP5aGlqJ4keTxR0vjwmhud6sMMG+r6FrI=; b=YSrrvwLQ7YxJFSD6XSAOLeFl7LCyoGvFKCStBf8wqonHhCYrf0m3swvKk6MzI7+Psw h3vYYYzzgOUXPX9vYAXvdQI4M4mJ1Iv1q/GuYTWOiZsAqb/TiFe0SHfB1q6N06vbyZrf zsUt4jNTqvGP8TR3iqmjXdTi9Vu70x44BMienhphuBA96PMMfLyUEphIfDyH26LFrrfF uShAgLrF2qjMdMxKVOl6R37o0GiMgXiJfrtRyNgub3h//00nnk20p/3Cy5J2whFxrl86 PYWcND7bgbPqF1hLVi9RXwVVk9hCCM6MPUfEZA0PYMLS2meS7SBigLjXMBaOcL4SEyoe Pm0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uPhrYUX7; 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 y16-v6si4202273pgk.479.2018.11.08.13.58.40; Thu, 08 Nov 2018 13:58:56 -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=uPhrYUX7; 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 S1729504AbeKIHey (ORCPT + 99 others); Fri, 9 Nov 2018 02:34:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:51662 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726926AbeKIHex (ORCPT ); Fri, 9 Nov 2018 02:34:53 -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 04A5120892; Thu, 8 Nov 2018 21:57:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714246; bh=P+XincvhNiBJAnBkfNKN8RCgVqjHBcQ3UENCtBxOItc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uPhrYUX71yCR/rhmRKQEZnjNK6WjvwsCNU30PrB7WPkBA5O0VwttPDsENHAjH9XuD qST/ltDSzoVDjZsCRAFM8DrcT2cXLBT3wtteGWdJ4t0ygqwumUxIX6lqTj0/FOdCY6 lTLD6XhebwfeUepiCPLYg9FlEKJC5vf0MjeuhWns= 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 3.18 135/144] net: stmmac: Fix stmmac_mdio_reset() when building stmmac as modules Date: Thu, 8 Nov 2018 13:51:46 -0800 Message-Id: <20181108215107.948524184@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215054.826084593@linuxfoundation.org> References: <20181108215054.826084593@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 3.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 @@ -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;