Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp6195453imd; Wed, 31 Oct 2018 08:11:12 -0700 (PDT) X-Google-Smtp-Source: AJdET5fhqO3bXfqGgERweOXXd+5zszUJI1a59ViiNceIvn1MChXhFeybfXw3xMjeaMScXcKfLv1d X-Received: by 2002:a17:902:74c4:: with SMTP id f4-v6mr3910865plt.52.1540998672429; Wed, 31 Oct 2018 08:11:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540998672; cv=none; d=google.com; s=arc-20160816; b=RZ3aptV/TyMQPGAEqPhsViKbWcTtD1d1WMEImo1VSDeqmCjMyjwnK3VUncbaI+ZGI3 d2KKh24wFqPYFzoY/NxQ24dAtauMjS8V2vrEFOfWbNu+vYy1Q+4juoXXYMJG17zsiuuA LTgpyv7skfH6eSnm8iyWh6jUmo9xN/LcdYHPl3HfGtQeFxXOATnzy21Zf/yvrabFf18r RORlzdIi38T9UxeVE3n7/c/RNdUFDnE1rdIobLG4ylaHtKZzWgls/MFnR72KYQPCmWHB 8M58pEOBn0CWD/cVWKIPxuS3vQGzVvc1btZX0PffLXOg68C2dKjMOT9UGQN8EHEQUBmg ipVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=e5frE0WJ4d8tX8keWMYH6dLS7V4PumD0YzkgOc87U20=; b=w9B2FpaZVQC1mJtmnSrqGiaIIxsUQHBBjsytxu3r2IUeK92iLL2Q4gyneW96hml6Ae X2nYVfOPZPOp3YEhQpgbiKslBUWEgE7xMy0PF1kWGhnTo3juCJL6OQwJXdtefezencMw w3mgH0fergPQgaPuUxbRJy71qnj07K2+Lf+VR5P47woIPNREqvui/hAF1CJ4KlG9BCDY +W1T99+2SOUEV2pa8iNyxJwi8cewbUUE1E42fuKOM8RZPvi5nA6/D/Y+3tKqfUAcF/5u 1vWMYpuqjCb4qzI8c3GDe8qq9AWrvKq/IYJ0dCFzckwHiWgA8lBxQVclHnezGc8jbRVX C2/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Gg/Hcy5+"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w23-v6si25280066ply.101.2018.10.31.08.10.45; Wed, 31 Oct 2018 08:11:12 -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=@linaro.org header.s=google header.b="Gg/Hcy5+"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729382AbeKAAHJ (ORCPT + 99 others); Wed, 31 Oct 2018 20:07:09 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:39505 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728857AbeKAAHJ (ORCPT ); Wed, 31 Oct 2018 20:07:09 -0400 Received: by mail-lf1-f68.google.com with SMTP id n18so3575606lfh.6 for ; Wed, 31 Oct 2018 08:08:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=e5frE0WJ4d8tX8keWMYH6dLS7V4PumD0YzkgOc87U20=; b=Gg/Hcy5+noTBg1aPXPBql0TGm7aVmka1GfD/Vo1kGojY3HYsyfUiMfv+eIu9vjJktQ Ir2zVFwFOpaV0lnm5scoV1NYnHpmMZRJxL2HyHxYIN8tDXxS/R3YDz0HRijxZfNMyeto fEb7F4H9J3SApKheQiC1irCxjobJGVbzQ8E9I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=e5frE0WJ4d8tX8keWMYH6dLS7V4PumD0YzkgOc87U20=; b=bW5cnA8U5bL6u/qw5CZFqZ8AmY9NjpUwDBT1HRb1qp+3RKJD3X500smSYBbZMJmdNM iWjK2H64r1jj4YjsBikiLcybhyb3c3ybykVVJk3+L+bkIBXJ5LVxARXQc2IMdw0ly5fD fzpM8EJjU2/+cEUppGeBa020JjovMJ928rrxkIWnzNxgauzw9rbg3nHXlYonDhwzI0OV d8g4iT4hhz/NtjEghL10XGi4n0lZ8GlZOI9hCVwJ68+jIFJdldiXaSJCovp5tEjbdt0K 0grTqcS76ypR5XcrE+qxoO/zdy6sJ7Q8dTJGTDOgE7igx9dKgeern8wC3Czgxz+gnUtK /m/A== X-Gm-Message-State: AGRZ1gJAK6IB6FnTGav1rDGnJb/1hmIEJB3V7Qb+XPFsfUk9mTAvVNCd RYr55StLTHlkSAWgZ4KTPUKv/w== X-Received: by 2002:a19:d145:: with SMTP id i66mr2158515lfg.97.1540998515293; Wed, 31 Oct 2018 08:08:35 -0700 (PDT) Received: from centauri.lan (h-229-118.A785.priv.bahnhof.se. [5.150.229.118]) by smtp.gmail.com with ESMTPSA id o72sm4281690lfg.33.2018.10.31.08.08.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Oct 2018 08:08:34 -0700 (PDT) From: Niklas Cassel To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Maxime Coquelin Cc: vkoul@kernel.org, Niklas Cassel , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: stmmac: Fix stmmac_mdio_reset() when building stmmac as modules Date: Wed, 31 Oct 2018 16:08:10 +0100 Message-Id: <20181031150810.16665-1-niklas.cassel@linaro.org> X-Mailer: git-send-email 2.17.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c index b72ef171477e..bdd351597b55 100644 --- 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_bus *bus, int phyaddr, int phyreg, */ 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; -- 2.17.2