[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201022155858.20867-6-nsaenzjulienne@suse.de>
Date: Thu, 22 Oct 2020 17:58:52 +0200
From: Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
To: u.kleine-koenig@...gutronix.de, linux-kernel@...r.kernel.org
Cc: f.fainelli@...il.com, linux-pwm@...r.kernel.org,
bcm-kernel-feedback-list@...adcom.com,
linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
wahrenst@....net, linux-input@...r.kernel.org,
dmitry.torokhov@...il.com, gregkh@...uxfoundation.org,
devel@...verdev.osuosl.org, p.zabel@...gutronix.de,
linux-gpio@...r.kernel.org, linus.walleij@...aro.org,
linux-clk@...r.kernel.org, sboyd@...nel.org,
linux-rpi-kernel@...ts.infradead.org,
Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
Subject: [PATCH v2 05/10] soc: bcm: raspberrypi-power: Release firmware handle on unbind
Upon unbinding the device make sure we release RPi's firmware interface.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
---
drivers/soc/bcm/raspberrypi-power.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/soc/bcm/raspberrypi-power.c b/drivers/soc/bcm/raspberrypi-power.c
index 5d1aacdd84ef..a0b38db5886c 100644
--- a/drivers/soc/bcm/raspberrypi-power.c
+++ b/drivers/soc/bcm/raspberrypi-power.c
@@ -225,6 +225,20 @@ static int rpi_power_probe(struct platform_device *pdev)
return 0;
}
+static int rpi_power_remove(struct platform_device *pdev)
+{
+ struct rpi_power_domains *rpi_domains = platform_get_drvdata(pdev);
+
+ of_genpd_del_provider(dev->of_node);
+
+ for (i = 0; i < RPI_POWER_DOMAIN_COUNT; i++)
+ pm_genpd_remove(&rpi_domains->domains[i].base);
+
+ rpi_firmware_put(rpi_domaina->fw);
+
+ return 0;
+}
+
static const struct of_device_id rpi_power_of_match[] = {
{ .compatible = "raspberrypi,bcm2835-power", },
{},
@@ -237,6 +251,7 @@ static struct platform_driver rpi_power_driver = {
.of_match_table = rpi_power_of_match,
},
.probe = rpi_power_probe,
+ .remove = rpi_power_remove,
};
builtin_platform_driver(rpi_power_driver);
--
2.28.0
Powered by blists - more mailing lists