From patchwork Wed Sep 23 14:25:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Stefan_Riedm=C3=BCller?= X-Patchwork-Id: 11795099 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5438D112C for ; Wed, 23 Sep 2020 14:26:01 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E1C2F206FB for ; Wed, 23 Sep 2020 14:26:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hAie+Us2"; dkim=temperror (0-bit key) header.d=phytec.de header.i=@phytec.de header.b="LROs7Ibz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E1C2F206FB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=phytec.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References:List-Owner; bh=YWiYN0MqbInNzZbB9X9MitAN0gRhAX6WiZ5eBRDCzVE=; b=hAie+Us2++gv8B/Xy7kW9ctE2G w3Q4/mF2S926xwelC80hLEimvXL0ChEwdylVtCgfj3U2RKubsLNseqIib2QtWJ6fQ05QBsN2YIiwx /GNWDB/Z2QLWdKnRQok4r/whHpudQ4Y2duCtR+smkyyygFDHOSH3Nx+nz/Zg7QAfh0m3DjiU6yGuF gVgmcE6iV23uFlg06zpjmvOSzdZYXL8vJXZzC7u3fG5Hq8sVXOl1N9jggH8ALM9s7z+n3WZs2eZUR Ro0Z1mP3wb9RYC5yjmyY9xbYwgbscDSXil20xn3vqzFXV2fCDxRAClGVeG6jzTPXPs2y+tUSUeYK+ iYFyEN/A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kL5iP-0007rX-Kr; Wed, 23 Sep 2020 14:25:49 +0000 Received: from mickerik.phytec.de ([195.145.39.210]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kL5iN-0007qj-4m for linux-arm-kernel@lists.infradead.org; Wed, 23 Sep 2020 14:25:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; d=phytec.de; s=a1; c=relaxed/simple; q=dns/txt; i=@phytec.de; t=1600871142; x=1603463142; h=From:Sender:Reply-To:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=eZrZq7b5jE9lfQbUpANiarfQVMj5BBuPkcCgqdnooCc=; b=LROs7Ibzmbx2FI5DRgLM0a9y9sL3wTQwp80WxeNPnHloX6Xe8ht0X0Byy9C3zqnx A7pRtVZFPkZMT7n1BVSVKYAzRKucTEQ7gB235IprvBOLQ/yaDmxHIJCcY79C/Kap zUtAN7BxathykxwLA+jFcO2npP2kj8q40OBQCyJiA3s=; X-AuditID: c39127d2-269ff70000001c25-66-5f6b5ae69c10 Received: from idefix.phytec.de (Unknown_Domain [172.16.0.10]) by mickerik.phytec.de (PHYTEC Mail Gateway) with SMTP id 43.2E.07205.6EA5B6F5; Wed, 23 Sep 2020 16:25:42 +0200 (CEST) Received: from lws-riedmueller.phytec.de ([172.16.23.108]) by idefix.phytec.de (IBM Domino Release 9.0.1FP7) with ESMTP id 2020092316254234-484320 ; Wed, 23 Sep 2020 16:25:42 +0200 From: Stefan Riedmueller To: Fugang Duan Subject: [PATCH] net: fec: Keep device numbering consistent with datasheet Date: Wed, 23 Sep 2020 16:25:28 +0200 Message-Id: <20200923142528.303730-1-s.riedmueller@phytec.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-MIMETrack: Itemize by SMTP Server on Idefix/Phytec(Release 9.0.1FP7|August 17, 2016) at 23.09.2020 16:25:42, Serialize by Router on Idefix/Phytec(Release 9.0.1FP7|August 17, 2016) at 23.09.2020 16:25:42 X-TNEFEvaluated: 1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrILMWRmVeSWpSXmKPExsWyRoCBS/dZVHa8wbqD2hZzzrewWKx8fpfd 4sK2PlaLTY+vsVpc3jWHzeLYAjEHNo8tK28yeWxa1cnmsXlJvcfGdzuYPD5vkgtgjeKySUnN ySxLLdK3S+DKuHluPVPBOa6KFfu2sTYwtnN2MXJySAiYSHRtXsXUxcjFISSwjVHi56Qv7BDO NUaJ+ScOsIJUsQkYSSyY1sgEYosIqErs/LcDzGYW+M0o8f4X2CRhAS+JR09/MYLYLEA190/P YgexeQVsJfZc+sAEsU1eYual71BxQYmTM5+wgCyTELjCKDFh1WVWiCIhidOLzzJDLNCWWLbw NfMERr5ZSHpmIUktYGRaxSiUm5mcnVqUma1XkFFZkpqsl5K6iREYjIcnql/awdg3x+MQIxMH 4yFGCQ5mJRHeG2rZ8UK8KYmVValF+fFFpTmpxYcYpTlYlMR5N/CWhAkJpCeWpGanphakFsFk mTg4pRoYc77e2dEnJfvz9eyJFi9Db8jPEVzk8bHh9pPJlW/8/WOUhaKFw2ad6LmmNqdV9cmp +ZX5NrfXa+yPX3qp39S1b8oK1aUVrkHedbWLNyTN7Hh14H/LYm+v4vKP24/M1J5dK3u1YgPj YYVX265+3LCkaVNJOYdw0vkP/9U7+24X1cdNXp0gn14lqcRSnJFoqMVcVJwIAPDFtXc0AgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200923_102547_299113_B0192F7C X-CRM114-Status: GOOD ( 12.38 ) X-Spam-Score: 0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.1 DKIM_INVALID DKIM or DK signature exists, but is not valid 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: Stefan Riedmueller , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Christian Hemp , Jakub Kicinski , "David S . Miller" , 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 From: Christian Hemp Make use of device tree alias for device enumeration to keep the device order consistent with the naming in the datasheet. Otherwise for the i.MX 6UL/ULL the ENET1 interface is enumerated as eth1 and ENET2 as eth0. Signed-off-by: Christian Hemp Signed-off-by: Stefan Riedmueller --- drivers/net/ethernet/freescale/fec_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index fb37816a74db..97dd41bed70a 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -3504,6 +3504,7 @@ fec_probe(struct platform_device *pdev) char irq_name[8]; int irq_cnt; struct fec_devinfo *dev_info; + int eth_id; fec_enet_get_queue_num(pdev, &num_tx_qs, &num_rx_qs); @@ -3691,6 +3692,10 @@ fec_probe(struct platform_device *pdev) ndev->max_mtu = PKT_MAXBUF_SIZE - ETH_HLEN - ETH_FCS_LEN; + eth_id = of_alias_get_id(pdev->dev.of_node, "ethernet"); + if (eth_id >= 0) + sprintf(ndev->name, "eth%d", eth_id); + ret = register_netdev(ndev); if (ret) goto failed_register;