From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Kurt Borja <kuurtb@gmail.com>
Cc: platform-driver-x86@vger.kernel.org,
"Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
Mario Limonciello <mario.limonciello@amd.com>,
Armin Wolf <W_Armin@gmx.de>,
Joshua Grisham <josh@joshuagrisham.com>,
"Derek J. Clark" <derekjohn.clark@gmail.com>,
Hans de Goede <hdegoede@redhat.com>,
Maximilian Luz <luzmaximilian@gmail.com>,
"Lee, Chun-Yi" <jlee@suse.com>,
Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
Corentin Chary <corentin.chary@gmail.com>,
"Luke D. Jones" <luke@ljones.dev>,
Lyndon Sanche <lsanche@lyndeno.ca>,
Ike Panhc <ike.pan@canonical.com>,
Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
Mark Pearson <mpearson-lenovo@squebb.ca>,
Alexis Belmonte <alexbelm48@gmail.com>,
Ai Chao <aichao@kylinos.cn>, Gergo Koteles <soyer@irl.hu>,
Dell.Client.Kernel@dell.com,
ibm-acpi-devel@lists.sourceforge.net
Subject: Re: [PATCH v3 09/19] platform/x86: asus-wmi: Use devm_platform_profile_register()
Date: Wed, 15 Jan 2025 16:08:35 +0200 (EET) [thread overview]
Message-ID: <9a00d65e-01a8-007f-9918-44b21b194803@linux.intel.com> (raw)
In-Reply-To: <20250115071022.4815-10-kuurtb@gmail.com>
On Wed, 15 Jan 2025, Kurt Borja wrote:
> Replace platform_profile_register() with it's device managed version.
>
> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
> Signed-off-by: Kurt Borja <kuurtb@gmail.com>
> ---
> drivers/platform/x86/asus-wmi.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index 3d77f7454953..f8437cff66df 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -3895,12 +3895,12 @@ static int platform_profile_setup(struct asus_wmi *asus)
> asus->platform_profile_handler.dev = dev;
> asus->platform_profile_handler.ops = &asus_wmi_platform_profile_ops;
>
> - err = platform_profile_register(&asus->platform_profile_handler, asus);
> + err = devm_platform_profile_register(&asus->platform_profile_handler, asus);
> if (err == -EEXIST) {
> pr_warn("%s, a platform_profile handler is already registered\n", __func__);
> return 0;
> } else if (err) {
> - pr_err("%s, failed at platform_profile_register: %d\n", __func__, err);
> + pr_err("%s, failed at devm_platform_profile_register: %d\n", __func__, err);
Hi,
I'm sorry I didn't notice this while passing through the patches
yesterday.
Could you please make this error message plain english instead of piling
even more kernel C specifics to it? Preferrably, an user seeing a kernel
error message should not be required to know/understand any C, so don't
print __func__ nor write function names into any error/warning/info level
messages.
Also, it should use dev_err() I think (platform_profile_setup() seems to
mix pr_*() & dev_*() prints with no good reason).
--
i.
> return err;
> }
>
> @@ -4859,8 +4859,6 @@ static int asus_wmi_add(struct platform_device *pdev)
> fail_sysfs:
> fail_custom_fan_curve:
> fail_platform_profile_setup:
> - if (asus->platform_profile_support)
> - platform_profile_remove(&asus->platform_profile_handler);
> fail_fan_boost_mode:
> fail_platform:
> kfree(asus);
> @@ -4886,9 +4884,6 @@ static void asus_wmi_remove(struct platform_device *device)
> throttle_thermal_policy_set_default(asus);
> asus_wmi_battery_exit(asus);
>
> - if (asus->platform_profile_support)
> - platform_profile_remove(&asus->platform_profile_handler);
> -
> kfree(asus);
> }
>
>
next prev parent reply other threads:[~2025-01-15 14:09 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-15 7:10 [PATCH v3 00/19] Hide platform_profile_handler from consumers Kurt Borja
2025-01-15 7:10 ` [PATCH v3 01/19] ACPI: platform_profile: Replace *class_dev member with class_dev Kurt Borja
2025-01-15 7:10 ` [PATCH v3 02/19] ACPI: platform_profile: Let drivers set drvdata to the class device Kurt Borja
2025-01-15 7:10 ` [PATCH v3 03/19] ACPI: platform_profile: Remove platform_profile_handler from callbacks Kurt Borja
2025-01-15 7:10 ` [PATCH v3 04/19] ACPI: platform_profile: Add `ops` member to handlers Kurt Borja
2025-01-15 7:10 ` [PATCH v3 05/19] ACPI: platform_profile: Add `probe` to platform_profile_ops Kurt Borja
2025-01-15 16:43 ` Mario Limonciello
2025-01-15 7:10 ` [PATCH v3 06/19] platform/surface: surface_platform_profile: Use devm_platform_profile_register() Kurt Borja
2025-01-15 7:10 ` [PATCH v3 07/19] platform/x86: acer-wmi: " Kurt Borja
2025-01-15 7:10 ` [PATCH v3 08/19] platform/x86: amd: pmf: sps: " Kurt Borja
2025-01-15 7:10 ` [PATCH v3 09/19] platform/x86: asus-wmi: " Kurt Borja
2025-01-15 14:08 ` Ilpo Järvinen [this message]
2025-01-15 14:41 ` Kurt Borja
2025-01-15 7:10 ` [PATCH v3 10/19] platform/x86: dell-pc: " Kurt Borja
2025-01-15 7:10 ` [PATCH v3 11/19] platform/x86: ideapad-laptop: " Kurt Borja
2025-01-15 7:10 ` [PATCH v3 12/19] platform/x86: hp-wmi: " Kurt Borja
2025-01-15 7:10 ` [PATCH v3 13/19] platform/x86: inspur_platform_profile: " Kurt Borja
2025-01-15 7:10 ` [PATCH v3 14/19] platform/x86: thinkpad_acpi: " Kurt Borja
2025-01-15 7:10 ` [PATCH v3 15/19] ACPI: platform_profile: Remove platform_profile_handler from exported symbols Kurt Borja
2025-01-15 7:10 ` [PATCH v3 16/19] ACPI: platform_profile: Move platform_profile_handler Kurt Borja
2025-01-15 7:10 ` [PATCH v3 17/19] ACPI: platform_profile: Clean platform_profile_handler Kurt Borja
2025-01-15 7:10 ` [PATCH v3 18/19] ACPI: platform_profile: Add documentation Kurt Borja
2025-01-15 7:10 ` [PATCH v3 19/19] ACPI: platform_profile: Add a prefix to log messages Kurt Borja
2025-01-15 16:45 ` Mario Limonciello
2025-01-15 20:01 ` Kurt Borja
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9a00d65e-01a8-007f-9918-44b21b194803@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=Dell.Client.Kernel@dell.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=W_Armin@gmx.de \
--cc=aichao@kylinos.cn \
--cc=alexbelm48@gmail.com \
--cc=corentin.chary@gmail.com \
--cc=derekjohn.clark@gmail.com \
--cc=hdegoede@redhat.com \
--cc=hmh@hmh.eng.br \
--cc=ibm-acpi-devel@lists.sourceforge.net \
--cc=ike.pan@canonical.com \
--cc=jlee@suse.com \
--cc=josh@joshuagrisham.com \
--cc=kuurtb@gmail.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lsanche@lyndeno.ca \
--cc=luke@ljones.dev \
--cc=luzmaximilian@gmail.com \
--cc=mario.limonciello@amd.com \
--cc=mpearson-lenovo@squebb.ca \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=soyer@irl.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.