@@ -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,
Upon unbinding the device make sure we release RPi's firmware interface. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> --- drivers/reset/reset-raspberrypi.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)