platform-driver-x86.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/x86: ideapad-laptop: fix method name typo
@ 2021-05-07 23:53 Barnabás Pőcze
  2021-05-11 11:40 ` Hans de Goede
  0 siblings, 1 reply; 2+ messages in thread
From: Barnabás Pőcze @ 2021-05-07 23:53 UTC (permalink / raw)
  To: hdegoede, mgross, ike.pan, platform-driver-x86; +Cc: stable

"smbc" should be "sbmc". `eval_smbc()` incorrectly called
the SMBC ACPI method instead of SBMC. This resulted in
partial loss of functionality. Rectify that by calling
the correct ACPI method (SBMC), and also rename
methods and constants.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=212985
Fixes: 0b765671cb80 ("platform/x86: ideapad-laptop: group and separate (un)related constants into enums")
Fixes: ff36b0d953dc ("platform/x86: ideapad-laptop: rework and create new ACPI helpers")
Cc: stable@vger.kernel.org # 5.12
Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
---
 drivers/platform/x86/ideapad-laptop.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 6cb5ad4be231..8472aa4c5017 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -57,8 +57,8 @@ enum {
 };

 enum {
-	SMBC_CONSERVATION_ON  = 3,
-	SMBC_CONSERVATION_OFF = 5,
+	SBMC_CONSERVATION_ON  = 3,
+	SBMC_CONSERVATION_OFF = 5,
 };

 enum {
@@ -182,9 +182,9 @@ static int eval_gbmd(acpi_handle handle, unsigned long *res)
 	return eval_int(handle, "GBMD", res);
 }

-static int exec_smbc(acpi_handle handle, unsigned long arg)
+static int exec_sbmc(acpi_handle handle, unsigned long arg)
 {
-	return exec_simple_method(handle, "SMBC", arg);
+	return exec_simple_method(handle, "SBMC", arg);
 }

 static int eval_hals(acpi_handle handle, unsigned long *res)
@@ -477,7 +477,7 @@ static ssize_t conservation_mode_store(struct device *dev,
 	if (err)
 		return err;

-	err = exec_smbc(priv->adev->handle, state ? SMBC_CONSERVATION_ON : SMBC_CONSERVATION_OFF);
+	err = exec_sbmc(priv->adev->handle, state ? SBMC_CONSERVATION_ON : SBMC_CONSERVATION_OFF);
 	if (err)
 		return err;

--
2.31.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] platform/x86: ideapad-laptop: fix method name typo
  2021-05-07 23:53 [PATCH] platform/x86: ideapad-laptop: fix method name typo Barnabás Pőcze
@ 2021-05-11 11:40 ` Hans de Goede
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2021-05-11 11:40 UTC (permalink / raw)
  To: Barnabás Pőcze, mgross, ike.pan, platform-driver-x86; +Cc: stable

Hi,

On 5/8/21 1:53 AM, Barnabás Pőcze wrote:
> "smbc" should be "sbmc". `eval_smbc()` incorrectly called
> the SMBC ACPI method instead of SBMC. This resulted in
> partial loss of functionality. Rectify that by calling
> the correct ACPI method (SBMC), and also rename
> methods and constants.
> 
> BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=212985
> Fixes: 0b765671cb80 ("platform/x86: ideapad-laptop: group and separate (un)related constants into enums")
> Fixes: ff36b0d953dc ("platform/x86: ideapad-laptop: rework and create new ACPI helpers")
> Cc: stable@vger.kernel.org # 5.12
> Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>

Thank you I've added this to my review-hans branch.
I'll also add this to my fixes branch and include it in
a future pdx86 fixes pull-req for Linus for 5.13.

Thank you for your patch, I've applied this patch to my review-hans 
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.

Regards,

Hans



> ---
>  drivers/platform/x86/ideapad-laptop.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
> index 6cb5ad4be231..8472aa4c5017 100644
> --- a/drivers/platform/x86/ideapad-laptop.c
> +++ b/drivers/platform/x86/ideapad-laptop.c
> @@ -57,8 +57,8 @@ enum {
>  };
> 
>  enum {
> -	SMBC_CONSERVATION_ON  = 3,
> -	SMBC_CONSERVATION_OFF = 5,
> +	SBMC_CONSERVATION_ON  = 3,
> +	SBMC_CONSERVATION_OFF = 5,
>  };
> 
>  enum {
> @@ -182,9 +182,9 @@ static int eval_gbmd(acpi_handle handle, unsigned long *res)
>  	return eval_int(handle, "GBMD", res);
>  }
> 
> -static int exec_smbc(acpi_handle handle, unsigned long arg)
> +static int exec_sbmc(acpi_handle handle, unsigned long arg)
>  {
> -	return exec_simple_method(handle, "SMBC", arg);
> +	return exec_simple_method(handle, "SBMC", arg);
>  }
> 
>  static int eval_hals(acpi_handle handle, unsigned long *res)
> @@ -477,7 +477,7 @@ static ssize_t conservation_mode_store(struct device *dev,
>  	if (err)
>  		return err;
> 
> -	err = exec_smbc(priv->adev->handle, state ? SMBC_CONSERVATION_ON : SMBC_CONSERVATION_OFF);
> +	err = exec_sbmc(priv->adev->handle, state ? SBMC_CONSERVATION_ON : SBMC_CONSERVATION_OFF);
>  	if (err)
>  		return err;
> 
> --
> 2.31.1
> 
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-11 11:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-07 23:53 [PATCH] platform/x86: ideapad-laptop: fix method name typo Barnabás Pőcze
2021-05-11 11:40 ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).