lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201022155858.20867-5-nsaenzjulienne@suse.de>
Date:   Thu, 22 Oct 2020 17:58:51 +0200
From:   Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
To:     u.kleine-koenig@...gutronix.de, linux-kernel@...r.kernel.org,
        Philipp Zabel <p.zabel@...gutronix.de>
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, 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 04/10] reset: raspberrypi: 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/reset/reset-raspberrypi.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/reset/reset-raspberrypi.c b/drivers/reset/reset-raspberrypi.c
index 02f59c06f69b..29311192e2c9 100644
--- a/drivers/reset/reset-raspberrypi.c
+++ b/drivers/reset/reset-raspberrypi.c
@@ -99,7 +99,17 @@ static int rpi_reset_probe(struct platform_device *pdev)
 	priv->rcdev.ops = &rpi_reset_ops;
 	priv->rcdev.of_node = dev->of_node;
 
-	return devm_reset_controller_register(dev, &priv->rcdev);
+	return reset_controller_register(&priv->rcdev);
+}
+
+static int rpi_reset_remove(struct platform_device *pdev)
+{
+	struct rpi_reset *priv = platform_get_drvdata(pdev);
+
+	reset_controller_unregister(&priv->rcdev);
+	rpi_firmware_put(priv->fw);
+
+	return 0;
 }
 
 static const struct of_device_id rpi_reset_of_match[] = {
@@ -110,6 +120,7 @@ MODULE_DEVICE_TABLE(of, rpi_reset_of_match);
 
 static struct platform_driver rpi_reset_driver = {
 	.probe	= rpi_reset_probe,
+	.remove	= rpi_reset_remove,
 	.driver	= {
 		.name = "raspberrypi-reset",
 		.of_match_table = rpi_reset_of_match,
-- 
2.28.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ