From patchwork Sat Jun 15 10:09:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10997055 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 654DF13AF for ; Sat, 15 Jun 2019 10:10:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FD2B2877B for ; Sat, 15 Jun 2019 10:10:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F39F287A9; Sat, 15 Jun 2019 10:10:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E25652877B for ; Sat, 15 Jun 2019 10:10:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=juM7ccjxn/5IbFa7ASq/L2xYMMafKpf7X0YCssZdB1M=; b=PnmZFvUJqXMhyh Bk00lA1MaJ/4ZVoNjuh8t4zr0sPPRvBYZntiklaSwPMqOdIH+/ZUpxBQoPbFwEm6DRqLYQvEAnt3x MC6V1XRQBDtBlehbeZDId7Z6cTe1GMVoIIiUO5JC72RuelKwEVUmTy4vagAaJMhrEVaGtklzRKnJh UENkWhVeyf6stf1wuwuZmuWQdNLGOi2acKY2YxXQT+2RSJXogtuuTI2il0NtW2EuMFRDYhmRjN3S9 HFjU7NQhPnnjb3fS+EgXnbFWvyBiWbADya+jznq94O95JnKS68maACgtDhjzoEw9PC43Bam5p6bzd XIDulx8+lhMfmCnOzQ/A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hc5dS-0004Va-G1; Sat, 15 Jun 2019 10:10:10 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hc5d2-0003Tw-Ej for linux-arm-kernel@lists.infradead.org; Sat, 15 Jun 2019 10:09:46 +0000 Received: by mail-wr1-x441.google.com with SMTP id m3so4996508wrv.2 for ; Sat, 15 Jun 2019 03:09:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TU5sPWxUXVpDKkXIHMQHJv1/QjLj/w4ResWwHswsQ9k=; b=q81b6gQfj2ao1vMnyoQZgvyXuRVm+nRF84Z4NPNDtAifoi/Yds9AbbXmST9oPrQNxJ L0ObMFgHifNglFniPaYe94xkfWZ6qQaOST9bYl1e9Ayf6gwzkYQ/hxWHkJvpH6uVfHV3 D4p1mG0AJUyq2y12T1gCO1lCH9qfjmOT4Y/V5Ew4L+dqDF4g1OIPaWF5A3+9QnQ8vT0Q fHx+Uknj3PAygSVc90vpZ7SNvkxpKOQv9E3pNE+YtXjhyy7rOAxOzzEHZQjUVnTbjeD6 BCAeqRCaDVuoVlkgpSgxMmXe/yNwCw7MFqnzQh+3ospxDwTv4XA6xBDzXQwufGJAjqxB Lgbg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=TU5sPWxUXVpDKkXIHMQHJv1/QjLj/w4ResWwHswsQ9k=; b=Oj6GoUJugXL5e1WvoH769bg5xZiI2Ym5u725sJt1OfnfKUACOcv3qGhDkJ1Ix341Yh R84p/XhnDgPH27zhmqK9Hotj+eodwToEZCxxEVWruTjs9DZ4WcPc7Dx9h49SwV+rEQWT IiaF6+w8YEmvyxXFobpoiJeb6OObFDfbcsxz1Qq22LuUHpWik/1ZqP2byz40so23dfh+ 7KXerUqxJZ8AsD+9H1KGs07M4p8xdVaed1iKFh6Ueo0O0rjaw0oYSb1ivDiA9dxlw3vw cH52ZIcgfQ4tx9CyQBW0mMPqmKdmYWvsw09t9fk5/4J4TBU07Nr+d/Z0vGhmEvkzae/u lIhg== X-Gm-Message-State: APjAAAXoTqotdcV7nNONUbeZ7UVsUF8/jn7lY547bjD3yKmf4bcdeyQN XGjE71wAtsgkZ3qGC0T4DIY= X-Google-Smtp-Source: APXvYqy2T6u5Bo9cJYCElKkMVr2UauJqohfFkH8EkNhL0wrkkh3Ih6tzMAnD1ivvjWgec4OC5yaLDA== X-Received: by 2002:adf:e84a:: with SMTP id d10mr3190321wrn.316.1560593382566; Sat, 15 Jun 2019 03:09:42 -0700 (PDT) Received: from blackbox.darklights.net (p200300F133C20E00A9A405DFDBBC0790.dip0.t-ipconnect.de. [2003:f1:33c2:e00:a9a4:5df:dbbc:790]) by smtp.googlemail.com with ESMTPSA id f2sm9270513wrq.48.2019.06.15.03.09.41 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 15 Jun 2019 03:09:42 -0700 (PDT) From: Martin Blumenstingl To: netdev@vger.kernel.org, peppe.cavallaro@st.com, alexandre.torgue@st.com, joabreu@synopsys.com, davem@davemloft.net Subject: [PATCH net-next v1 1/5] net: stmmac: drop redundant check in stmmac_mdio_reset Date: Sat, 15 Jun 2019 12:09:28 +0200 Message-Id: <20190615100932.27101-2-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190615100932.27101-1-martin.blumenstingl@googlemail.com> References: <20190615100932.27101-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190615_030944_525673_D2726073 X-CRM114-Status: GOOD ( 12.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Blumenstingl , andrew@lunn.ch, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP A simplified version of the existing code looks like this: if (priv->device->of_node) { struct device_node *np = priv->device->of_node; if (!np) return 0; The second "if" never evaluates to true because the first "if" checks for exactly the opposite. Drop the redundant check and early return to make the code easier to understand. No functional changes intended. Signed-off-by: Martin Blumenstingl --- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c index f1c39dd048e7..21bbe3ba3e8e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c @@ -256,9 +256,6 @@ int stmmac_mdio_reset(struct mii_bus *bus) if (data->reset_gpio < 0) { struct device_node *np = priv->device->of_node; - if (!np) - return 0; - reset_gpio = devm_gpiod_get_optional(priv->device, "snps,reset", GPIOD_OUT_LOW); From patchwork Sat Jun 15 10:09:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10997057 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8337676 for ; Sat, 15 Jun 2019 10:10:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61B5E28515 for ; Sat, 15 Jun 2019 10:10:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50CF1285C8; Sat, 15 Jun 2019 10:10:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EB00728515 for ; Sat, 15 Jun 2019 10:10:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ol0UDrTcv885S/T6O+WqhDapV7/uOw8ow79tRtDiJMc=; b=cu7+0JIylZCnf3 Lz+N7b8UhDnpRM1dtoPoDKFqGwLJ5HKWoIhPZGzZzOPlQJseZcKKhpNQSQnfPjfq1y9FSz5SM058W 2qsXYByw7ngk/0oGPEaltSGi0u0bfTaLGWo9mEBM/zPC1HtlBAauHp5NAZbYt8yUbNUcSqlY1Huu2 8wdbLLnITNSidCOjqXKnF/TxLIPF1dz+cSbauzZr2XAEKgjRkXngGTACjkAFQ1c2B+PO6oOtKTf5y CbyOXAKaWlHEuOd7Bs1CIbyQ2NUOxitE4Jvww+SsK4EHcYKbSkNHraRVQ6/sBII9yZbuXB64qFpbU moQ405lKfiefnn+XuCBA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hc5dq-0005ID-A3; Sat, 15 Jun 2019 10:10:34 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hc5d4-0003Tz-9t for linux-arm-kernel@lists.infradead.org; Sat, 15 Jun 2019 10:09:47 +0000 Received: by mail-wr1-x443.google.com with SMTP id d18so4987410wrs.5 for ; Sat, 15 Jun 2019 03:09:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H+yWWY9tEBVeyv5Kuo7PN/KU7l8anqtZ9YKcn1BGMX8=; b=F2OUqJoOIhLqTWwNr+ox+F1uAsR57hiVV8JfO+cpLJ+ookCiS0zuXCRXK8gGWzl/+R PDY1O8QaYoiP3yvbTfWAmfJeS5rJWUdFAwG3W3e4t90qk9pz3aI1v+ccxNgXd0/UznZp QtGGlMmhaHXW/GHro/Opuc6TPNoz26ugUrr7wmtGlQ0F0t0IcySE7Eoam7Uv0i3FKZ9a z3JXpiFFPUqZ3tyoU8mwJLUv+vllWShP1R9CfI6jNEUvNc6RDfrBkjAstnbnHBw6k835 nAFOrC7gkIquBYE4lDwWQrgkuZtRGC89LOBskczxEyGhm03WUBUEnYdM7mq9LXezgZce xgWg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=H+yWWY9tEBVeyv5Kuo7PN/KU7l8anqtZ9YKcn1BGMX8=; b=QE6yf3MSHNpWYSQO2mZVgU+w3MHNC9Zct4z8wv3cS5nr9vXQ89+XdVetVS1tX50Z8M t0F4sHGNukpNnStS4GXOvImt3f3+SFqDEYvnf7ZpkIUVHfw/KjBuITXlFtWQNzSSM4A/ jov36I1Wv3utraGKPTwo2E3nChTrMQmAeI86x3XlAhAlx2M3wolWJ2VYHkAXYF6zv7vC wkd+m42BkPCUSoTdcUu+5HAe8M7p83UfjNx44QW8J5DQOlRQJ3wx6odo688z52W4Tj79 Z3opmCJ893yCWD4guOqz7y+O0WSghxRIwqEnlZWIdT7lF5UTTjwsze+7IzxNKJx+yIL8 8xbg== X-Gm-Message-State: APjAAAXLJv4uGNdyVZuci+ZjfsVylkVeq3E8/PC5LSwGkaS0i5rb2MOD 89vl+F8+Tz/S3+cfUHDtLCE= X-Google-Smtp-Source: APXvYqxLGsoHfLPnFj28nDTuYbhsnM6ZxMGBs0QlhKr1dIDBWN6DREupTQWYfM4lOTVfZ3WkVTuzGg== X-Received: by 2002:adf:df10:: with SMTP id y16mr9612659wrl.302.1560593383691; Sat, 15 Jun 2019 03:09:43 -0700 (PDT) Received: from blackbox.darklights.net (p200300F133C20E00A9A405DFDBBC0790.dip0.t-ipconnect.de. [2003:f1:33c2:e00:a9a4:5df:dbbc:790]) by smtp.googlemail.com with ESMTPSA id f2sm9270513wrq.48.2019.06.15.03.09.42 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 15 Jun 2019 03:09:43 -0700 (PDT) From: Martin Blumenstingl To: netdev@vger.kernel.org, peppe.cavallaro@st.com, alexandre.torgue@st.com, joabreu@synopsys.com, davem@davemloft.net Subject: [PATCH net-next v1 2/5] net: stmmac: use device_property_read_u32_array to read the reset delays Date: Sat, 15 Jun 2019 12:09:29 +0200 Message-Id: <20190615100932.27101-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190615100932.27101-1-martin.blumenstingl@googlemail.com> References: <20190615100932.27101-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190615_030946_342294_B0233CAD X-CRM114-Status: GOOD ( 13.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Blumenstingl , andrew@lunn.ch, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Change stmmac_mdio_reset() to use device_property_read_u32_array() instead of of_property_read_u32_array(). This is meant as a cleanup because we can drop the struct device_node variable. Also it will make it easier to get rid of struct stmmac_mdio_bus_data (or at least make it private) in the future because non-OF platforms can now pass the reset delays as device properties. No functional changes (neither for OF platforms nor for ones that are not using OF, because the modified code is still contained in an "if (priv->device->of_node)"). Signed-off-by: Martin Blumenstingl --- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c index 21bbe3ba3e8e..4614f1f2bffb 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c @@ -24,9 +24,9 @@ #include #include #include -#include #include #include +#include #include #include "dwxgmac2.h" @@ -254,16 +254,15 @@ int stmmac_mdio_reset(struct mii_bus *bus) struct gpio_desc *reset_gpio; if (data->reset_gpio < 0) { - struct device_node *np = priv->device->of_node; - reset_gpio = devm_gpiod_get_optional(priv->device, "snps,reset", GPIOD_OUT_LOW); if (IS_ERR(reset_gpio)) return PTR_ERR(reset_gpio); - of_property_read_u32_array(np, - "snps,reset-delays-us", data->delays, 3); + device_property_read_u32_array(priv->device, + "snps,reset-delays-us", + data->delays, 3); } else { reset_gpio = gpio_to_desc(data->reset_gpio); From patchwork Sat Jun 15 10:09:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10997059 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 25A1A76 for ; Sat, 15 Jun 2019 10:11:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E7082877B for ; Sat, 15 Jun 2019 10:11:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F1D12287A9; Sat, 15 Jun 2019 10:11:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 91B892877B for ; Sat, 15 Jun 2019 10:11:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Z6hucd6g6nC3URNZeslg1K865W5pFWDznuLNGf0t+To=; b=q7tb9PniasXatF uJ199H+J/5b08WpanvgyWNqjHBXHvgnzEo7xPDaqqXa6RCGYnnbb2hCabjZwQfvIcLoGZFpOg7fzH 16tnUGtRDf8RwEtE2xLslnl6jNh04HhPBuIShoTLR7SUKp1UaaGdfS2Jh0FSysUgi802rRQWPhbPU mzeFD8IOfnBZTZlA2FW0JRsHrSQXkJYN1nvuCBmILJjP1zHWeCwI7WNrwTWG74r/GmuQwLBM0nwVD fFDQiesXsw3LHgDQXjwlWOo5wrxtI8o1cI+km2qp6k5D1lZXsA1Nz+9G7wee1CjGXQBvIjqqYMIyd NQKOtHuA7O0ZACR2V5hQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hc5eA-0005eS-87; Sat, 15 Jun 2019 10:10:54 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hc5d4-0003Ua-J3 for linux-arm-kernel@lists.infradead.org; Sat, 15 Jun 2019 10:09:47 +0000 Received: by mail-wr1-x444.google.com with SMTP id d18so4987431wrs.5 for ; Sat, 15 Jun 2019 03:09:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bZFU7NFpVfVeHlWdzqsP9W+7pyjV+Qkejc+qbCNG2JI=; b=kS071LzwgDU6YqnKn98IPviy/GgCUK0RM+EhTYLxlVneNva93160H8wS+XdNcNfRoR rylBQviUW+BOLyLwgO+Y/eD1tFldIBZnj5CSu5t/lMErK7NwsGNaQFYkDMidrz5MeNJD l4e1JC0QRccodXh/5TuRuF7Y/zv8ASzHjQBdOEqDvuP0dpYy1yCCYKclsnrM15ibmpR1 SyEMoSQg/HiT0nD/lErdb0jRfRUTB3xlvwEEPPEeig+HV+a2PZSaSRdRKZ2BmGRDtp+f TCeaxMbpUGV8cSq7zugSmcBvgn35AbExvvonMeS6BE11STmktZQv9DKDCjsFYcdIi2KC uREg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=bZFU7NFpVfVeHlWdzqsP9W+7pyjV+Qkejc+qbCNG2JI=; b=TGWenFRbdNcCaJiycF2Kwan5im7PHMVFyPedshxgp1N4OM5JYEU05+4YbUtwBWwPhD ZuUlvXh2Z3iBpPpRTMiuTF+Hr6kSzsgYeHgH/AOQ46WEqggVlGqOxtc8nTL5bcaoMhEu A9NpPmgrZetLMjhGjXeZhnGjiUTV3lob/bJzZl7aeL8HJbbK8viD1CybP86sYrsO+7r4 N+eq5kqabSLZhvS21jLfhKIsz6l1riggb+rI8BMK6imaDKW2GsxpIFuhvDrCSM8o+1fL zxddLRn5PszbnygmfM0ikxTuHJ5njOH4NRdUMdy81lCVY3ck59whZT97grSqAUkGl/n3 GxpA== X-Gm-Message-State: APjAAAXv4lmWC6028GbzrwOCqOmX0C6TNvoU2N/muHfOMWAABXSPpW58 6+2vcPCK9K6dTAK0dVuNEXI= X-Google-Smtp-Source: APXvYqx0/fov4P+lnmI2fLd5hg9jAgZR94PgXgj/0RSR6XIrP2w7HMaZ7iddBld9yhXqDa6274scSw== X-Received: by 2002:a5d:4001:: with SMTP id n1mr51838065wrp.293.1560593384926; Sat, 15 Jun 2019 03:09:44 -0700 (PDT) Received: from blackbox.darklights.net (p200300F133C20E00A9A405DFDBBC0790.dip0.t-ipconnect.de. [2003:f1:33c2:e00:a9a4:5df:dbbc:790]) by smtp.googlemail.com with ESMTPSA id f2sm9270513wrq.48.2019.06.15.03.09.43 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 15 Jun 2019 03:09:44 -0700 (PDT) From: Martin Blumenstingl To: netdev@vger.kernel.org, peppe.cavallaro@st.com, alexandre.torgue@st.com, joabreu@synopsys.com, davem@davemloft.net Subject: [PATCH net-next v1 3/5] net: stmmac: drop the reset GPIO from struct stmmac_mdio_bus_data Date: Sat, 15 Jun 2019 12:09:30 +0200 Message-Id: <20190615100932.27101-4-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190615100932.27101-1-martin.blumenstingl@googlemail.com> References: <20190615100932.27101-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190615_030946_624533_F510F00E X-CRM114-Status: GOOD ( 13.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Blumenstingl , andrew@lunn.ch, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP No platform uses the "reset_gpio" field from stmmac_mdio_bus_data anymore. Drop it so we don't get any new consumers either. Plain GPIO numbers are being deprecated in favor of GPIO descriptors. If needed any new non-OF platform can add a GPIO descriptor lookup table. devm_gpiod_get_optional() will find the GPIO in that case. Suggested-by: Linus Walleij Signed-off-by: Martin Blumenstingl Reviewed-by: Linus Walleij --- .../net/ethernet/stmicro/stmmac/stmmac_mdio.c | 29 ++++++------------- include/linux/stmmac.h | 1 - 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c index 4614f1f2bffb..459ef8afe4fb 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c @@ -253,21 +253,15 @@ int stmmac_mdio_reset(struct mii_bus *bus) if (priv->device->of_node) { struct gpio_desc *reset_gpio; - if (data->reset_gpio < 0) { - reset_gpio = devm_gpiod_get_optional(priv->device, - "snps,reset", - GPIOD_OUT_LOW); - if (IS_ERR(reset_gpio)) - return PTR_ERR(reset_gpio); - - device_property_read_u32_array(priv->device, - "snps,reset-delays-us", - data->delays, 3); - } else { - reset_gpio = gpio_to_desc(data->reset_gpio); - - gpiod_direction_output(reset_gpio, 0); - } + reset_gpio = devm_gpiod_get_optional(priv->device, + "snps,reset", + GPIOD_OUT_LOW); + if (IS_ERR(reset_gpio)) + return PTR_ERR(reset_gpio); + + device_property_read_u32_array(priv->device, + "snps,reset-delays-us", + data->delays, 3); if (data->delays[0]) msleep(DIV_ROUND_UP(data->delays[0], 1000)); @@ -323,11 +317,6 @@ int stmmac_mdio_register(struct net_device *ndev) if (mdio_bus_data->irqs) memcpy(new_bus->irq, mdio_bus_data->irqs, sizeof(new_bus->irq)); -#ifdef CONFIG_OF - if (priv->device->of_node) - mdio_bus_data->reset_gpio = -1; -#endif - new_bus->name = "stmmac"; if (priv->plat->has_xgmac) { diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 816edb545592..fe865df82e48 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -97,7 +97,6 @@ struct stmmac_mdio_bus_data { int *irqs; int probed_phy_irq; #ifdef CONFIG_OF - int reset_gpio; u32 delays[3]; #endif }; From patchwork Sat Jun 15 10:09:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10997061 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5664076 for ; Sat, 15 Jun 2019 10:11:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 446272877B for ; Sat, 15 Jun 2019 10:11:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 37800287A9; Sat, 15 Jun 2019 10:11:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D99642877B for ; Sat, 15 Jun 2019 10:11:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=I31IUYZ16KQtgzEYCTKfiUBccifrbwfQSNwm/9p692A=; b=WKZkjE5E0WfmWE HFU/mj0Zx28TES2LxY4jfzvzUvY+BBnu+3ud9Z+JINODRE367/Or6Fl2xRISdfB3CdvomCBIcST6b JeCTx4p0tw+z5tkmjv0hwvwmyxahic2bB1P9uVLfZWLfeDVbYjVnSsR2hXFZhlMUTxsRuQefjhHn6 TX9XPndXairBjSKf3BWBuKEKD4orV8GWQLrCAPOGOD1As0QTExSruT6y7eyf5PE8NN0Ye6HCjGBZw 2PZXNmrzAAsb8Od/a0J/3UR1vmjh/vMMkZFriisLIGvh/zlnKyP5bKn03b3XmrYl+38xMq+CKdyKz RJJp790tttysPYuivcUw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hc5eQ-0005v2-0h; Sat, 15 Jun 2019 10:11:10 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hc5d5-0003Us-Pd for linux-arm-kernel@lists.infradead.org; Sat, 15 Jun 2019 10:09:49 +0000 Received: by mail-wm1-x344.google.com with SMTP id g135so4678703wme.4 for ; Sat, 15 Jun 2019 03:09:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=21LzFx2Yc8y77IkHIvE2bMFa0+wAZqeT/XG4CmiYg9c=; b=Uci2wXZnDus0zk0ldy2dfk3d4aJr68Zw4QGrTtJh9KC/t6mdLM97KeoGnbhX0BDZp4 mCtBky+GT+CCrAmPb6CQ3WtCzlRp7Bd9iwapxtrEqSZIR/E68kybbnIb+GcsDcnyzeeH zpwELa0AKEjwI8ChQ4ZuUIuhaHIGEs5H2TLn0aZu8bEJOjsIsyDtjaeXwJEqUfXieS7k At7tBj6NYhOwKcQm25Ft+x1l2BQgK16tOjck+Qnx/jf0ZDLLLhAtv6SgS5ylI0uDLeyA PHFr6f7aBVSaDPS6JmhjADnFyp7rJIq5as2BAIo+i/+7/I/A+y/gz9ebD91fo6lIx5x5 XANQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=21LzFx2Yc8y77IkHIvE2bMFa0+wAZqeT/XG4CmiYg9c=; b=Xp19ZwtQeKCIygHK+dsRGJyknTZGbfmOyyp4XDB/x6jDIqb+NBgLmDfDFibjZCoWOB 6H8pBR7CC+4CHxk0G+h7+14MmLrQauj6YnliWLon1G9ivbLd+JQ82xX5kEF9eDGEJk0/ 0knjrw9JQ3RMgu2UQUL819qXsFcbVbaeT4iw55uC0x9Ua+x6K96gL8UyRFklIUEi1CaX jWIF58zFtJN/g5aQ4s1Cs5JrVx6R1Ky52kOkZAms+Ge3wlwZFXEmtI+koEbt5cli/V95 Q6UXiGornxS7aBGytMNZ1Vov/eTXuwstvObmMLg/nlb+MiLc8dkVsFfWb5Vs7r2QAt1n 3NGw== X-Gm-Message-State: APjAAAUucTWCZuE4cbaKmNMQlApt9HekOD+ZzljMV0i5X8aLCbc+demE heDbBU4G8HJ4ZCe0fgrjw+M= X-Google-Smtp-Source: APXvYqzPm8dHyxHlzfDDjd2ma6Gj+6tSgX08AW5n9xYFU30GEctIRwfe1P7qrO8HGdN8b/koJ5+c5g== X-Received: by 2002:a1c:cb43:: with SMTP id b64mr10850812wmg.135.1560593386042; Sat, 15 Jun 2019 03:09:46 -0700 (PDT) Received: from blackbox.darklights.net (p200300F133C20E00A9A405DFDBBC0790.dip0.t-ipconnect.de. [2003:f1:33c2:e00:a9a4:5df:dbbc:790]) by smtp.googlemail.com with ESMTPSA id f2sm9270513wrq.48.2019.06.15.03.09.44 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 15 Jun 2019 03:09:45 -0700 (PDT) From: Martin Blumenstingl To: netdev@vger.kernel.org, peppe.cavallaro@st.com, alexandre.torgue@st.com, joabreu@synopsys.com, davem@davemloft.net Subject: [PATCH net-next v1 4/5] net: stmmac: drop the reset delays from struct stmmac_mdio_bus_data Date: Sat, 15 Jun 2019 12:09:31 +0200 Message-Id: <20190615100932.27101-5-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190615100932.27101-1-martin.blumenstingl@googlemail.com> References: <20190615100932.27101-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190615_030947_833997_2CA71EBF X-CRM114-Status: GOOD ( 11.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Blumenstingl , andrew@lunn.ch, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Only OF platforms use the reset delays and these delays are only read in stmmac_mdio_reset(). Move them from struct stmmac_mdio_bus_data to a stack variable inside stmmac_mdio_reset() because that's the only usage of these delays. Signed-off-by: Martin Blumenstingl --- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 15 ++++++++------- include/linux/stmmac.h | 3 --- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c index 459ef8afe4fb..c9454cf4f189 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c @@ -252,6 +252,7 @@ int stmmac_mdio_reset(struct mii_bus *bus) #ifdef CONFIG_OF if (priv->device->of_node) { struct gpio_desc *reset_gpio; + u32 delays[3]; reset_gpio = devm_gpiod_get_optional(priv->device, "snps,reset", @@ -261,18 +262,18 @@ int stmmac_mdio_reset(struct mii_bus *bus) device_property_read_u32_array(priv->device, "snps,reset-delays-us", - data->delays, 3); + delays, ARRAY_SIZE(delays)); - if (data->delays[0]) - msleep(DIV_ROUND_UP(data->delays[0], 1000)); + if (delays[0]) + msleep(DIV_ROUND_UP(delays[0], 1000)); gpiod_set_value_cansleep(reset_gpio, 1); - if (data->delays[1]) - msleep(DIV_ROUND_UP(data->delays[1], 1000)); + if (delays[1]) + msleep(DIV_ROUND_UP(delays[1], 1000)); gpiod_set_value_cansleep(reset_gpio, 0); - if (data->delays[2]) - msleep(DIV_ROUND_UP(data->delays[2], 1000)); + if (delays[2]) + msleep(DIV_ROUND_UP(delays[2], 1000)); } #endif diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index fe865df82e48..96d97c908595 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -96,9 +96,6 @@ struct stmmac_mdio_bus_data { unsigned int phy_mask; int *irqs; int probed_phy_irq; -#ifdef CONFIG_OF - u32 delays[3]; -#endif }; struct stmmac_dma_cfg { From patchwork Sat Jun 15 10:09:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10997063 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0D4BC76 for ; Sat, 15 Jun 2019 10:11:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0091287A9 for ; Sat, 15 Jun 2019 10:11:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4145287AE; Sat, 15 Jun 2019 10:11:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 82481287A9 for ; Sat, 15 Jun 2019 10:11:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9s2GJ85zTbtMwNVtnSrMwbOvO3Vlaur5NOx1j2D0/vc=; b=vDliLrau6MKa0S Hhiup15jswd2vMLccO6CPaQRHXEMDGmHDEgfdO4cNzkSTukG+gVTmgIAms/MKDf+VoBa8k0LfrdAU qXGfXk4xymoqc2S22P0wrRi6f9X7n50gtFihbqo9c42GE5sMhN6IC/BdC/ExSiq0PvB1kkzW6Z87t 0jwFLczC8roFDZXdXLSwSOiI9/24ZXlwEhN0ocZWEOcd3COxVbNnM1d7NVlauOLfqeH4ZXz/D1IF5 P1Lvoz7RqLvGj0SlX20PuMCGLu83mRsyF7ey9/hVNPt8Omu+4+AC5qzJ3AtORco0xcU+o4+oXKB+F UbAkzpkf7sPTfCpD1etg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hc5ek-0006AO-1B; Sat, 15 Jun 2019 10:11:30 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hc5d7-0003VL-2d for linux-arm-kernel@lists.infradead.org; Sat, 15 Jun 2019 10:09:50 +0000 Received: by mail-wm1-x341.google.com with SMTP id c66so4711481wmf.0 for ; Sat, 15 Jun 2019 03:09:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+2oD/T2gc6N24fqNrzj6/wc7vB4Laq1g0xwvSr2ZKbs=; b=Tbn+fRxNzDPqt3dXwDOHmhvz1KRUKIeLE15UwPS7Aw07mlz4dq/T6LF2SVTNLz5mLZ PyoiOmkF/joUJFS6kUJ/0/MNwgoN57I6kkVuBeqWRwohMevKvE0F+dc/FzuBAMUyJ03v G8NweV2l51cLh0h8qJzK5Geqx3lDnoFEsPCKeP40L1LFRZuaIN8LHPrOhi4qaviSZvp6 94HWbfFXG67h7zj8SJU0KrYlQ3HXdv1/j3vkRASNTrog5v0F+YrNvVeNrAs89dV6alZ4 TI+WxthFrtSJ7iIYfJihpbsm66zotMRodljmY2LmrEbb64uArTJ3SjgFlzJhFZsHCgv0 SZ3Q== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=+2oD/T2gc6N24fqNrzj6/wc7vB4Laq1g0xwvSr2ZKbs=; b=bHiraVFeAlfw7OLc36fKXIkDfDlRzy++0OqiqmpFhEKMANUKzRvX3I2EUd6FqRApw+ t8DH7Uo7QzLZZzfqKvS8ZDBpFttt9HwH9IySZ2lNLrkZ7lcSqZZ1Edf3Uasm9ZGLJYyc D3Rhtf27gIog2vAeg35jKG2dEwyJkZ7Ch2XoeN1LmrfjiFsko/LL2WhNXnr8YyrHwwSR 8hkZnH0qxYusP9JJ80g1gV1PoUuSvePn+iobcUOXpLOUsIt4tRv8SGQ5MG+Gi+QsYZ5y 6gbCztiTpBK6IlJv7u2oXQCj2dhMSEVp4u/0bFkizqZQGjSOc5kmdmYAYt4qcoLkHe5T LkyA== X-Gm-Message-State: APjAAAVzw6TCX335mcoL3KAjRvitpYJ51oaRLgTciF8x5XILARZR/Yxo SyA4Ul0+1nEqzH0I9X1OV+A= X-Google-Smtp-Source: APXvYqyWy5DuzLQIfgqm/qwN02Z8iZMe0vr3d729+Ve1oTg2V8Q3d6yjtc0DL1CeTDaOZ2WQ3MBHCw== X-Received: by 2002:a1c:b6d4:: with SMTP id g203mr11100015wmf.19.1560593387236; Sat, 15 Jun 2019 03:09:47 -0700 (PDT) Received: from blackbox.darklights.net (p200300F133C20E00A9A405DFDBBC0790.dip0.t-ipconnect.de. [2003:f1:33c2:e00:a9a4:5df:dbbc:790]) by smtp.googlemail.com with ESMTPSA id f2sm9270513wrq.48.2019.06.15.03.09.46 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 15 Jun 2019 03:09:46 -0700 (PDT) From: Martin Blumenstingl To: netdev@vger.kernel.org, peppe.cavallaro@st.com, alexandre.torgue@st.com, joabreu@synopsys.com, davem@davemloft.net Subject: [PATCH net-next v1 5/5] net: stmmac: drop the phy_reset hook from struct stmmac_mdio_bus_data Date: Sat, 15 Jun 2019 12:09:32 +0200 Message-Id: <20190615100932.27101-6-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190615100932.27101-1-martin.blumenstingl@googlemail.com> References: <20190615100932.27101-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190615_030949_136554_72CDAEDD X-CRM114-Status: GOOD ( 11.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Blumenstingl , andrew@lunn.ch, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The phy_reset hook is not set anywhere. Drop it to make stmmac_mdio_reset() smaller. Signed-off-by: Martin Blumenstingl --- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 6 ------ include/linux/stmmac.h | 1 - 2 files changed, 7 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c index c9454cf4f189..14aa3ee14082 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c @@ -247,7 +247,6 @@ int stmmac_mdio_reset(struct mii_bus *bus) struct net_device *ndev = bus->priv; struct stmmac_priv *priv = netdev_priv(ndev); unsigned int mii_address = priv->hw->mii.addr; - struct stmmac_mdio_bus_data *data = priv->plat->mdio_bus_data; #ifdef CONFIG_OF if (priv->device->of_node) { @@ -277,11 +276,6 @@ int stmmac_mdio_reset(struct mii_bus *bus) } #endif - if (data->phy_reset) { - netdev_dbg(ndev, "stmmac_mdio_reset: calling phy_reset\n"); - data->phy_reset(priv->plat->bsp_priv); - } - /* This is a workaround for problems with the STE101P PHY. * It doesn't complete its reset until at least one clock cycle * on MDC, so perform a dummy mdio read. To be updated for GMAC4 diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 96d97c908595..9aad16c379e7 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -92,7 +92,6 @@ /* Platfrom data for platform device structure's platform_data field */ struct stmmac_mdio_bus_data { - int (*phy_reset)(void *priv); unsigned int phy_mask; int *irqs; int probed_phy_irq;