From patchwork Wed Oct 31 15:08:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 149839 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6909571ljp; Wed, 31 Oct 2018 08:08:48 -0700 (PDT) X-Google-Smtp-Source: AJdET5cCy9Juhaxb9ChocsclwNRo7yH/4Dwtxn1qt9NDahPJDV7cjrN0YqIzM6TsmQACCIwNl+O6 X-Received: by 2002:a63:5b1f:: with SMTP id p31mr3578904pgb.56.1540998528625; Wed, 31 Oct 2018 08:08:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540998528; cv=none; d=google.com; s=arc-20160816; b=hdOm98nspnhL8RgSa45ZVvXbnIpgukSsUmXjmjq9SsN++K9k8kr+yT1FWNjnXfC7hd 24ofrx0oMwDr/gs9LmTG1uu/e2VBs3RBtv7gGe7AarHtU54+EzuGXLgJC72xuHPG14pP rVc+lUumeZxWl7XNwJcGtaCe5Qd+/BEuV4/gTSO+vuB6dPBRP2WWcehids4vvyUawM/l hZSaZMr0ZibWR8Hau5gTktPWTOia9Wr169n/NOsS7ILUPllei/ky7S2zB3dF92Qff17Z ZTl2C9LT/pz66vInoedEs9G5unkgGQ9xtSwsm4QyjnrVgyICVnG/seoJKMczXRFCeHxD oidg== 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 g1-v6si28167424pgk.593.2018.10.31.08.08.47; Wed, 31 Oct 2018 08:08:48 -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 S1729570AbeKAAHJ (ORCPT + 32 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(-) -- 2.17.2 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;