mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 12:53:14 +01:00
ACPI: APEI: GHES: Add devm_ghes_register_vendor_record_notifier()
Add a device-managed wrapper around ghes_register_vendor_record_notifier() so drivers can avoid manual cleanup on device removal or probe failure. Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Breno Leitao <[email protected]> Reviewed-by: Shiju Jose <[email protected]> Reviewed-by: Shuai Xue <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
1 parent
591cd656a1
commit
441fa10a5a
2 files changed
+29
No files matched your search
@@ -689,6 +689,24 @@ void ghes_unregister_vendor_record_notifier(struct notifier_block *nb)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ghes_unregister_vendor_record_notifier);
|
||||
|
||||
static void ghes_vendor_record_notifier_destroy(void *nb)
|
||||
{
|
||||
ghes_unregister_vendor_record_notifier(nb);
|
||||
}
|
||||
|
||||
int devm_ghes_register_vendor_record_notifier(struct device *dev,
|
||||
struct notifier_block *nb)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = ghes_register_vendor_record_notifier(nb);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return devm_add_action_or_reset(dev, ghes_vendor_record_notifier_destroy, nb);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(devm_ghes_register_vendor_record_notifier);
|
||||
|
||||
static void ghes_vendor_record_work_func(struct work_struct *work)
|
||||
{
|
||||
struct ghes_vendor_record_entry *entry;
|
||||
|
||||
@@ -71,6 +71,17 @@ int ghes_register_vendor_record_notifier(struct notifier_block *nb);
|
||||
*/
|
||||
void ghes_unregister_vendor_record_notifier(struct notifier_block *nb);
|
||||
|
||||
/**
|
||||
* devm_ghes_register_vendor_record_notifier - device-managed vendor
|
||||
* record notifier registration.
|
||||
* @dev: device that owns the notifier lifetime
|
||||
* @nb: pointer to the notifier_block structure of the vendor record handler
|
||||
*
|
||||
* Return: 0 on success, negative errno on failure.
|
||||
*/
|
||||
int devm_ghes_register_vendor_record_notifier(struct device *dev,
|
||||
struct notifier_block *nb);
|
||||
|
||||
struct list_head *ghes_get_devices(void);
|
||||
|
||||
void ghes_estatus_pool_region_free(unsigned long addr, u32 size);
|
||||
|
||||
Reference in new issue
Block a user