From patchwork Mon Nov 4 21:01:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 2006470 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=kuhkqenP; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev+bounces-2847-incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xj3mh5X5Xz1xyP for ; Tue, 5 Nov 2024 08:01:40 +1100 (AEDT) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Xj3mc5BZpz2xsd; Tue, 5 Nov 2024 08:01:36 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2607:f8b0:4864:20::42b" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1730754096; cv=none; b=ZvpI4bMQzJf1FcWnvF2bmRHqcRDKrYNy71dJK+Z+vQe/ESlcP7mfykzdFSZOCnXaex0149YF2JeSdTkZhEjyATe/YmvThdgy96phvYHB1jTJaUsZOxnvYcYv0W5nYXN6eX+UBNp28miMVCCDQZFA9y9xc1HcRpgdpgKKXkT+3V2A96BIP42o46Milh1oaDjck3tvvSIHNdD6jpiQ9GNPdyF3efxhcDN2CyRXgLpVz2fdmjCYXX81MFypV86S1gpZ3NebqLUaFjp5zqu7xARiDy7/zYWvLyGedH9jrN9CZOByrQuOP8hiEUHYKcMbgYNpRvXJfrJWCGmfu5qinK2wRA== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1730754096; c=relaxed/relaxed; bh=Ip9/C2ewikw3KgUEbRX7k49RSpJtURcwU9L3ZheHKjQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=STGEIJiSi8KQZ36CBIyyRjRW/nxoQf+gl0tFAVIGwUra/U4kUrkoTsBtW+tw5ErA0TqyfrbCTotVBM05L+5zbHhPFKykOh0Db5MzSnBJmd+GncUjhwMaEAYpvRqwDnztOTLwYBiSiSgFGDjFkruSVClN+7tJNc1hzvT+aiEMNlPij8fxPeP7LJKB7o9mh258lklUPvHRpPrlwtjh8Y1x62wuoRCRS4o9Ef1UXppBzGsiX4bfeEH51j4VkwhK1/V5RLNlHt6Ysm0v6RSVBHNHZ58K6JlTFJ6iXM9zTKRCFDRk8oTM8LsdSzvrvzq/5Ky3BTw0700o/AVS0xTt0lZc+Q== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=kuhkqenP; dkim-atps=neutral; spf=pass (client-ip=2607:f8b0:4864:20::42b; helo=mail-pf1-x42b.google.com; envelope-from=rosenp@gmail.com; receiver=lists.ozlabs.org) smtp.mailfrom=gmail.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=kuhkqenP; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::42b; helo=mail-pf1-x42b.google.com; envelope-from=rosenp@gmail.com; receiver=lists.ozlabs.org) Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Xj3mZ6FFqz2xJF for ; Tue, 5 Nov 2024 08:01:34 +1100 (AEDT) Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-71e52582cf8so3994148b3a.2 for ; Mon, 04 Nov 2024 13:01:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730754092; x=1731358892; darn=lists.ozlabs.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ip9/C2ewikw3KgUEbRX7k49RSpJtURcwU9L3ZheHKjQ=; b=kuhkqenPy+hwoOQEGa34Z4/y34lAyANJ1oJmNTwSM/PW/7lLVe/6Fz1Irbet8RRu1E Vw8z0fTGjr9TtN5rxMk0UudKXmmP/KYNJYAVp8re38nyHWy5FweenZaGUAp5xAcb2MKN ZDFxUWOwv69RwFP8yy705ee/hQJOQl6MMpAOov6JmvE1uxMQjPsKhv/il6H/H1FMZ5DO FezX75L+lNsQJb65w0oxKfEVz68x8nWvwGRFsWE7+RkvSyGk3weRjcL5zYmCtF55kDYd 7k46edbRbA2BHHbus3xWrcrSEuZfvSFiSPIjSG/ELpx6mBqTrg7JiBI6w18Og+2tY8fz P42g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730754092; x=1731358892; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ip9/C2ewikw3KgUEbRX7k49RSpJtURcwU9L3ZheHKjQ=; b=VAMktAV3yKdZbAjLXrig4L2CoZJt0craxCuLLuhb9ILKSrHEm6131RfkBS4J4sXSp3 ZKRk9tfQsa/RUjmT8btfZGBOEEcL6QCqI1wj+r5krmN2w+Jt7I73+oI2nIgC4OCw7cQt Pgxi7kPA07hg6beC/S8vg8zGXg1yA9NUp2fPwzuPWEKxscqjqaKRHiF5dzgHF9CRyNI1 Jg2z3J+zZk3hQy/MsdzcOxnnoaunuI/hSP7w4Dzb4EBW4nES2sLqqLGCefI58oC+RB0Q O79v/S4r+PtWPrqGlzRsRuz0YEvk5owywwgMkkucBJLW1G/pOdeJYsjcc8v3AvnURpox ELEw== X-Forwarded-Encrypted: i=1; AJvYcCULvnRR/Rp19O6FO/DDy7kRhPOBXGU2zoja7VSdz7Me71Amr1yO5jAUW0DGH/OpuxxfRwwMEuImp/JG4vE=@lists.ozlabs.org X-Gm-Message-State: AOJu0YwzCtdiR91W/pg31yL6k145WRdQkcHeQL2B0tQzz/eHShio0sOw R9QyxLwlxP2wY5nEFttGDZ2pgCxdxXmAxkqD7pSs18ld4k7J8jOJ X-Google-Smtp-Source: AGHT+IEnbdG1Ii06AUcv2+s6OlAYE4thaNj7TjcIIQC8s8ZBO9ULIesDRtW5uiZzRUj/PuB2sXQt1g== X-Received: by 2002:a05:6a00:1814:b0:71e:3b51:e850 with SMTP id d2e1a72fcca58-720c98a3d3amr19246643b3a.2.1730754091800; Mon, 04 Nov 2024 13:01:31 -0800 (PST) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-720bc1b8971sm8307755b3a.12.2024.11.04.13.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2024 13:01:31 -0800 (PST) From: Rosen Penev To: netdev@vger.kernel.org Cc: Andrew Lunn , maxime.chevallier@bootlin.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linuxppc-dev@lists.ozlabs.org (open list:FREESCALE QUICC ENGINE UCC ETHERNET DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net-next 1/4] net: ucc_geth: use devm for kmemdup Date: Mon, 4 Nov 2024 13:01:24 -0800 Message-ID: <20241104210127.307420-2-rosenp@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241104210127.307420-1-rosenp@gmail.com> References: <20241104210127.307420-1-rosenp@gmail.com> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on lists.ozlabs.org Avoids manual frees for it. Funny enough the free in _remove should be the last thing done. Signed-off-by: Rosen Penev --- drivers/net/ethernet/freescale/ucc_geth.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index a7dd0a2ead86..4bf5ff5642e7 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -3594,22 +3594,23 @@ static int ucc_geth_probe(struct platform_device* ofdev) if ((ucc_num < 0) || (ucc_num > 7)) return -ENODEV; - ug_info = kmemdup(&ugeth_primary_info, sizeof(*ug_info), GFP_KERNEL); - if (ug_info == NULL) + ug_info = devm_kmemdup(&ofdev->dev, &ugeth_primary_info, + sizeof(*ug_info), GFP_KERNEL); + if (!ug_info) return -ENOMEM; ug_info->uf_info.ucc_num = ucc_num; err = ucc_geth_parse_clock(np, "rx", &ug_info->uf_info.rx_clock); if (err) - goto err_free_info; + return err; err = ucc_geth_parse_clock(np, "tx", &ug_info->uf_info.tx_clock); if (err) - goto err_free_info; + return err; err = of_address_to_resource(np, 0, &res); if (err) - goto err_free_info; + return err; ug_info->uf_info.regs = res.start; ug_info->uf_info.irq = irq_of_parse_and_map(np, 0); @@ -3622,7 +3623,7 @@ static int ucc_geth_probe(struct platform_device* ofdev) */ err = of_phy_register_fixed_link(np); if (err) - goto err_free_info; + return err; ug_info->phy_node = of_node_get(np); } @@ -3751,9 +3752,6 @@ static int ucc_geth_probe(struct platform_device* ofdev) of_phy_deregister_fixed_link(np); of_node_put(ug_info->tbi_node); of_node_put(ug_info->phy_node); -err_free_info: - kfree(ug_info); - return err; } @@ -3769,7 +3767,6 @@ static void ucc_geth_remove(struct platform_device* ofdev) of_phy_deregister_fixed_link(np); of_node_put(ugeth->ug_info->tbi_node); of_node_put(ugeth->ug_info->phy_node); - kfree(ugeth->ug_info); free_netdev(dev); } From patchwork Mon Nov 4 21:01:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 2006471 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Wrhyqevr; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=linuxppc-dev+bounces-2848-incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xj3mq5lqRz1xxb for ; Tue, 5 Nov 2024 08:01:47 +1100 (AEDT) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Xj3md1bk5z2xGH; Tue, 5 Nov 2024 08:01:37 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2607:f8b0:4864:20::435" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1730754097; cv=none; b=ktXra7/YIAEHN7Yfj2VuRQjyKkDA67z9nsQXZXtgksxjdt55f5ZGJ1lS7LZpNkT1Mw489YhYL9ppx0+f/uNtb2R7CsQxuf++SMVCa5w8caSE8W2k+8h6GzgwBd2RHbQUxT9tO8M2dcOTo+q1QyQzLdzbpx91+Kn5fRhz/YmlfhhbCYYSf3tJpvzuYxYUWOEYZk65QDMsK+H1PTUBxsWSEQgfgd5YVzNB0ZnaVxqgAoWdiVfw8nDdFy+QMdxNGL66iHfrZRWmMU9JdC6KQhwUZVcateW8VWoXl9u7m46FUSdPGQ/QwBZM6jiUrve1Sba0ruagVujgbE4nA3nDybYCcA== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1730754097; c=relaxed/relaxed; bh=+bIZ8zF+L8MJ4yRKB9h8E75aKwY9cSMENvoX7DOPics=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YyD97B3IGHeMYU3DGSf3zqj965dPVuluM4Oj3pf+9RTbDC12REsIGBRQ03lc8ntj/5LPXpIKJZ5j/KNXjmxNbCC6y5AQ5I0ZddIbM2HnvFNzrmpzrtDsxe9B5QQq/9z/+LJSpXVTJetsWM+AQWuMNIsAUINAXRvtXzj/161pKmiC+uFtn2BclAQJyAXotRa6pqj+BcIIvfK0qwzB3DFXp1qXL29m+zXBIyAsQ/qH1tcV72ZHVEas7g4ZKnlGfwa5Hoa9FZTspygrtnNCjp+zgD2ydHFp3VfQMFz4Dx4Fa5MyfUC/TQXw6ChazeSAh4ReznHcX58CFoHycIM/remU4w== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Wrhyqevr; dkim-atps=neutral; spf=pass (client-ip=2607:f8b0:4864:20::435; helo=mail-pf1-x435.google.com; envelope-from=rosenp@gmail.com; receiver=lists.ozlabs.org) smtp.mailfrom=gmail.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Wrhyqevr; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::435; helo=mail-pf1-x435.google.com; envelope-from=rosenp@gmail.com; receiver=lists.ozlabs.org) Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Xj3mb6dcFz2xdg for ; Tue, 5 Nov 2024 08:01:35 +1100 (AEDT) Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-71e4244fdc6so3671113b3a.0 for ; Mon, 04 Nov 2024 13:01:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730754093; x=1731358893; darn=lists.ozlabs.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+bIZ8zF+L8MJ4yRKB9h8E75aKwY9cSMENvoX7DOPics=; b=Wrhyqevr3AOIWZJ1uqzVUlIuxBwEiLIr97AoCvstmUq+bPbeeDawHeyQpDCYmUzrfH yNykU5PoPez0BftT4eUxmMFH+6t/BJNlrMstJN6D5lc1OZwKSlBWxQwGs8sPcl5p34wh Ca8Hqw1yboWuvDGTXpyfH/xql3ZHYrMOVLtqDMwEaK+h5MufR253S/f1xFOKMwLJBeQB VOpCgnGKOLf1nLHgzkbgDvhpwQVL5WNwhSWVlP4NSURdEoMt/yLtEn1ZM2gTEVoEReV1 xxufarAsVh0TsoA7Bo1hk3H1496vjmd1p8z/14pg7c7ig9Byebc2P4VnZUzgPe/0EXHc WHDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730754093; x=1731358893; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+bIZ8zF+L8MJ4yRKB9h8E75aKwY9cSMENvoX7DOPics=; b=ogMagEVkZPCNfivZS4ZWso2DKgcAYp9dsBlTGP97BNFMfQnTMlyViDz/UKFMu6nE3l MUQc61VF59mA3b/OxQG+HaHTroIQkd8GvAIDTxBQ6HmvetGlokNs/QZFECa3Z79lb+D2 AoX9fVzne2z5dhQzrRN5TiQH6qG+mx+siKZ+aPpoZPo6CU/VkBVNiQurOSY8F1HAavcG 2QiupH/kes7jAfyPnMl4u7nTkUm6D8F7rICmfTEE4hthvtYAQW6j7u9HPlCY6T1A0AUm /ZMUb7YCoT90KBrR/kj6XEAcd6n7J2o/o8Sc8QSp7+75BNSUaMFedKFp2uTOlfmylNZK BU+Q== X-Forwarded-Encrypted: i=1; AJvYcCVGFzsgNx0qcwXd7qKqMGzLRh4BckSgYGJmfbBCUFPQfZE55zwvHP9uiMZxDC1gT1dyZVUkoHDwCghX1lg=@lists.ozlabs.org X-Gm-Message-State: AOJu0YxNijZnjDFQfK24fubKiGD/AuDif3UDdikfdJnHzpBYhjO+Wf3J Yud6XNANwux4y9gVk//P9aCkoOE6EUS4QDYN91zA7pDrlWbHw0Fn X-Google-Smtp-Source: AGHT+IHvyohNo16U96R1KwDf+tb8U7yjZoIHw3NSm12/Rem7Lvwp3HRybPvr/i8cZs2/qOPlSvCccQ== X-Received: by 2002:a05:6a00:8cf:b0:71e:3b8f:92e with SMTP id d2e1a72fcca58-720c98a3b4amr19231161b3a.3.1730754093280; Mon, 04 Nov 2024 13:01:33 -0800 (PST) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-720bc1b8971sm8307755b3a.12.2024.11.04.13.01.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2024 13:01:32 -0800 (PST) From: Rosen Penev To: netdev@vger.kernel.org Cc: Andrew Lunn , maxime.chevallier@bootlin.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linuxppc-dev@lists.ozlabs.org (open list:FREESCALE QUICC ENGINE UCC ETHERNET DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net-next 2/4] net: ucc_geth: use devm for alloc_etherdev Date: Mon, 4 Nov 2024 13:01:25 -0800 Message-ID: <20241104210127.307420-3-rosenp@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241104210127.307420-1-rosenp@gmail.com> References: <20241104210127.307420-1-rosenp@gmail.com> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on lists.ozlabs.org Avoids manual frees. Removes one goto. Signed-off-by: Rosen Penev --- drivers/net/ethernet/freescale/ucc_geth.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 4bf5ff5642e7..00b868a47fd2 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -3691,9 +3691,8 @@ static int ucc_geth_probe(struct platform_device* ofdev) ug_info->uf_info.irq); /* Create an ethernet device instance */ - dev = alloc_etherdev(sizeof(*ugeth)); - - if (dev == NULL) { + dev = devm_alloc_etherdev(&ofdev->dev, sizeof(*ugeth)); + if (!dev) { err = -ENOMEM; goto err_deregister_fixed_link; } @@ -3733,7 +3732,7 @@ static int ucc_geth_probe(struct platform_device* ofdev) if (netif_msg_probe(ugeth)) pr_err("%s: Cannot register net device, aborting\n", dev->name); - goto err_free_netdev; + goto err_deregister_fixed_link; } of_get_ethdev_address(np, dev); @@ -3745,8 +3744,6 @@ static int ucc_geth_probe(struct platform_device* ofdev) return 0; -err_free_netdev: - free_netdev(dev); err_deregister_fixed_link: if (of_phy_is_fixed_link(np)) of_phy_deregister_fixed_link(np); @@ -3767,7 +3764,6 @@ static void ucc_geth_remove(struct platform_device* ofdev) of_phy_deregister_fixed_link(np); of_node_put(ugeth->ug_info->tbi_node); of_node_put(ugeth->ug_info->phy_node); - free_netdev(dev); } static const struct of_device_id ucc_geth_match[] = { From patchwork Mon Nov 4 21:01:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 2006472 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=mtDE4dy+; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev+bounces-2849-incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xj3n04DRrz1xxb for ; Tue, 5 Nov 2024 08:01:56 +1100 (AEDT) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Xj3mf6Vn5z2ygG; Tue, 5 Nov 2024 08:01:38 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2607:f8b0:4864:20::42c" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1730754098; cv=none; b=CZ9uRvILyepURHaGc3vSoKzn67SDC36KmDsrszTNA76Pxs4mNSX4l49b5iaPnrQ+3pOG7k0ABYJDybX6HMp3KzU8yHlWqS2ZKE3GLrPyLo0GfwfU4FO8tQc5LxSmDuJK23LOYckJCGzlKZP8odZKtE713rZ47314RvqF9lHblUMAR+dRh5KF4EsHQiPpJnYJ75scr2jyIz/UvtXB1pxma1rH4mFxHxWqAQN8Ong2sltGYeAHh5zYgT1PecERjXIu/b9BANjzKj3C6LWui5lePt+MQEj4zv90opj7+Igv3EOpUrQUAeVNeVY/2d70JAuQFLfwlXVbaDcMdGcUOUidcg== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1730754098; c=relaxed/relaxed; bh=4pXKZHXAtSZq9rE1V/pmNjGOdaYBnGBtC8hqbRoKbqU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iZd3rhR8xCpel5KjTGuydQ+V84nPjxfUgmM7+uKcQEVUGjL7ZQIXXjLwW/y6hlCIb1kFgYQW8eeMUE9sWBJMxhb/HzPG5ua2Oe6r76iIY90okhiqSW457kKrDsXbxg115alGLbonOxPBQrjzLR/ZbmeVl9RO3TCGFb5E5m9B+ZxdBZCoGzYzTp9IXVJNPsBDYN8tYJZ9ktXPUfdHIYvrsycGKRy5xVjFO1Gsb0UoaaojfxS7tBoPxKIt5TzjR6hHR4/j6n5/Dtz+VfTqNOAmX8r3AaAg/8FA4oT0wsCfPG6B4XOe7AiuBbzYrStFt+aYiMwARM9GAiMIK4ZMmHU25A== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=mtDE4dy+; dkim-atps=neutral; spf=pass (client-ip=2607:f8b0:4864:20::42c; helo=mail-pf1-x42c.google.com; envelope-from=rosenp@gmail.com; receiver=lists.ozlabs.org) smtp.mailfrom=gmail.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=mtDE4dy+; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::42c; helo=mail-pf1-x42c.google.com; envelope-from=rosenp@gmail.com; receiver=lists.ozlabs.org) Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Xj3mf0BmNz2xdg for ; Tue, 5 Nov 2024 08:01:37 +1100 (AEDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-71e625b00bcso4237211b3a.3 for ; Mon, 04 Nov 2024 13:01:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730754095; x=1731358895; darn=lists.ozlabs.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4pXKZHXAtSZq9rE1V/pmNjGOdaYBnGBtC8hqbRoKbqU=; b=mtDE4dy+yQ2UNGgWsPHfW9WOXUEyGeVLx2LOM62eG8QbjBlJgdIK86jrG5pbcIO2AS s/QfMu2O175rbv7sBKdmjei6o/4nH5KFhJhgRvSeSxZN91YKf8WLZFhJenqv+z3+BjRB 5tK6arjhqua6k8FF9969u2sN52zfZZ8tpVmLdrgYqdFGeF1GdDr7OiMb0yVzd3ScS21j D+VcaGwMUXmCYj2c2wi/eK/AReTE1EcJTpOONd7/JvYjOhLLaE9Q9QnpgahOi52Udv0I cfm438kplq10jILL0y+psPyYn5rVyG5XPTUWSbr6JN9+ouJWbLMYDGduXaM8WTpKuOok 5zsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730754095; x=1731358895; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4pXKZHXAtSZq9rE1V/pmNjGOdaYBnGBtC8hqbRoKbqU=; b=LcexZqn8NVnoLytmq617sDLYm6nOXlbL+fg7HSfAu39eVFF312ziCGQdbAG8SfpD+8 E1ZBktS7218Niuqvi/mC6bqYAXmzQojW1/mfW3ZJz8CHAUVBQ65M4zfGevQJUL7789Q+ xKglqghM9wjme5km0hjt99dSKHfmPwpT4iSt6VWRUVZbFSaxLBnBMERVFFCBqnBmZbf8 LbvUjCpp6WVHGvu9bwMvO4KiDRPh1cSffZVurRQmjE40ghvCCuSgAMgBiCBT3hWFfTWy P/wTbGE/vSKJagrxWDj4joMxI6qfYE2NoLmPn7kK9a7ZsYo4XMPUt8iJkS4cCiYZqbTI qSpQ== X-Forwarded-Encrypted: i=1; AJvYcCVLxiLopz1msvpS8yrNo1vKNd7sBTG1bOeAHrzJnvQ1wHSdXuZ36qoLvG9Hyi3mppr7Xo6HwwtnFDktK5g=@lists.ozlabs.org X-Gm-Message-State: AOJu0YxQAETD89iz2JKEzGKwI/KKzCr/lZ+8bClUnMXg6qdfXiEq7fzq K5VTKMh+Qevk1I6GOusXUeTzeZlJqzaSiij/IALOuelcn13DtJryvuw46c2V X-Google-Smtp-Source: AGHT+IGVOiJFQcleE+NLyWRmjQbIlc5so8HKh80FTo3HLnTFS4d9spw/T8UmVR69HQs88bShBPOJpQ== X-Received: by 2002:a05:6a00:2302:b0:71e:6c65:e7c4 with SMTP id d2e1a72fcca58-720b9de1608mr21369867b3a.26.1730754094875; Mon, 04 Nov 2024 13:01:34 -0800 (PST) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-720bc1b8971sm8307755b3a.12.2024.11.04.13.01.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2024 13:01:34 -0800 (PST) From: Rosen Penev To: netdev@vger.kernel.org Cc: Andrew Lunn , maxime.chevallier@bootlin.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linuxppc-dev@lists.ozlabs.org (open list:FREESCALE QUICC ENGINE UCC ETHERNET DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net-next 3/4] net: ucc_geth: use devm for register_netdev Date: Mon, 4 Nov 2024 13:01:26 -0800 Message-ID: <20241104210127.307420-4-rosenp@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241104210127.307420-1-rosenp@gmail.com> References: <20241104210127.307420-1-rosenp@gmail.com> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on lists.ozlabs.org Avoids having to unregister manually. Signed-off-by: Rosen Penev --- drivers/net/ethernet/freescale/ucc_geth.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 00b868a47fd2..88a9e7db687c 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -3727,7 +3727,7 @@ static int ucc_geth_probe(struct platform_device* ofdev) /* Carrier starts down, phylib will bring it up */ netif_carrier_off(dev); - err = register_netdev(dev); + err = devm_register_netdev(&ofdev->dev, dev); if (err) { if (netif_msg_probe(ugeth)) pr_err("%s: Cannot register net device, aborting\n", @@ -3758,7 +3758,6 @@ static void ucc_geth_remove(struct platform_device* ofdev) struct ucc_geth_private *ugeth = netdev_priv(dev); struct device_node *np = ofdev->dev.of_node; - unregister_netdev(dev); ucc_geth_memclean(ugeth); if (of_phy_is_fixed_link(np)) of_phy_deregister_fixed_link(np); From patchwork Mon Nov 4 21:01:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 2006473 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=WNWRIY2D; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=linuxppc-dev+bounces-2850-incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xj3n81LGKz1xxb for ; Tue, 5 Nov 2024 08:02:03 +1100 (AEDT) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Xj3mh2jxYz2yvy; Tue, 5 Nov 2024 08:01:40 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2607:f8b0:4864:20::432" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1730754100; cv=none; b=aUVWGkca5RxMy94SF8eiGL4L2co9eQ5OTUGxV/qFLFeJ2pIQiiIWpYUAEHxmXvQWxJkRySGffapULQzb9Dte0CaI9+5XA62brrtmEjCCFJsHoB4krb7hC2Zn1RzPV0tflNqZW2hyzNbX/Lnk8y3D/lvf2Z9cZbo4soIy9af9SwZVDPtfTMXCOoc+Bmy/SqfjE4qcaBKeLpduGbZw/Y7x0ymFdv6XXzlK9EtOW0uvaZTr4lL2TCxRuQxYw9/CY9qDSODLa8uT8pbOrEyOS/hA4FSbXi8BaCze1DrWJ+TP0xa/lff9U+3aIC25ImWeUAUTnRpKWQlx+taFyfoLrHfQ7A== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1730754100; c=relaxed/relaxed; bh=HB0r+fmFtPPP2FUicFB9grwBKEnYit58WrhtOqLd8qs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lVa10Jk8zrEQR4oHvxLeFKSi4CxEXittJw6gM5Q27jS/hhmBaQhch44euAUN0GyUUCmkNtSYiLVihqh65kJrSja4R91MiaV8ImWKtN5FjPRIVxEMp7AgzfUS047s2tWYNac+hH1W8n78Zie9qu5f5xt0C33GFaRHokkEsZzHpZXoLXJDOjaKZX8Xg1Ss71VG2ag6Iw8XXLs9pvaVspXxJfgXyZTka6JmAwumwizZyhpDf5bAp/x2xFby+TzRsQs74+zvwyQypXm8eSvBd+3T6ikKEpaz62so+OyxM3MkmI1gz2UxDvXVoeVHYK1QLRd80L4lEE2hVz7Xy8t9WZ+kRw== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=WNWRIY2D; dkim-atps=neutral; spf=pass (client-ip=2607:f8b0:4864:20::432; helo=mail-pf1-x432.google.com; envelope-from=rosenp@gmail.com; receiver=lists.ozlabs.org) smtp.mailfrom=gmail.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=WNWRIY2D; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::432; helo=mail-pf1-x432.google.com; envelope-from=rosenp@gmail.com; receiver=lists.ozlabs.org) Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Xj3mg3VqXz2xdg for ; Tue, 5 Nov 2024 08:01:39 +1100 (AEDT) Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-720d01caa66so2998142b3a.2 for ; Mon, 04 Nov 2024 13:01:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730754096; x=1731358896; darn=lists.ozlabs.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HB0r+fmFtPPP2FUicFB9grwBKEnYit58WrhtOqLd8qs=; b=WNWRIY2DJZdkDKu1UjwdZzSytz4iyFllafp25u6WM2WGDwKii7Z8iE358mq9PmQr3F D85Ya4fieYjYDmePYT+pN+zrrjfGw5miazWnpe24yezMo2VKlSQzareB+rCn81eUw9yQ w9Og8aEqlErAkXvdOl772HjFwlK1/4e8Qv0rmf70/0N1rkJ+23h/XMiqwDvI35XBeacW QVNfIQp8WsTWaDceWHa7IdJ9uKho7zV9qUvoWA5ZNCIDLXXas3aaUm5E3/goVotrvamF wZO7xffTU8Stk2BNEoQdd2+YG3HzON8Go4xCv7fAulOVRjCogyKf34jcJKGKAbrl11SV 997Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730754096; x=1731358896; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HB0r+fmFtPPP2FUicFB9grwBKEnYit58WrhtOqLd8qs=; b=bcX08bdb2fvp7GJZ/49kwV0xcYyj98Xrd490k7m1W0zsrWwBtAzptoAROxRRBf4Vym PUHXsZzhmqb9XJ02Y3KKYzi4fMBL0KO6f1/7jBLYw8WxPwE/q6oXatjkXDHPdP/qf2co m9JUd8C4NcwM2EGvHtvnrah96xlMA89AqNMIRpm0MYAKiCVNs2PngLkOscPQv1RTi6XG gSzsaPsV/7aToCKgeI86GMm4Ue6E6Yn0otRVrWS1RQrBnP1ZmYfklbqKu1BrJXkVPO4j /sYKF5EL2i+Lxpm79I9JONOLjwi/p2+3uhibC2swzTnDD1QfI9Ilbv0oCunmTR0E2SkD J7kw== X-Forwarded-Encrypted: i=1; AJvYcCXhlBk8/v3rCB1aaeoXJk3ntFX/lfszxJsZHh72FxqouJgsymHEi2RWK1kFbKy2qcEI7LU+Hi6CJWXXSU4=@lists.ozlabs.org X-Gm-Message-State: AOJu0YzH0K9uVl0yWqguZS176WP3mZLGglulc3oL2JSq9sWus8oVRgId bFza4tgop9frEubJCJdD1Mteb7DBR/8kiOOxgUXIdEbV1Z82a1ok X-Google-Smtp-Source: AGHT+IGwMD0UoRgk5kv/dUnGGU4iyNpQ/ODgMyjPi1OiOmbCLzk45IZoztu6i5o/DRbm+JHdKLu80w== X-Received: by 2002:a05:6a20:d525:b0:1d9:1bde:bf8 with SMTP id adf61e73a8af0-1db91d87351mr22961733637.14.1730754096456; Mon, 04 Nov 2024 13:01:36 -0800 (PST) Received: from ryzen.lan ([2601:644:8200:dab8::a86]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-720bc1b8971sm8307755b3a.12.2024.11.04.13.01.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2024 13:01:35 -0800 (PST) From: Rosen Penev To: netdev@vger.kernel.org Cc: Andrew Lunn , maxime.chevallier@bootlin.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linuxppc-dev@lists.ozlabs.org (open list:FREESCALE QUICC ENGINE UCC ETHERNET DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net-next 4/4] net: ucc_geth: fix usage with NVMEM MAC address Date: Mon, 4 Nov 2024 13:01:27 -0800 Message-ID: <20241104210127.307420-5-rosenp@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241104210127.307420-1-rosenp@gmail.com> References: <20241104210127.307420-1-rosenp@gmail.com> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on lists.ozlabs.org When nvmem is not ready, of_get_ethdev_address returns -EPROBE_DEFER. In such a case, return -EPROBE_DEFER to avoid not having a proper MAC address. Signed-off-by: Rosen Penev --- drivers/net/ethernet/freescale/ucc_geth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 88a9e7db687c..30453a20e467 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -3735,7 +3735,9 @@ static int ucc_geth_probe(struct platform_device* ofdev) goto err_deregister_fixed_link; } - of_get_ethdev_address(np, dev); + err = of_get_ethdev_address(np, dev); + if (err == -EPROBE_DEFER) + goto err_deregister_fixed_link; ugeth->ug_info = ug_info; ugeth->dev = device;