From nobody Sat Feb 7 21:11:53 2026 Received: from mail-yw1-f178.google.com (mail-yw1-f178.google.com [209.85.128.178]) (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 312671AA7A9; Sat, 21 Dec 2024 07:09:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734764979; cv=none; b=XygDdI3uCRGXSOTWXGo3BGIsEl2jWDwrLU0sjA3UNjNvN8VA+gsDtZDMUEPsDsZNMfAfkOo9YT4T8EuyGiONtlbIBDqKW42mlH6rRPQkz64XPTK/G2+nBOz3nVsk9S1vh6iRwAKtdAKPazH6zh5YYxhgnzE2vgvTETL13rQiiTQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734764979; c=relaxed/simple; bh=rHrYOEQiSwzsyNqESU5IgZGhOMkjQnxtSauNm0Ywmuc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tM3plUHZIbbc90yGosTug/cL9fbIaXga3DhtlXhJGsKpRaMNQWFPD0hha3IJaaK8TqdYZnPaERKDsUrA8xflij9v7wA2J+wUxrbapfGDhV98LE1H/cYc+1uw/JEfT8g3kTd501brlqJFr3fxHe70ksh2AIcUWZ4LoxzJKVTGQss= 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=akQLvrQy; arc=none smtp.client-ip=209.85.128.178 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="akQLvrQy" Received: by mail-yw1-f178.google.com with SMTP id 00721157ae682-6eeca49d8baso24009137b3.0; Fri, 20 Dec 2024 23:09:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734764977; x=1735369777; darn=vger.kernel.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=3PCvMqGqH1fVw7iWJpsBFnnyPu3XWrMWmH8Xe8W+oUI=; b=akQLvrQyvR1062dMvXClhR95lMYS4YKam1HQ6GoSLL9xip0WNi83+8MsW8Q83/py1y QK+/AUb4HxrNmtzSyT2MvNy7aozFx7CHWl/CRB7Etv5MGrxUETN3IT6K9qQFJv/71Gv7 yPA1cqtkcEh4jNB14XqFlzrSry4kPFu1AjRfHzaSf435SS5V0qc4zPMj8new440rwjKX pTkwtDWy+wpXL2nESkfJxdRSAw6nYlcAtuFYotuKKwAohjI2/hDvPWBXnB3RpjDspeCQ PD4fDhn6t+OdZWzA+S6ysj8PrrSt2vR7zmtbgH8pKNmRWm3OCj42B7m8cgXIsG2mOQd4 +6QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734764977; x=1735369777; 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=3PCvMqGqH1fVw7iWJpsBFnnyPu3XWrMWmH8Xe8W+oUI=; b=kEpf4ORB+Rsjh1PK3hhEiL4Fx9rDBpsfZuzp/eyRo5BBeAGTa2U9RfBEALOV2hAntF GJ1UClA2OyM/h077Zb8GX0SvcdW3oK+DvHAs3318IwcgoMg7X+PE9I2DAik1CRhdVDg1 gsrhEtOkeLOOSo0uoaVZK0Os5sLe4I9Ne3DbcEyLZh1any0tGc3R4HLNtGo5KsvqegX+ eIrh1dGa+DCycuBHjpHHUn8UWbyd8XoTzQnvbFwv7dJbdIm+JM/Gt3wpTNaV9ES20V29 MdWlEICFW8SDWWah5NwBsjCP5ekr00vDmFugmWZMkc5ohsYY+yL5ZayzBMFvsu9YNrZd SAgg== X-Forwarded-Encrypted: i=1; AJvYcCU2vDbS27SrV5YOuEIzWM1VXMXVL+qYuQBzE0TVaJ7YX9PlgWTPlbBi9N5Y+RHmBbY88CUktjhUyrkB@vger.kernel.org, AJvYcCXSPOxIMrmbJr9Q4Kpzcfg/2NwsK/o4bNVPM50heokE9Zw/59uQjBzn/0/YK7erFiuFohzbH/iVpHIRVTIz@vger.kernel.org X-Gm-Message-State: AOJu0YySOJcqkoEvOWPvZuMDAbAobfp7NQpoLSB6G9/dk4TQJi5V1bZk oYKNeUNYX7AOW76bq6EASXIKAxhneLNFysX/hoW6WV0VcBRMg2uGP8PYjQ== X-Gm-Gg: ASbGncswEAY01nkrDMMOyPjCzU1pfHpw6gYs7s+bTsoAze3f0D5lalbw0jXDN2GmfqP g0r4LWvv2ZgKemJYSfVaUb7VpXkbV6VmGpVLp1VCcHI7Kx0+rdNiGZyaAZCBvZduFxbyFqEFva3 daFsXfTpremH7S6oYgIq5QnZAjlS9+MuC7kotxZEu8jszFICXjviiyH3MEwBkAdLktv/Gy97V1f un+JA3MaodctAQqZpVb3OdQ5gECHdzi4yYDLvRQImmH2HJTbKALkVug7bdPzosj X-Google-Smtp-Source: AGHT+IHdJCttYS5HUwRlNjfiWhYKUkGpJvYhydw587M04xMH0sda3+632f1ECt+tNkNL5kFSPu1lhQ== X-Received: by 2002:a05:690c:6f04:b0:6e2:41fa:9d4 with SMTP id 00721157ae682-6f3f7ec3e77mr41905537b3.15.1734764976704; Fri, 20 Dec 2024 23:09:36 -0800 (PST) Received: from localhost.localdomain ([2800:bf0:82:1159:1ea9:11b1:7af9:1277]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6f3e7498215sm12367977b3.60.2024.12.20.23.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 23:09:35 -0800 (PST) From: Kurt Borja To: platform-driver-x86@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Mark Pearson , Mario Limonciello , Armin Wolf , Hans de Goede , Gergo Koteles , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Kurt Borja Subject: [PATCH 1/2] ACPI: platform_profile: Add devm_platform_profile_register() Date: Sat, 21 Dec 2024 02:08:18 -0500 Message-ID: <20241221070817.3764-4-kuurtb@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241221070817.3764-2-kuurtb@gmail.com> References: <20241221070817.3764-2-kuurtb@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Platform profile's lifetime is usually tied to a device's lifetime, therefore add a device managed version of platform_profile_register(). Signed-off-by: Kurt Borja --- drivers/acpi/platform_profile.c | 27 +++++++++++++++++++++++++++ include/linux/platform_profile.h | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profil= e.c index 75a1415190ac..d0c88decef8b 100644 --- a/drivers/acpi/platform_profile.c +++ b/drivers/acpi/platform_profile.c @@ -519,6 +519,33 @@ int platform_profile_remove(struct platform_profile_ha= ndler *pprof) } EXPORT_SYMBOL_GPL(platform_profile_remove); =20 +static void devm_platform_profile_release(struct device *dev, void *res) +{ + platform_profile_remove(*(struct platform_profile_handler **) res); +} + +int devm_platform_profile_register(struct platform_profile_handler *pprof) +{ + struct platform_profile_handler **dr; + int ret; + + dr =3D devres_alloc(devm_platform_profile_release, sizeof(*dr), GFP_KERNE= L); + if (!dr) + return -ENOMEM; + + ret =3D platform_profile_register(pprof); + if (ret) { + devres_free(dr); + return ret; + } + + *dr =3D pprof; + devres_add(pprof->dev, dr); + + return 0; +} +EXPORT_SYMBOL_GPL(devm_platform_profile_register); + static int __init platform_profile_init(void) { int err; diff --git a/include/linux/platform_profile.h b/include/linux/platform_prof= ile.h index 0682bb4c57e5..d8114435865b 100644 --- a/include/linux/platform_profile.h +++ b/include/linux/platform_profile.h @@ -41,7 +41,7 @@ struct platform_profile_handler { =20 int platform_profile_register(struct platform_profile_handler *pprof); int platform_profile_remove(struct platform_profile_handler *pprof); +int devm_platform_profile_register(struct platform_profile_handler *pprof); int platform_profile_cycle(void); void platform_profile_notify(struct platform_profile_handler *pprof); - #endif /*_PLATFORM_PROFILE_H_*/ --=20 2.47.1 From nobody Sat Feb 7 21:11:53 2026 Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) (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 617051E9B32; Sat, 21 Dec 2024 07:09:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734764981; cv=none; b=thC0adLuFiFEI+Gl9HXJDSmzTz7+/4hnhMcj9j9azF8cR4Cj2573SP4HpqKFeH8RDEVsL0Oz/4RbNB+Yvw2LrNIZr1D/8NehdK3BrTSg4YG2xM35b7+CU74WGeDvYAOtJPo3U8FNqTSHu8M9yp7TiG00SMXdIIt2/XLtBh8mNv4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734764981; c=relaxed/simple; bh=xok20/shwIlyFfUKXvr7/nxW6Uk8F6oqDmmoEXD5si4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P8Np+mF2iSGmFSwzRucH8iEMG3k0U7j9RYFUo6/SQocD0ah/oKC2rEGElkqKqXylZu29FpwG8iQMkc4fpu7EdNmURNxpqlDACkX729CPE5HrObMobIGn28o5OTsJLz8M0jlKqmQ/gmrRe/A3xFXsmhg/8FjpJA2EPrTXlCWJb7o= 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=VsNuE1aC; arc=none smtp.client-ip=209.85.219.177 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VsNuE1aC" Received: by mail-yb1-f177.google.com with SMTP id 3f1490d57ef6-e46ebe19368so1973572276.0; Fri, 20 Dec 2024 23:09:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734764979; x=1735369779; darn=vger.kernel.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=6swryw7eEVEAx/tXX3Xhx413mPXTzQqpDVNNvnPaYnM=; b=VsNuE1aChXKA/XiKRSMVzg3g7E1sTbdDvAggz+AoyISwNs2WyzOE0hIAEUcdXTh3MF 9bSeQsm033ipVHRE+l0Hk+9z5FlKneBhw5hhfYH5ZTWJCB5kZq5yz1iZT3wUaXA4RGlg nwt+nkPgTh1aP/rAlWep8AKiSVRTF+VNBs1DYEZBbumapzASBh8ArhWIPWOiCHaRmQmV wnVnOOPeyiqGaEGfYVSphfj9rwlBNZTs2dhA2Em9lE9sLhQkQi99d/Qg/Ms/sJiYVWAM yhqt11acO7ghX/uTBD3aE2dlh8U1UykSeg5CKISBcluFte/NfrnbBZUnNdTYSMHCBS1c 3XIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734764979; x=1735369779; 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=6swryw7eEVEAx/tXX3Xhx413mPXTzQqpDVNNvnPaYnM=; b=aaQBSKTsdOhwZXBwQmhkRFOHX6Hww+Y9XZPLzSB/uRP4hXVVzsxkw0Ww2pdAz4C7Gl RT+sX4F6IaMv54tF9OAJFxpPIXWR+Z7X9AFwzpVdKK1KlQ5M3v25PghnGyGpuZtwO3mG iU2BxLfSxQlHOKUfNPt0ISb51viD5L5cbYtrK/Ryue+Y2gPRlkwv+jytwhXkpKeO96ZL 6VItOVrMnFpBDU8fX3FE9h+nCGyuevlRCmGlkFAsDd583cKImzl9qy1uLLS/197mksCe uXO2UBaf4KC04s0Hj1ntIKkKnGqjxN64J+Y92tfJA0Dl8Sx3dQbviTlpCxa+jbLK1wTH 0+9Q== X-Forwarded-Encrypted: i=1; AJvYcCXOJvaFx9wI2kUcOW/cdwkrE5OhJcTFMtmEQ5RME1xYLr1etZ2h1Sp4nZWMJNYEXqN0a/xYA9mqvRsPwnXQ@vger.kernel.org, AJvYcCXb7/3/5MRwxTqLvoHVK5WElZ5Qn1KWISpiFnqArtAwzYzaMT4VGpJXAR64PhPILmMi5bLvZIz6mrHS@vger.kernel.org X-Gm-Message-State: AOJu0YzGm+hJzvHD/OdERBCu3Tw+8r2EephU2Hnl2rWwvdtQycWsKbQ5 znK64znX3zo+4I7Px4Yup9ORGTY+q+8+CxapXZ1D41BTHcbyGfNq9DFGTw== X-Gm-Gg: ASbGncvXPplKLPdXHYVl4B9iNlgjIJPxr5TNFAC3uaqd2j8/sqWqMHufN5BO/G6rtKC VRrKf6EOhKL0FFtLWpfmmMIf54mdYNPVCXUcVyvXaZokbyeF5NgzYQDcxIikcrpJKesK8fTTJgT bmC1oRdaHmmguipC2KyzBUp5mpy6hlZHNRlWQFHbQw6toythnUMTFiGk2eVi2PwA0ues8q8Ra0I 4a90VERcWca4fwkojKa4oP7t4O57/jHzVaL2zT9Bujeis4I227+zgsegqLvnbrn X-Google-Smtp-Source: AGHT+IFgbMzcAcMzcnjgTO1GN0CDUU2IrttLGoKFZM2+f6lhgvIyhvDnYSHdlvC3CR3/+HPYYhEUMg== X-Received: by 2002:a05:690c:5b41:b0:6ef:7f89:d8fa with SMTP id 00721157ae682-6f3f8216c0fmr30312657b3.32.1734764979038; Fri, 20 Dec 2024 23:09:39 -0800 (PST) Received: from localhost.localdomain ([2800:bf0:82:1159:1ea9:11b1:7af9:1277]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6f3e7498215sm12367977b3.60.2024.12.20.23.09.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 23:09:38 -0800 (PST) From: Kurt Borja To: platform-driver-x86@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Mark Pearson , Mario Limonciello , Armin Wolf , Hans de Goede , Gergo Koteles , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Kurt Borja Subject: [PATCH 2/2] alienware-wmi: Use devm_platform_profile_register() Date: Sat, 21 Dec 2024 02:08:19 -0500 Message-ID: <20241221070817.3764-5-kuurtb@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241221070817.3764-2-kuurtb@gmail.com> References: <20241221070817.3764-2-kuurtb@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Replace platform_profile_register() with it's device managed version. Drop remove_thermal_profile() because it's no longer needed. Signed-off-by: Kurt Borja Reviewed-by: Armin Wolf --- drivers/platform/x86/dell/alienware-wmi.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/platform/x86/dell/alienware-wmi.c b/drivers/platform/x= 86/dell/alienware-wmi.c index e95d22c7b60c..7b3ee2d6a23d 100644 --- a/drivers/platform/x86/dell/alienware-wmi.c +++ b/drivers/platform/x86/dell/alienware-wmi.c @@ -1159,13 +1159,7 @@ static int create_thermal_profile(struct platform_de= vice *platform_device) pp_handler.name =3D "alienware-wmi"; pp_handler.dev =3D &platform_device->dev; =20 - return platform_profile_register(&pp_handler); -} - -static void remove_thermal_profile(void) -{ - if (quirks->thermal) - platform_profile_remove(&pp_handler); + return devm_platform_profile_register(&pp_handler); } =20 static int __init alienware_wmi_init(void) @@ -1239,7 +1233,6 @@ static int __init alienware_wmi_init(void) =20 fail_prep_zones: alienware_zone_exit(platform_device); - remove_thermal_profile(); fail_prep_thermal_profile: fail_prep_deepsleep: fail_prep_amplifier: @@ -1260,7 +1253,6 @@ static void __exit alienware_wmi_exit(void) if (platform_device) { alienware_zone_exit(platform_device); remove_hdmi(platform_device); - remove_thermal_profile(); platform_device_unregister(platform_device); platform_driver_unregister(&platform_driver); } --=20 2.47.1