Skip to content

Commit 35bdb5d

Browse files
khfengrafaeljw
authored andcommitted
PCI: hisi: Use devm_ghes_register_vendor_record_notifier()
Switch to the device-managed variant so the notifier is automatically unregistered on device removal, allowing the open-coded remove callback to be dropped entirely. Signed-off-by: Kai-Heng Feng <kaihengf@nvidia.com> Acked-by: Manivannan Sadhasivam <mani@kernel.org> Reviewed-by: Shiju Jose <shiju.jose@huawei.com> Link: https://patch.msgid.link/20260330094203.38022-3-kaihengf@nvidia.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 441fa10 commit 35bdb5d

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

drivers/pci/controller/pcie-hisi-error.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -287,25 +287,16 @@ static int hisi_pcie_error_handler_probe(struct platform_device *pdev)
287287

288288
priv->nb.notifier_call = hisi_pcie_notify_error;
289289
priv->dev = &pdev->dev;
290-
ret = ghes_register_vendor_record_notifier(&priv->nb);
290+
ret = devm_ghes_register_vendor_record_notifier(&pdev->dev, &priv->nb);
291291
if (ret) {
292292
dev_err(&pdev->dev,
293293
"Failed to register hisi pcie controller error handler with apei\n");
294294
return ret;
295295
}
296296

297-
platform_set_drvdata(pdev, priv);
298-
299297
return 0;
300298
}
301299

302-
static void hisi_pcie_error_handler_remove(struct platform_device *pdev)
303-
{
304-
struct hisi_pcie_error_private *priv = platform_get_drvdata(pdev);
305-
306-
ghes_unregister_vendor_record_notifier(&priv->nb);
307-
}
308-
309300
static const struct acpi_device_id hisi_pcie_acpi_match[] = {
310301
{ "HISI0361", 0 },
311302
{ }
@@ -317,7 +308,6 @@ static struct platform_driver hisi_pcie_error_handler_driver = {
317308
.acpi_match_table = hisi_pcie_acpi_match,
318309
},
319310
.probe = hisi_pcie_error_handler_probe,
320-
.remove = hisi_pcie_error_handler_remove,
321311
};
322312
module_platform_driver(hisi_pcie_error_handler_driver);
323313

0 commit comments

Comments
 (0)