summaryrefslogtreecommitdiff
path: root/drivers/firmware/arm_scpi.c
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2017-12-05 23:16:48 +0100
committerSudeep Holla <sudeep.holla@arm.com>2018-02-23 15:12:33 +0000
commit5abc7935ed5bf70aa69a6001eee8495df43a17c7 (patch)
tree0536176d52be5654cdf74c7b5bc48d5a11545392 /drivers/firmware/arm_scpi.c
parentc14f1db41d0af210986468637f555dfdc72b0d57 (diff)
firmware: arm_scpi: make scpi_probe completely device-managed
Replace two remaining functions in probe with their devm versions. Tested-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'drivers/firmware/arm_scpi.c')
-rw-r--r--drivers/firmware/arm_scpi.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/firmware/arm_scpi.c b/drivers/firmware/arm_scpi.c
index 4447738d4b62..a6f6039ee3f9 100644
--- a/drivers/firmware/arm_scpi.c
+++ b/drivers/firmware/arm_scpi.c
@@ -901,15 +901,10 @@ static void scpi_free_channels(void *data)
static int scpi_remove(struct platform_device *pdev)
{
int i;
- struct device *dev = &pdev->dev;
struct scpi_drvinfo *info = platform_get_drvdata(pdev);
scpi_info = NULL; /* stop exporting SCPI ops through get_scpi_ops */
- of_platform_depopulate(dev);
- sysfs_remove_groups(&dev->kobj, versions_groups);
- platform_set_drvdata(pdev, NULL);
-
for (i = 0; i < MAX_DVFS_DOMAINS && info->dvfs[i]; i++) {
kfree(info->dvfs[i]->opps);
kfree(info->dvfs[i]);
@@ -1036,7 +1031,6 @@ static int scpi_probe(struct platform_device *pdev)
ret = scpi_init_versions(scpi_info);
if (ret) {
dev_err(dev, "incorrect or no SCP firmware found\n");
- scpi_remove(pdev);
return ret;
}
@@ -1048,11 +1042,11 @@ static int scpi_probe(struct platform_device *pdev)
FW_REV_PATCH(scpi_info->firmware_version));
scpi_info->scpi_ops = &scpi_ops;
- ret = sysfs_create_groups(&dev->kobj, versions_groups);
+ ret = devm_device_add_groups(dev, versions_groups);
if (ret)
dev_err(dev, "unable to create sysfs version group\n");
- return of_platform_populate(dev->of_node, NULL, NULL, dev);
+ return devm_of_platform_populate(dev);
}
static const struct of_device_id scpi_of_match[] = {