linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hkallweit1@gmail.com (Heiner Kallweit)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH 03/12] firmware: arm_scpi: make scpi_probe completely device-managed
Date: Tue, 5 Dec 2017 23:16:48 +0100	[thread overview]
Message-ID: <58c40520-bc3f-b4d2-a400-c2b6b18e7422@gmail.com> (raw)
In-Reply-To: <99220c79-8b35-2978-11d1-6d101ccb6772@gmail.com>

Replace two remaining functions in probe with their devm versions.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/firmware/arm_scpi.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/firmware/arm_scpi.c b/drivers/firmware/arm_scpi.c
index 4447738d..a6f6039e 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[] = {
-- 
2.15.1

  parent reply	other threads:[~2017-12-05 22:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-05 21:54 [PATCH 00/12] firmware: arm_scpi: series with smaller improvements Heiner Kallweit
2017-12-05 22:16 ` [PATCH 01/12] firmware: arm_scpi: remove two unneeded devm_kfree's in scpi_remove Heiner Kallweit
2017-12-05 22:16 ` [PATCH 02/12] firmware: arm_scpi: make freeing mbox channels device-managed Heiner Kallweit
2017-12-05 22:16 ` Heiner Kallweit [this message]
2017-12-05 22:16 ` [PATCH 04/12] firmware: arm_scpi: improve struct dvfs_info to make code better readable Heiner Kallweit
2017-12-05 22:16 ` [PATCH 05/12] firmware: arm_scpi: improve handling of protocol and firmware version subfields Heiner Kallweit
2017-12-05 22:16 ` [PATCH 06/12] firmware: arm_scpi: improve struct sensor_value Heiner Kallweit
2017-12-05 22:17 ` [PATCH 07/12] firmware: arm_scpi: drop unnecessary type cast to scpi_shared_mem Heiner Kallweit
2017-12-05 22:17 ` [PATCH 08/12] firmware: arm_scpi: remove all single element structures Heiner Kallweit
2017-12-05 22:17 ` [PATCH 09/12] firmware: arm_scpi: silence sparse warnings Heiner Kallweit
2017-12-05 22:17 ` [PATCH 10/12] firmware: arm_scpi: remove struct sensor_capabilities Heiner Kallweit
2017-12-05 22:17 ` [PATCH 11/12] firmware: arm_scpi: use FIELD_GET/_PREP to simplify macro definitions Heiner Kallweit
2017-12-05 22:17 ` [PATCH 12/12] firmware: arm_scpi: improve info message for pre-1.0 firmware Heiner Kallweit
2018-01-10 16:56 ` [PATCH 00/12] firmware: arm_scpi: series with smaller improvements Sudeep Holla
2018-01-19 18:04   ` Kevin Hilman
2018-02-28 16:32     ` Sudeep Holla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58c40520-bc3f-b4d2-a400-c2b6b18e7422@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=linus-amlogic@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).