[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200108114201.27908-36-mika.westerberg@linux.intel.com>
Date: Wed, 8 Jan 2020 14:42:00 +0300
From: Mika Westerberg <mika.westerberg@...ux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Darren Hart <dvhart@...radead.org>,
Lee Jones <lee.jones@...aro.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H . Peter Anvin" <hpa@...or.com>, x86@...nel.org,
Zha Qipeng <qipeng.zha@...el.com>,
Rajneesh Bhardwaj <rajneesh.bhardwaj@...ux.intel.com>,
"David E . Box" <david.e.box@...ux.intel.com>,
Guenter Roeck <linux@...ck-us.net>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Wim Van Sebroeck <wim@...ux-watchdog.org>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2 35/36] mfd: intel_pmc_bxt: 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 <andriy.shevchenko@...ux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@...ux.intel.com>
---
drivers/mfd/intel_pmc_bxt.c | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/drivers/mfd/intel_pmc_bxt.c b/drivers/mfd/intel_pmc_bxt.c
index 76f166c1455b..9f2eb75bdf78 100644
--- a/drivers/mfd/intel_pmc_bxt.c
+++ b/drivers/mfd/intel_pmc_bxt.c
@@ -244,6 +244,11 @@ static const struct attribute_group intel_pmc_group = {
.attrs = intel_pmc_attrs,
};
+static const struct attribute_group *intel_pmc_groups[] = {
+ &intel_pmc_group,
+ NULL,
+};
+
static int pmc_create_punit_device(void)
{
struct mfd_cell punit = {
@@ -492,27 +497,14 @@ static int intel_pmc_probe(struct platform_device *pdev)
ret = pmc_create_devices();
if (ret) {
dev_err(&pdev->dev, "Failed to create pmc devices\n");
- goto err_ipc;
- }
-
- ret = sysfs_create_group(&pdev->dev.kobj, &intel_pmc_group);
- if (ret) {
- dev_err(&pdev->dev, "Failed to create sysfs group %d\n",
- ret);
- goto err_ipc;
+ intel_scu_ipc_remove(scu);
}
- return 0;
-
-err_ipc:
- intel_scu_ipc_remove(scu);
-
return ret;
}
static int intel_pmc_remove(struct platform_device *pdev)
{
- sysfs_remove_group(&pdev->dev.kobj, &intel_pmc_group);
intel_scu_ipc_remove(platform_get_drvdata(pdev));
pmcdev.dev = NULL;
return 0;
@@ -524,6 +516,7 @@ static struct platform_driver intel_pmc_driver = {
.driver = {
.name = "intel_pmc_bxt",
.acpi_match_table = ACPI_PTR(intel_pmc_acpi_ids),
+ .dev_groups = intel_pmc_groups,
},
};
--
2.24.1
Powered by blists - more mailing lists