Skip to content

Commit cf85e7c

Browse files
westeriandy-shev
authored andcommitted
platform/x86: intel_pmc_ipc: Switch to use driver->dev_groups
The driver core provides support for adding additional attributes for devices via new ->dev_groups member of struct device_driver. Convert the driver to use that instead of adding the attributes manually. Suggested-by: Andy Shevchenko <[email protected]> Signed-off-by: Mika Westerberg <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent fc07ac6 commit cf85e7c

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

drivers/platform/x86/intel_pmc_ipc.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,11 @@ static const struct attribute_group intel_ipc_group = {
539539
.attrs = intel_ipc_attrs,
540540
};
541541

542+
static const struct attribute_group *intel_ipc_groups[] = {
543+
&intel_ipc_group,
544+
NULL
545+
};
546+
542547
static struct resource punit_res_array[] = {
543548
/* Punit BIOS */
544549
{
@@ -879,18 +884,10 @@ static int ipc_plat_probe(struct platform_device *pdev)
879884
goto err_irq;
880885
}
881886

882-
ret = sysfs_create_group(&pdev->dev.kobj, &intel_ipc_group);
883-
if (ret) {
884-
dev_err(&pdev->dev, "Failed to create sysfs group %d\n",
885-
ret);
886-
goto err_sys;
887-
}
888-
889887
ipcdev.has_gcr_regs = true;
890888

891889
return 0;
892-
err_sys:
893-
devm_free_irq(&pdev->dev, ipcdev.irq, &ipcdev);
890+
894891
err_irq:
895892
platform_device_unregister(ipcdev.tco_dev);
896893
platform_device_unregister(ipcdev.punit_dev);
@@ -901,7 +898,6 @@ static int ipc_plat_probe(struct platform_device *pdev)
901898

902899
static int ipc_plat_remove(struct platform_device *pdev)
903900
{
904-
sysfs_remove_group(&pdev->dev.kobj, &intel_ipc_group);
905901
devm_free_irq(&pdev->dev, ipcdev.irq, &ipcdev);
906902
platform_device_unregister(ipcdev.tco_dev);
907903
platform_device_unregister(ipcdev.punit_dev);
@@ -916,6 +912,7 @@ static struct platform_driver ipc_plat_driver = {
916912
.driver = {
917913
.name = "pmc-ipc-plat",
918914
.acpi_match_table = ACPI_PTR(ipc_acpi_ids),
915+
.dev_groups = intel_ipc_groups,
919916
},
920917
};
921918

0 commit comments

Comments
 (0)