Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2793281lqt; Tue, 23 Apr 2024 01:28:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV2GTlEwFSw2iw93dqOFmFRoOieasX5gQ59VzV5BG3nN9sW27UIiBvM+8K8A6F2ZJiTgIDY8tr5/uJ6V6QCHCZy81soTQLBxwExD9urUg== X-Google-Smtp-Source: AGHT+IG5elKi7m0SIoA5KcoWG03XKHzRzhPz/Dtgr4cdtjzttbmS9HD6+x8oc5B/LdefNHE3he30 X-Received: by 2002:a25:ef4c:0:b0:dcc:f2a4:153e with SMTP id w12-20020a25ef4c000000b00dccf2a4153emr12050280ybm.46.1713860907933; Tue, 23 Apr 2024 01:28:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713860907; cv=pass; d=google.com; s=arc-20160816; b=DNQ7StIBHlvf43D/HGRErjE91xP1clWFHG3sQYVMZeNKqANLwGqrAVPhAmAYtRrwA/ NbNOJK/x+bYHGjhYAL3CMAfpPj/w4bQMLt+JKdJAniQrpiBpC7MGfmYSF0N+4ErfJV/l vK6+5UbJuJqPE3Nf9Fm0ovB1YCWnYQuS8gTxkz0ur1f2AXOoEm85GTwdaM1C1XKeRtjO Yv5lVY1tm8WfUmBhqxpLTOPKBSC9NTM3fHfSpLCFj5a0/JZmr3Ruvhtb4HMI3LbwFh6A a2x6buSoassn6lWi0Ug2iJzZQ61LGcrRsPug4PtkW6zadiZlGo1gKXZ7lsrE8IxufpuA 1CCw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=xlx4itTMzYZnTqS6gtVBP4dI6YRkemDRngd0L+Y36pA=; fh=ra9QB0ui4wDlVlfCgMMHGc8UGkzwKqaMg7/oIE7RjhU=; b=JUAqmpVr8XN+ZWDrDBrYOrbP5ukXTFNwD34Ul87Z1+ZK+rhMvA+YB0DGU568j0SASC IHXd1eBMcjh2UkTT6daYWyFjENaofpey+y4AOeDLJjVhcnmuVnMxvHqOcJYLJo3ApSnn 446T3e34gFEAjG+6cv9BE6okq5jI3z9fBGlK4vFdRUyR0iD+1c3zI47oHiIY2oRFDFLr aFBMhn9I7S4rE7UvKEZnNAuJGueT8TL4k0y7AxRIW98qHfPQhV1jqkxjY8k4WWLhZcpn 8JUQ3sx0cSTVt2dSKhBtUY0CpeYeLOcPCL+xfnZ9r7asGIcLnmoDkjXTmFyaJHuBFeaz pP2g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XQZJYx6x; 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-154683-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154683-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id g2-20020a0562140ac200b00699307c54c2si12635633qvi.523.2024.04.23.01.28.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 01:28:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154683-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XQZJYx6x; 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-154683-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154683-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9B6BB1C21DB3 for ; Tue, 23 Apr 2024 08:28:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B23C653E2E; Tue, 23 Apr 2024 08:28:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XQZJYx6x" Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (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 57F57524BA; Tue, 23 Apr 2024 08:28:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713860883; cv=none; b=nVg1Sla/y3xkHDTZzeTERAME5pL9IbyTounSkFtynF2Agcz1OvFmnniOCa7EFtph4mAeew+AoozHOCdTjO/qYtpkX/rV1KwsN+ynH88Hgvn7nNdsWKYTZEkFgkJwaYTgfdhotSHZL5dxeoVP1dlc+BQZHbl4oFoUt+qcYKKVxTc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713860883; c=relaxed/simple; bh=W8LjUVAmqv/G+B+i2P0GUBDI1TRWfOmtY46AfJi9z+o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DtZCtBQrYz5IVvPajYqvRZmbwrAyQ+qQUpKXy182Aeq4TqxzIvekdlhQfI7jGq8U+HPapMYVOHImiHF8sCT5xzflhiw4TsDFHNd3OnAOpn8qYHxhSnLxaPjriZRnm1p14uAsOks2Z4o5s9UIzdz4eWbNortI0KUDXYRJGYVomRg= 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=XQZJYx6x; arc=none smtp.client-ip=209.85.208.52 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-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-56e56ee8d5cso6628015a12.2; Tue, 23 Apr 2024 01:28:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713860880; x=1714465680; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=xlx4itTMzYZnTqS6gtVBP4dI6YRkemDRngd0L+Y36pA=; b=XQZJYx6xUFNbe9dyXTfJGXJBpVTacv4NKz0CmLKdD5pDyuFSWadSo5iGDBlA7pm1gj dmQn0/ro/+xDGbmDN2nTqQtQG7R+6gkWyaMBPviahSJIZbb0Yt9NUGdtRfkt+xftwQN+ JQ9Kv6ZdiS4RldTQvaaXoKf3DO6cIp0TwWx4/XJjtbbSqK2WJYzyJyfaZejVVL6+FYTR 1oUZ8zKf12rTTQIZcrmemeRjuBQvW2+Y06BqT50b2n/NyWdj/6ySQT2BkLLemoc4z2aD A1m3JijQUJTrIcRzalSLBD2AfE4bIMtlodYeayI/banpWVo2l16vPwDFbQFWgwmQYLwB N3ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713860880; x=1714465680; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xlx4itTMzYZnTqS6gtVBP4dI6YRkemDRngd0L+Y36pA=; b=POkzTOYeuS5YCU5L/zyaugEZsfFxC2XFSyd2uCml1/89ypkZ89OwVVucd6rWbfoKk3 y8jvmUAU2P/qzXoFC0K1Ll8f6EeyEQDakxWlAFgiRe6akFWe5AABeD/glnh7dl835JmW QRXV3WihCry9XmCn9jyoFOhRQcn/tdTk+bIBMF7CajF5U8qsyS/68WU5O7Ekk+mxTSN2 MSwZRuIBVhj/8xhxN2nLnshDsuugfajAEVU2zF7zkvKqFzOvBH/KWKwq3A3UYVeqNwM/ +LQiLS1Z90cY1SobOhr7yuRVlKcrctk4Rnl9VMpAC+gw6crsi/4TulMyQxSB9859635N PYDg== X-Forwarded-Encrypted: i=1; AJvYcCVeMocfCoq7Aiq0A50bzmpe3bFMoeJC1dcVVI/AVLpzXqbmV2KLCc1fuXyxFeIAcaUFMl5dOjhgIk+8gjGB0EGZmF277r9BbxrCEjrR X-Gm-Message-State: AOJu0YzmheeSUSYCLIqzhciOamxb3mo1LSiI49dq0xzt1GYl85i7X9Y5 jCOg3QniHLe3jMN7HbDsDrT9aF5qAkT6B7jkZYihCl6x0jt65xg3 X-Received: by 2002:a17:906:f8c5:b0:a55:766b:8caf with SMTP id lh5-20020a170906f8c500b00a55766b8cafmr9485194ejb.6.1713860880537; Tue, 23 Apr 2024 01:28:00 -0700 (PDT) Received: from [127.0.1.1] (91-118-163-37.static.upcbusiness.at. [91.118.163.37]) by smtp.gmail.com with ESMTPSA id z13-20020a17090655cd00b00a4739efd7cesm6798786ejp.60.2024.04.23.01.27.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 01:28:00 -0700 (PDT) From: Javier Carrasco Date: Tue, 23 Apr 2024 10:27:45 +0200 Subject: [PATCH 2/2] cpufreq: dt-platdev: eliminate uses of of_node_put() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240423-of_node_put_cpufreq_dt-v1-2-19f51910276f@gmail.com> References: <20240423-of_node_put_cpufreq_dt-v1-0-19f51910276f@gmail.com> In-Reply-To: <20240423-of_node_put_cpufreq_dt-v1-0-19f51910276f@gmail.com> To: "Rafael J. Wysocki" , Viresh Kumar Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Javier Carrasco X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1713860876; l=1568; i=javier.carrasco.cruz@gmail.com; s=20240312; h=from:subject:message-id; bh=W8LjUVAmqv/G+B+i2P0GUBDI1TRWfOmtY46AfJi9z+o=; b=6R9d+vfyMbyfOyLA9B2PJLd8ar7A3d0KSveYfeHYcYbckLNjFMi9yvKi0egueBJEojM7rEHLB F4e5COJCckIBtUCbTy77x3J4zH7004A+ZiPQBv/VKtVTjhiBZoujEwg X-Developer-Key: i=javier.carrasco.cruz@gmail.com; a=ed25519; pk=lzSIvIzMz0JhJrzLXI0HAdPwsNPSSmEn6RbS+PTS9aQ= Make use of the __free() cleanup handler to automatically free nodes when they get out of scope. Signed-off-by: Javier Carrasco --- drivers/cpufreq/cpufreq-dt-platdev.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c index 86d8baa81679..c74dd1e01e0d 100644 --- a/drivers/cpufreq/cpufreq-dt-platdev.c +++ b/drivers/cpufreq/cpufreq-dt-platdev.c @@ -198,19 +198,18 @@ static const struct of_device_id blocklist[] __initconst = { static bool __init cpu0_node_has_opp_v2_prop(void) { - struct device_node *np = of_cpu_device_node_get(0); + struct device_node *np __free(device_node) = of_cpu_device_node_get(0); bool ret = false; if (of_property_present(np, "operating-points-v2")) ret = true; - of_node_put(np); return ret; } static int __init cpufreq_dt_platdev_init(void) { - struct device_node *np = of_find_node_by_path("/"); + struct device_node *np __free(device_node) = of_find_node_by_path("/"); const struct of_device_id *match; const void *data = NULL; @@ -226,11 +225,9 @@ static int __init cpufreq_dt_platdev_init(void) if (cpu0_node_has_opp_v2_prop() && !of_match_node(blocklist, np)) goto create_pdev; - of_node_put(np); return -ENODEV; create_pdev: - of_node_put(np); return PTR_ERR_OR_ZERO(platform_device_register_data(NULL, "cpufreq-dt", -1, data, sizeof(struct cpufreq_dt_platform_data))); -- 2.40.1