public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fixes: ae834a549ec1 ("platform/x86: asus-wmi: add support variant of TUF RGB")
@ 2024-07-13  7:40 Luke D. Jones
  2024-07-15  9:27 ` Ilpo Järvinen
  0 siblings, 1 reply; 3+ messages in thread
From: Luke D. Jones @ 2024-07-13  7:40 UTC (permalink / raw)
  To: platform-driver-x86
  Cc: corentin.chary, hdegoede, ilpo.jarvinen, linux-kernel,
	Luke D. Jones, Denis Benato

In kbd_rgb_mode_store the dev_get_drvdata() call was assuming the device
data was asus_wmi when it was actually led_classdev.

This patch corrects this by making the correct chain of calls to get the
asus_wmi driver data.

Tested-by: Denis Benato <benato.denis96@gmail.com>
Signed-off-by: Luke D. Jones <luke@ljones.dev>
---
 drivers/platform/x86/asus-wmi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 799d928c7d3d..2935af013535 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -879,10 +879,14 @@ static ssize_t kbd_rgb_mode_store(struct device *dev,
 				 struct device_attribute *attr,
 				 const char *buf, size_t count)
 {
-	struct asus_wmi *asus = dev_get_drvdata(dev);
 	u32 cmd, mode, r, g, b, speed;
+	struct led_classdev *led;
+	struct asus_wmi *asus;
 	int err;
 
+	led = dev_get_drvdata(dev);
+	asus = container_of(led, struct asus_wmi, kbd_led);
+
 	if (sscanf(buf, "%d %d %d %d %d %d", &cmd, &mode, &r, &g, &b, &speed) != 6)
 		return -EINVAL;
 
-- 
2.45.2


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

* Re: [PATCH] Fixes: ae834a549ec1 ("platform/x86: asus-wmi: add support variant of TUF RGB")
  2024-07-13  7:40 [PATCH] Fixes: ae834a549ec1 ("platform/x86: asus-wmi: add support variant of TUF RGB") Luke D. Jones
@ 2024-07-15  9:27 ` Ilpo Järvinen
  2024-07-16  1:00   ` Luke Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Ilpo Järvinen @ 2024-07-15  9:27 UTC (permalink / raw)
  To: Luke D. Jones
  Cc: platform-driver-x86, corentin.chary, Hans de Goede, LKML,
	Denis Benato

On Sat, 13 Jul 2024, Luke D. Jones wrote:

> In kbd_rgb_mode_store the dev_get_drvdata() call was assuming the device
> data was asus_wmi when it was actually led_classdev.
> 
> This patch corrects this by making the correct chain of calls to get the
> asus_wmi driver data.
> 
> Tested-by: Denis Benato <benato.denis96@gmail.com>
> Signed-off-by: Luke D. Jones <luke@ljones.dev>

Your tags seem messed up, Fixes is in Subject in place of shortlog that is 
completely missing.

Could you please correct these issues and resubmit, thank you.


-- 
 i.

> ---
>  drivers/platform/x86/asus-wmi.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index 799d928c7d3d..2935af013535 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -879,10 +879,14 @@ static ssize_t kbd_rgb_mode_store(struct device *dev,
>  				 struct device_attribute *attr,
>  				 const char *buf, size_t count)
>  {
> -	struct asus_wmi *asus = dev_get_drvdata(dev);
>  	u32 cmd, mode, r, g, b, speed;
> +	struct led_classdev *led;
> +	struct asus_wmi *asus;
>  	int err;
>  
> +	led = dev_get_drvdata(dev);
> +	asus = container_of(led, struct asus_wmi, kbd_led);
> +
>  	if (sscanf(buf, "%d %d %d %d %d %d", &cmd, &mode, &r, &g, &b, &speed) != 6)
>  		return -EINVAL;
>  
> 

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

* Re: [PATCH] Fixes: ae834a549ec1 ("platform/x86: asus-wmi: add support variant of TUF RGB")
  2024-07-15  9:27 ` Ilpo Järvinen
@ 2024-07-16  1:00   ` Luke Jones
  0 siblings, 0 replies; 3+ messages in thread
From: Luke Jones @ 2024-07-16  1:00 UTC (permalink / raw)
  To: Ilpo Järvinen
  Cc: platform-driver-x86, corentin.chary, Hans de Goede, LKML,
	Denis Benato

On Mon, 15 Jul 2024, at 9:27 PM, Ilpo Järvinen wrote:
> On Sat, 13 Jul 2024, Luke D. Jones wrote:
> 
> > In kbd_rgb_mode_store the dev_get_drvdata() call was assuming the device
> > data was asus_wmi when it was actually led_classdev.
> > 
> > This patch corrects this by making the correct chain of calls to get the
> > asus_wmi driver data.
> > 
> > Tested-by: Denis Benato <benato.denis96@gmail.com>
> > Signed-off-by: Luke D. Jones <luke@ljones.dev>
> 
> Your tags seem messed up, Fixes is in Subject in place of shortlog that is 
> completely missing.
> 
> Could you please correct these issues and resubmit, thank you.

Looks like I misunderstood something somewhere. Will resubmit.

> 
> -- 
> i.
> 
> > ---
> >  drivers/platform/x86/asus-wmi.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> > index 799d928c7d3d..2935af013535 100644
> > --- a/drivers/platform/x86/asus-wmi.c
> > +++ b/drivers/platform/x86/asus-wmi.c
> > @@ -879,10 +879,14 @@ static ssize_t kbd_rgb_mode_store(struct device *dev,
> >  struct device_attribute *attr,
> >  const char *buf, size_t count)
> >  {
> > - struct asus_wmi *asus = dev_get_drvdata(dev);
> >  u32 cmd, mode, r, g, b, speed;
> > + struct led_classdev *led;
> > + struct asus_wmi *asus;
> >  int err;
> >  
> > + led = dev_get_drvdata(dev);
> > + asus = container_of(led, struct asus_wmi, kbd_led);
> > +
> >  if (sscanf(buf, "%d %d %d %d %d %d", &cmd, &mode, &r, &g, &b, &speed) != 6)
> >  return -EINVAL;
> >  
> > 
> 

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

end of thread, other threads:[~2024-07-16  1:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-13  7:40 [PATCH] Fixes: ae834a549ec1 ("platform/x86: asus-wmi: add support variant of TUF RGB") Luke D. Jones
2024-07-15  9:27 ` Ilpo Järvinen
2024-07-16  1:00   ` Luke Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox