From patchwork Tue May 21 17:38:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: prabhav kumar X-Patchwork-Id: 13669594 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 389B9C25B74 for ; Tue, 21 May 2024 17:39:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :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=8n7yGFaOn9MGPaOAmGhzbQhNv07mlJypRujRBAv+V18=; b=pW1y34h4IkugT2 ZK7e542gh7VPps650Xr6veN4DbudQfehzEcN5G65ev5P74BJFG2rhlNWBObiQ5x5X4ap5lXSth7tJ CAnd9BY22ffxlKnXfsJghYcYC3+MjpMX1x1c69PVg9yV/djZZ9IVJ3VJVh3OppWEHPKPGrGvBFMpZ cnCG64+GcKu+xiRUrHFwJrMOLxnAe1VNFQxp+IaIYaF6IGnTeh3IO9ScuYe7i2kDhZGEtx8PhNvFQ okKzFHdJMFJGesVqsQgbsaTE9vbj0TSDIeXUYz3IVlQeYfPCmbfwvtdAwA5jW+htCLwglqnJ/aJ1p m4Y7STAz121GXdDTKniQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s9TSE-00000000eFx-32Sb; Tue, 21 May 2024 17:39:14 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s9TSA-00000000eEw-38kj for linux-arm-kernel@lists.infradead.org; Tue, 21 May 2024 17:39:12 +0000 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1eeb1a4c10aso3485025ad.3 for ; Tue, 21 May 2024 10:39:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716313148; x=1716917948; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=uV3GrqVP0qYMNyLcMp5DeTAEtIzneWxCv77ALTeKoVk=; b=SYKbHNStuo3nowYYLQgnIreqfToj5FvM3MWPMgTCPd5oirFz8obTLp1jSumj89m6+9 f/XMKlGUvMDWfUXdCkjkHNIoEessBFUqsqKFRwspBIuVIaFOkUOGtgQm1LWFB8jleOaN xEutPjsnnerC0CV3Jdq5F3yLeZbI4gfI7AeBUjFiaeoaTsNM08jikVR1Ggz3avds0IuJ WgX/PHM6IAV/vdLelzl4JBQjtNvd9DQV1wTF/9TK7w4X158uX8NcAxv8eVcXB02GxnmJ xC7T2gT7aG3hoWcFbEO8kvxhHMy003iZBuPNFyKlyBpS2LsBFhidhav/8W4UXt4qskP9 kB2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716313148; x=1716917948; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uV3GrqVP0qYMNyLcMp5DeTAEtIzneWxCv77ALTeKoVk=; b=ZiqkKS7qfoJSnn6NS1BRDnrDnuviV7ye9CbgmH9rXC8rWf3J/eSKkfVDdENlf9OwYA 7Mjfn1ZIYBkhSHFpSsmDVD3Rv4MvYO1mKO4Ptdcqhcnhns5/k28btbSfo14JOjE47mHL daDXu0R8bo8fXbu8jSgVuZBQ/Hx/qekR7qpuRS402LD1u39sP3JrvMO5PnkUZdt/B6CK hQnq9f19VgIKS3wvMPaLG9kgalFLY0+qMaJ//If5iVU3G2XrR+UP+WM3DE9sIKC+bN2h mUQc6umKRtjbtsbRi8NQWE5uhFmEc3tL5efO9gLqo6mRV1WJ8x+yrYSnQt1o7wUxIIPP oMaw== X-Gm-Message-State: AOJu0YycmpUvL34fh1ussk7BPPA/dG4VXFe5c1hC2w+nzdDNUu+89Jxi eWgRtX3JKT1XG9c3Wv++yY2t9oZavTxE0dwEIw/dy48cnmvtuL9k X-Google-Smtp-Source: AGHT+IGjD6OYIpckFwaXQYt3LAcRXmZvaDuzHbk7bgUa8MB4MekY1TOiVYfkBkDV1dIBIo7GwHFClg== X-Received: by 2002:a17:902:c402:b0:1ee:1fcf:e19a with SMTP id d9443c01a7336-1ef4404adbcmr379970535ad.59.1716313147899; Tue, 21 May 2024 10:39:07 -0700 (PDT) Received: from localhost.localdomain ([27.7.152.139]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f0958d1e3csm112759285ad.191.2024.05.21.10.39.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 10:39:06 -0700 (PDT) From: Prabhav Kumar Vaish To: nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, claudiu.beznea@tuxon.dev Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, julia.lawall@inria.fr, javier.carrasco@wolfvision.net, skhan@linuxfoundation.org, Prabhav Kumar Vaish Subject: [PATCH] drivers: soc: atmel: Automated Cleanup using __free() Date: Tue, 21 May 2024 23:08:57 +0530 Message-Id: <20240521173857.1080030-1-pvkumar5749404@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240521_103910_891407_CA0CAC26 X-CRM114-Status: GOOD ( 12.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Using automated cleanup to replace of_node_put() handling allows for a simplified flow to enable direct returns on errors. Signed-off-by: Prabhav Kumar Vaish --- drivers/soc/atmel/soc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/soc/atmel/soc.c b/drivers/soc/atmel/soc.c index cc9a3e107479..8c7fe37b4f21 100644 --- a/drivers/soc/atmel/soc.c +++ b/drivers/soc/atmel/soc.c @@ -250,7 +250,7 @@ static const struct at91_soc socs[] __initconst = { static int __init at91_get_cidr_exid_from_dbgu(u32 *cidr, u32 *exid) { - struct device_node *np; + struct device_node *np __free(device_node); void __iomem *regs; np = of_find_compatible_node(NULL, NULL, "atmel,at91rm9200-dbgu"); @@ -261,7 +261,6 @@ static int __init at91_get_cidr_exid_from_dbgu(u32 *cidr, u32 *exid) return -ENODEV; regs = of_iomap(np, 0); - of_node_put(np); if (!regs) { pr_warn("Could not map DBGU iomem range");