X86 platform drivers
 help / color / mirror / Atom feed
From: Oleksij Rempel <linux@rempel-privat.de>
To: Darren Hart <dvhart@infradead.org>
Cc: corentin.chary@gmail.com, acpi4asus-user@lists.sourceforge.net,
	platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH] asus-wmi: restore kbd led level after resume
Date: Mon, 21 Sep 2015 19:28:59 +0200	[thread overview]
Message-ID: <56003E5B.8040402@rempel-privat.de> (raw)
In-Reply-To: <20150921171243.GB117557@vmdeb7>

[-- Attachment #1: Type: text/plain, Size: 2742 bytes --]

Am 21.09.2015 um 19:12 schrieb Darren Hart:
> On Sat, Sep 19, 2015 at 07:45:31AM +0200, Oleksij Rempel wrote:
>> Hi,
>>
>> Am 19.09.2015 um 00:31 schrieb Darren Hart:
>>> On Mon, Sep 14, 2015 at 11:16:30AM +0200, Oleksij Rempel wrote:
>>>> Afters suspend/resume cycle with closed lid the kbd backlight level
>>>> is lost. This patch will will restore this value to last known level.
>>>>
>>>> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
>>>
>>> Hi Oleksij,
>>>
>>> Please always run scripts/get_maintainer.pl -f path/to/files/changed
>>>
>>> And include *all* the maintainers and lists on Cc. This will ensure a faster
>>> response.
>>>
>>>> ---
>>>>  drivers/platform/x86/asus-wmi.c | 19 +++++++++++++++++--
>>>>  1 file changed, 17 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
>>>> index efbc3f0..1f7d80f 100644
>>>> --- a/drivers/platform/x86/asus-wmi.c
>>>> +++ b/drivers/platform/x86/asus-wmi.c
>>>> @@ -582,7 +582,7 @@ static void asus_wmi_led_exit(struct asus_wmi *asus)
>>>>  
>>>>  static int asus_wmi_led_init(struct asus_wmi *asus)
>>>>  {
>>>> -	int rv = 0;
>>>> +	int rv = 0, led_val;
>>>>  
>>>>  	asus->led_workqueue = create_singlethread_workqueue("led_workqueue");
>>>>  	if (!asus->led_workqueue)
>>>> @@ -602,9 +602,11 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
>>>>  			goto error;
>>>>  	}
>>>>  
>>>> -	if (kbd_led_read(asus, NULL, NULL) >= 0) {
>>>> +	led_val = kbd_led_read(asus, NULL, NULL);
>>>> +	if (led_val >= 0) {
>>>>  		INIT_WORK(&asus->kbd_led_work, kbd_led_update);
>>>>  
>>>> +		asus->kbd_led_wk = led_val;
>>>>  		asus->kbd_led.name = "asus::kbd_backlight";
>>>>  		asus->kbd_led.brightness_set = kbd_led_set;
>>>>  		asus->kbd_led.brightness_get = kbd_led_get;
>>>> @@ -2160,6 +2162,16 @@ static int asus_hotk_thaw(struct device *device)
>>>>  	return 0;
>>>>  }
>>>>  
>>>> +static int asus_hotk_resume(struct device *device)
>>>> +{
>>>> +	struct asus_wmi *asus = dev_get_drvdata(device);
>>>> +
>>>> +	if (!IS_ERR_OR_NULL(asus->kbd_led.dev))
>>>
>>> 	if (asus->kbd_led.dev)
>>>
>>> 	should be sufficient, I don't see the dev pointer being stored as an
>>> 	errno.
>>>
>>> 	Corentin?
>>
>> led_classdev_register
>>   led_classdev_next_name
>>     device_create_with_groups
>>       device_create_groups_vargs
>>         retval = -ENODEV;
>>         retval = -ENOMEM;
>>         return ERR_PTR(retval);
>>   if (IS_ERR(led_cdev->dev))
>>
>> this is how dev pointer is stored as errno.
> 
> Ah! Thank you for the correction. Noted.
> 

No problem :)
probably it can be optimised in separate patch.

-- 
Regards,
Oleksij


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

  reply	other threads:[~2015-09-21 17:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-14  9:16 [PATCH] asus-wmi: restore kbd led level after resume Oleksij Rempel
     [not found] ` <CAHR064h++fTgHzCNK9oxALROoL=DuoksTykaDrfY2+hBgoyfrQ@mail.gmail.com>
2015-09-15 13:58   ` Corentin Chary
2015-09-18 22:31 ` Darren Hart
2015-09-19  5:45   ` Oleksij Rempel
2015-09-21 17:12     ` Darren Hart
2015-09-21 17:28       ` Oleksij Rempel [this message]
2015-09-25 15:41         ` Darren Hart

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=56003E5B.8040402@rempel-privat.de \
    --to=linux@rempel-privat.de \
    --cc=acpi4asus-user@lists.sourceforge.net \
    --cc=corentin.chary@gmail.com \
    --cc=dvhart@infradead.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox