platform-driver-x86.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Pearson <markpearson@lenovo.com>
To: Hans de Goede <hdegoede@redhat.com>,
	Mark Gross <mgross@linux.intel.com>,
	Andy Shevchenko <andy@infradead.org>
Cc: <platform-driver-x86@vger.kernel.org>
Subject: Re: [External]Re: [PATCH 1/3] platform/x86: think-lmi: Move pending_reboot_attr to the attributes sysfs dir
Date: Mon, 19 Jul 2021 08:49:11 -0400	[thread overview]
Message-ID: <8556523c-ec3a-0c2d-f996-55ba2d3da91e@lenovo.com> (raw)
In-Reply-To: <a46014f5-39e9-62bc-eaac-bfb2874af275@redhat.com>

On 2021-07-17 11:27 a.m., Hans de Goede wrote:
> Hi,
> 
> On 7/17/21 4:36 PM, Hans de Goede wrote:
>> From: Mark Pearson <markpearson@lenovo.com>
>>
>> Move the pending_reboot node under attributes dir where it should live, as
>> documented in: Documentation/ABI/testing/sysfs-class-firmware-attributes.
>>
>> Also move the create / remove code to be together with the other code
>> populating / cleaning the attributes sysfs dir. In the removal path this
>> is necessary so that the remove is done before the
>> kset_unregister(tlmi_priv.attribute_kset) call.
>>
>> Signed-off-by: Mark Pearson <markpearson@lenovo.com>
>> Co-developed-by: Hans de Goede <hdegoede@redhat.com>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> 
> I've added this series to my review-hans and the pdx86/fixes
> branches now.
> 
Thanks Hans - they all look good to me.
I'll do some testing on a couple of my systems to confirm no issues

Mark
> Regards,
> 
> Hans
> 
> 
>> ---
>>   drivers/platform/x86/think-lmi.c | 11 +++++------
>>   1 file changed, 5 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c
>> index 64dcec53a7a0..989a8221dcd8 100644
>> --- a/drivers/platform/x86/think-lmi.c
>> +++ b/drivers/platform/x86/think-lmi.c
>> @@ -672,6 +672,7 @@ static void tlmi_release_attr(void)
>>   			kobject_put(&tlmi_priv.setting[i]->kobj);
>>   		}
>>   	}
>> +	sysfs_remove_file(&tlmi_priv.attribute_kset->kobj, &pending_reboot.attr);
>>   	kset_unregister(tlmi_priv.attribute_kset);
>>   
>>   	/* Authentication structures */
>> @@ -680,7 +681,6 @@ static void tlmi_release_attr(void)
>>   	sysfs_remove_group(&tlmi_priv.pwd_power->kobj, &auth_attr_group);
>>   	kobject_put(&tlmi_priv.pwd_power->kobj);
>>   	kset_unregister(tlmi_priv.authentication_kset);
>> -	sysfs_remove_file(&tlmi_priv.class_dev->kobj, &pending_reboot.attr);
>>   }
>>   
>>   static int tlmi_sysfs_init(void)
>> @@ -733,6 +733,10 @@ static int tlmi_sysfs_init(void)
>>   			goto fail_create_attr;
>>   	}
>>   
>> +	ret = sysfs_create_file(&tlmi_priv.attribute_kset->kobj, &pending_reboot.attr);
>> +	if (ret)
>> +		goto fail_create_attr;
>> +
>>   	/* Create authentication entries */
>>   	tlmi_priv.authentication_kset = kset_create_and_add("authentication", NULL,
>>   								&tlmi_priv.class_dev->kobj);
>> @@ -760,11 +764,6 @@ static int tlmi_sysfs_init(void)
>>   	if (ret)
>>   		goto fail_create_attr;
>>   
>> -	/* Create global sysfs files */
>> -	ret = sysfs_create_file(&tlmi_priv.class_dev->kobj, &pending_reboot.attr);
>> -	if (ret)
>> -		goto fail_create_attr;
>> -
>>   	return ret;
>>   
>>   fail_create_attr:
>>
> 

      reply	other threads:[~2021-07-19 12:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-17 14:36 [PATCH 1/3] platform/x86: think-lmi: Move pending_reboot_attr to the attributes sysfs dir Hans de Goede
2021-07-17 14:36 ` [PATCH 2/3] platform/x86: think-lmi: Split kobject_init() and kobject_add() calls Hans de Goede
2021-07-17 14:36 ` [PATCH 3/3] platform/x86: think-lmi: Fix possible mem-leaks on tlmi_analyze() error-exit Hans de Goede
2021-07-17 15:27 ` [PATCH 1/3] platform/x86: think-lmi: Move pending_reboot_attr to the attributes sysfs dir Hans de Goede
2021-07-19 12:49   ` Mark Pearson [this message]

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=8556523c-ec3a-0c2d-f996-55ba2d3da91e@lenovo.com \
    --to=markpearson@lenovo.com \
    --cc=andy@infradead.org \
    --cc=hdegoede@redhat.com \
    --cc=mgross@linux.intel.com \
    --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;
as well as URLs for NNTP newsgroup(s).