Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1878269lqa; Tue, 30 Apr 2024 01:43:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWP3o9aMd9c3k+HKA3aBdzWg3kmUvsgtLEdd6N2AuBTnSaWyfxdx1/BcniF1GV9YpnoFofm77QXZV4WoGTbcrRwZmkz88l2ipjhmnXZ0A== X-Google-Smtp-Source: AGHT+IGw2sUDBSm0Jews9krg+6vydcXy9pQ0cErSWGEo71S4hut9vFOdqwfIMtqHwPEdG+dLRAiv X-Received: by 2002:a05:6a20:3250:b0:1ad:7cc5:ecee with SMTP id hm16-20020a056a20325000b001ad7cc5eceemr2786162pzc.5.1714466631861; Tue, 30 Apr 2024 01:43:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714466631; cv=pass; d=google.com; s=arc-20160816; b=rVrnZTEphtSlWq73zQ4aSEa5r4tE8WntBMiIHZAmkkdgHd0lKc9+Jb1jrMLUVWzCph E44TXRpy6Rd3Xg3GiTVyj9V11pliRViqUUPHqJBeDgjgmt+Ff70Xu4ACai6d4wAoZVO5 wIh8caTjBNwvG2v0JpgyRGAWuxN/ERb73G6ZuU6TTkobAlQuhg5XaomAQN52BvvMbFa4 j+EpW8lXYMQNT5N77OH9qdV3LTQsp323XO1ctXHIzsPAPnLB9ZmCCQotGUujjvxAzjnm qxCM5xkwky59WD8KD56OJoLF/twwWnD76368LMX/D6iSG55vxGsCTDiC2oEicmgKBE3P cbhQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=d5YbcXC52ww526burA7UWFbg9yga41Sb6wn1P/AlvTU=; fh=op/wKTTfefmSFgXd0BCOmLZMZKcjuHgROCanHqvkaXM=; b=K5ENAu3HV4JLuhR051NMX1URWsfKO6mml2nZ+n4H66FPkVGi4xjv3RBrG1Jdo7KglF 3FnJCZZPBB/k5+CVBE01uvXfjdPZxPUhazyTQIsTKzxgwC5jC/+KwMtZvgwqokhe4ei2 G6vD4L0/NDC1B4wEkMvYGrYYRc5yiKD/LPNXwrLPwcOpYrwRWh1aMT5y4pY+VYioio9+ pLJrKIRKGUSwwNiaQALJBjtSQKPzEKScNCg5jHl6oUzxj4/j6gmet14x7MIbpGN63HIB jw5zY9RScEJluIN/Yx4i1Si+6RZm7o5s9ggeuMB4nDhB8XIx71xorP3LSyIVkxtiwB7N ybbQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=CYR+iijX; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-163558-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163558-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id m11-20020a63fd4b000000b005dc8280f3b1si21896587pgj.303.2024.04.30.01.43.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 01:43:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163558-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=CYR+iijX; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-163558-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163558-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C8758B22CA6 for ; Tue, 30 Apr 2024 08:41:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F2AA919DF71; Tue, 30 Apr 2024 08:39:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="CYR+iijX" Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A50E5127E05; Tue, 30 Apr 2024 08:39:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714466366; cv=none; b=dFWounQ5MsDFIvjVs11DShuFXROJYpPxeth8rkiztYvVHOM6MX+L9A2UAuOfos0QNPqAR4eUZqkVcb3Ka8r9WnXxRJuKne+pRyVQpjkUaYPhIOoHHwOMUkmECRgZaIPaD67pKXHgOSf1V7THPl/s9lqKdoV9sfOr40enUljFytY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714466366; c=relaxed/simple; bh=pPIRCQnCQ54gleMHzSJgynVz1ieLpAHzSMf1eRn4xpc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FecCaoDY7cbPLzXErxkaG6Fcj+zLT8m8JfNhNKwNiDHt31guld1BxhJniAKrWjKyJrWwSHS06qGC9rzix6ZNgLSVlB5LOobR7ypMs4HUyaCxOMgvia7oTA1ApGwHRi6/yMGVyBy2HFPyuT20/c6S+elB482fKhsBhkDRBGVwya0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=CYR+iijX; arc=none smtp.client-ip=217.70.183.200 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPA id 6C5F62000B; Tue, 30 Apr 2024 08:39:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714466362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=d5YbcXC52ww526burA7UWFbg9yga41Sb6wn1P/AlvTU=; b=CYR+iijXYHPyEiqnx/a6T1Ywhq1GpJRb33mcIqa0sWGRBTzYskWJ37NbriQ7KbCIGg+MbC yr+I66X2h1KHobrrbkVVmZTiZkd2ek5UejeyML0Toq57SjSpzVk6Yq1BySS9HqKRzkcHQe APlDG3MgOOGKDNAV6Ohx8FBqmCvsV81Am2at7qCjOGfgFkkkywyqsnvelCRdsCFwA+hsZZ Sexj5w2EfPRSWqjxdME2KBfSUomSPIEQE5T7o/qnnUJSBnUJjd1WrWgkONlwUXjeQOcfEN ieimIcMD9QlPcxAeojY8/HqPPjEPrzeqIIuEo9oMCITGltbaKRvvgC0euMHBaw== From: Herve Codina To: Herve Codina , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lee Jones , Arnd Bergmann , Horatiu Vultur , UNGLinuxDriver@microchip.com, Andrew Lunn , Heiner Kallweit , Russell King , Saravana Kannan , Bjorn Helgaas , Philipp Zabel , Lars Povlsen , Steen Hegelund , Daniel Machon , Alexandre Belloni Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Allan Nielsen , Steen Hegelund , Luca Ceresoli , Thomas Petazzoni , stable@vger.kernel.org Subject: [PATCH 08/17] net: lan966x: remove debugfs directory in probe() error path Date: Tue, 30 Apr 2024 10:37:17 +0200 Message-ID: <20240430083730.134918-9-herve.codina@bootlin.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240430083730.134918-1-herve.codina@bootlin.com> References: <20240430083730.134918-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com A debugfs directory entry is create early during probe(). This entry is not removed on error path leading to some "already present" issues in case of EPROBE_DEFER. Create this entry later in the probe() code to avoid the need to change many 'return' in 'goto' and add the removal in the already present error path. Fixes: 942814840127 ("net: lan966x: Add VCAP debugFS support") Cc: Signed-off-by: Herve Codina --- drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c index 2635ef8958c8..61d88207eed4 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c @@ -1087,8 +1087,6 @@ static int lan966x_probe(struct platform_device *pdev) platform_set_drvdata(pdev, lan966x); lan966x->dev = &pdev->dev; - lan966x->debugfs_root = debugfs_create_dir("lan966x", NULL); - if (!device_get_mac_address(&pdev->dev, mac_addr)) { ether_addr_copy(lan966x->base_mac, mac_addr); } else { @@ -1179,6 +1177,8 @@ static int lan966x_probe(struct platform_device *pdev) return dev_err_probe(&pdev->dev, -ENODEV, "no ethernet-ports child found\n"); + lan966x->debugfs_root = debugfs_create_dir("lan966x", NULL); + /* init switch */ lan966x_init(lan966x); lan966x_stats_init(lan966x); @@ -1257,6 +1257,8 @@ static int lan966x_probe(struct platform_device *pdev) destroy_workqueue(lan966x->stats_queue); mutex_destroy(&lan966x->stats_lock); + debugfs_remove_recursive(lan966x->debugfs_root); + return err; } -- 2.44.0