Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1785300lqp; Mon, 15 Apr 2024 18:30:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWhskQeChyOtlDl6GKdMfzI4x64T5/229vyMV4PCqo/Xa21S4kfIxOow9epsey7qcYVoBNmVju91TpFzof3znnnJ2hCiYSPcBAkgVcnAQ== X-Google-Smtp-Source: AGHT+IFXrp+vXR1ogu0rNjVzWWmMLYO7hlFKz097pZFkbxoyJROxdZaWz9Unq6O1kOw7s2OdAXzN X-Received: by 2002:a05:6358:38d:b0:183:f469:7655 with SMTP id a13-20020a056358038d00b00183f4697655mr13641007rwj.18.1713231054380; Mon, 15 Apr 2024 18:30:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713231054; cv=pass; d=google.com; s=arc-20160816; b=Oz8co5Nb4UbyjplhKA1tYq46Zgu2zNQgyIDd/g9XTBHC42NqeidO11wIf7M+MvECBG JsU551VbaaxH8EmRv+wHWmfXAUusy+qfFZrmRDu5VZDu7aAwY3ry2kqwm4hHH3eONwlq 4RNZ08uddCCOXJucrri1/hY38rqwH3pu6ffQChAjsdeIxJCQ1aRnUXxZgcXgLxdkLllh nci197eH1K9jhwmmgP/R5bvSdA8An/8J1/bHN7a1BcK11NhMED+aB8Az79N/xdKumz3K q3P8n9nPp8V2/Q6lN+5MoVNpj2c4/q16brgu5qvv5o+pSSs9c9G1STpjJqN0hIE2P9jx XeEw== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=xcz+73pSqE9SfopeTAgajRWWiV1WsHA33Nl/GYOpK3o=; fh=JZHC8le/zwCqgWj2FQbY4EsJJ074/sXEP8PtDYub7vY=; b=nBuW+2od+ESjp4MaNde1D0p6cNLz0v+j59Je5hpXkJW/vNERdX7n8TQ8gVFYiCrpb4 gHjTh1KkFju0VGgatrCVI59k5k5vX2Q9rDfm9gOr1hdqxAR9Fe0wyYLcsYdKCUOUR4+h nBgGXwHbzbXGu4uXabje1/tdCfBgvBRwvsYyMnIMaJ/mkWzGuVI5OlydBMliU38qpIn2 2lNKNuS6O/HAwcMyTz8Fh3okpPn0Tus0JLoamykZ3aKOdrCPampC97VtLTkNDOv/kTKW nAMFGa7Qvf2WwfOddcCr0LvEFj59TzzSPKQTg4luu4xnECgGmGL86Z9GI67IjHCSmdU6 mzvQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VGvM8oGg; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-146086-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146086-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id j14-20020a63230e000000b005f0bc731d64si8612313pgj.514.2024.04.15.18.30.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 18:30:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146086-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VGvM8oGg; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-146086-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146086-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 801EEB2204C for ; Tue, 16 Apr 2024 01:20:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE1255227; Tue, 16 Apr 2024 01:20:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VGvM8oGg" Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 932994C7E for ; Tue, 16 Apr 2024 01:20:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713230428; cv=none; b=Wq2FNu5oZ98KZugEKJe7qmcZKjXBLG6UimSpQ+b9no+EZttWEeXnhqVRSxpAaPJk5ecjduRpDxzYzJq2QVfbv9fW00Hw0quIykkuXlih1xpEjyV2K52bD5lXeDU3y9KD0C8puF0dMOsGQuQK/CUYoWv7QoqqIL1QoMo6ezGy2wM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713230428; c=relaxed/simple; bh=iTXC1HastUkjArtDpmP+czeqPs0RdtUw86qhG4JAjrc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Ffn5hji2P/F/sDYbeL03/JKxuIvVa4ao9j81ikQSvOc7HwDmtuM/ZYXw41aOZb3bK1ZrTABFqaTdFZaRboBIB493GuesZtPwcDmXrSBMHVJQZWC8BFNUp9pnXocrPI4sIc960ocWDJn0lGIdeF7jnMFZLXfHtwIEAjxzFOcDE1A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VGvM8oGg; arc=none smtp.client-ip=209.85.210.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-6ee13f19e7eso2794838b3a.1 for ; Mon, 15 Apr 2024 18:20:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713230424; x=1713835224; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=xcz+73pSqE9SfopeTAgajRWWiV1WsHA33Nl/GYOpK3o=; b=VGvM8oGgJMneFc/sRop+Sz87oJDotGvmwXHuj/qQUdjX93Nl7IdZvG20rnsd2b0cF4 CHi2zBVDHd+GpQuxw0pYOaSuA2CZxniN8s2XRm2LrSauDX13DWtLESkJL+N9ky3vefBx Ld0Wk3eDRA6CP3Fd9PzUnHndF8QBOoPItjIWcw/iAg1zjlUx95mK350n27ASFvEbRGN2 z/gbgbV9tHX24UE91Z1o7JbWKkBKV9WBaQphbNEJahHwE7lgIEkaRw/z22/wJbXSkOzo /GnegE8efLSKZlZUnZQdRkNuS1MncdK7sXBJJsQZPFizzl8dMli9rxoxUImgedEETy4g lRvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713230424; x=1713835224; 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=xcz+73pSqE9SfopeTAgajRWWiV1WsHA33Nl/GYOpK3o=; b=Y3MWUdYr8FC7li/Csfc8y+h7nmd+5s+kkcW++t4BSuGo4DPdw+h5uOd1lubPkmwM+r O+I5qKiPo1pLjbHafAYkmHkRi+wOJGp301MbUxsrnFRgL3bs9Z5LQJ0oq9uLoWcn2Lo2 FmOD8UzxodKRAki9k44pmgPfRhCHYJX0ky1r3rNvEG/irDwPcO8Jz0++1VbycF3LXRjN duYBYroF2Ov6aqQyMBy9hkASVjMLyAuMacDfvvpwKfqyw2h/OPuXLMLYRhR0s+oEkPJS sBVCTvqtjy2X1VXjWzRDaQp/tsO/O1kggkMyH6p8LBbYAgzne7MwW2rmWIjVgIJ0VDEm RoxA== X-Forwarded-Encrypted: i=1; AJvYcCUB2YI1gO+duxIKm5Eqt3MJkzN2AAdNAHISMixGH8oyVgRj2UX//ppiFZzP20fZCPq1FUloIUslyajH9F73Lc1/9G/w9E5HFaaVYmKg X-Gm-Message-State: AOJu0YysH2S5nhfAmPgBhA90LhJRD4G0KRqojvLYfWH7ZuaO3jYSFVxk Uwiln3UQnZINKf0Lp5smZfsvZYp4M3GQ9PBfEDAVyczahhqDUAYQ X-Received: by 2002:a05:6a00:b96:b0:6ec:ea4b:f07a with SMTP id g22-20020a056a000b9600b006ecea4bf07amr11785479pfj.34.1713230423713; Mon, 15 Apr 2024 18:20:23 -0700 (PDT) Received: from mari.. ([2804:431:cfd3:2714:2d55:751b:9f5f:563e]) by smtp.gmail.com with ESMTPSA id y30-20020a056a00181e00b006e6854d45afsm8061866pfa.97.2024.04.15.18.20.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 18:20:23 -0700 (PDT) From: MarileneGarcia To: Srinivas Kandagatla , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Julia Lawall Cc: MarileneGarcia , Shuah Khan , Javier Carrasco , linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] nvmem: meson-efuse: Replacing the use of of_node_put to __free Date: Mon, 15 Apr 2024 22:17:51 -0300 Message-Id: <20240416011751.93016-1-marilene.agarcia@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Use __free for device_node values, and thus drop calls to of_node_put. The goal is to reduce memory management issues by using this scope-based of_node_put() cleanup to simplify function exit handling. When using __free a resource is allocated within a block, it is automatically freed at the end of the block. Suggested-by: Julia Lawall Signed-off-by: MarileneGarcia --- drivers/nvmem/meson-efuse.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/nvmem/meson-efuse.c b/drivers/nvmem/meson-efuse.c index 33678d0af2c2..400a9a075e53 100644 --- a/drivers/nvmem/meson-efuse.c +++ b/drivers/nvmem/meson-efuse.c @@ -42,20 +42,19 @@ static int meson_efuse_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct meson_sm_firmware *fw; - struct device_node *sm_np; struct nvmem_device *nvmem; struct nvmem_config *econfig; struct clk *clk; unsigned int size; + struct device_node *sm_np __free(device_node) = + of_parse_phandle(pdev->dev.of_node, "secure-monitor", 0); - sm_np = of_parse_phandle(pdev->dev.of_node, "secure-monitor", 0); if (!sm_np) { dev_err(&pdev->dev, "no secure-monitor node\n"); return -ENODEV; } fw = meson_sm_get(sm_np); - of_node_put(sm_np); if (!fw) return -EPROBE_DEFER; -- 2.34.1