Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp121341pxu; Thu, 22 Oct 2020 17:35:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQKLSXFhn7ujARqd2jgItSj2JdfO6h72qK0+2dBchtGojHYgIsXlkr5xyijL3eGrnbJFAD X-Received: by 2002:a50:a410:: with SMTP id u16mr4762652edb.350.1603413316253; Thu, 22 Oct 2020 17:35:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603413316; cv=none; d=google.com; s=arc-20160816; b=usnIsRdgtHBrGQ7S69goZlETdt9nEqgBGxTfxJ79BYN1xagn5r+Kud7PCr9GlWFYCz YTuI9qtFsHSEa3O43VXorhaR62haB/QppsDTeAo1MevADuTPo5HbAY+c2sW6UPbgQYK8 DDUaHu8N2shNH78HhkF1+XFgD0zrMhMhnLXJ/Odt7qirEAbsijWiAvelm9e5TTJw6pUs v0pe0nQVhWtdYSDOy2UTbgey+LEUT+S9F9ThE4PEFcLl7QyVmkcUgK2NHF40siqYW3AB 8tMgXcBEAEgoLnTthSVjvwph9g9vAID5KgI4o7faB5CJ2+hF4Jwvq2lBwiaT2OGA1pNw I59g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=r//mMlKD8kZqpYfEGtcEwuFS5gmlD+5YGS0oYe6vPmE=; b=xpFilW2kUvjsjYX7Awmo4M5wd0Uh3Eb9CCO4q/TA5yENOAymzUdNvnlZ40XmCaeJna /V8xKuPagLDDshHsDiExJe21Ik/Oprk1d6+T2BVWfuWWcjdSNrFNG1vQNk0KMFIsGQRi FgFQJZCPj04oyC0pFGbracmvbRlVuX9B0489VE3+BKpYANU5iykgCT/UvGKicBb/hgS9 /P4PVzVsUkuen8WPwNIHRtgptg827eIjYpnBFWOB8qPOSJPJ7bMDmPxsyu7EqVSsqyX/ DPAoQUXjvGSgEScQys/hLNDMq2rhzHp2c2aFQAW0hlSLzElGVQnBwbNtJcNWs4UbIVeP Pgig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a23si1997498ejd.98.2020.10.22.17.34.31; Thu, 22 Oct 2020 17:35:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S368914AbgJVP7Q (ORCPT + 99 others); Thu, 22 Oct 2020 11:59:16 -0400 Received: from mx2.suse.de ([195.135.220.15]:48528 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S368882AbgJVP7N (ORCPT ); Thu, 22 Oct 2020 11:59:13 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 71B73AFCF; Thu, 22 Oct 2020 15:59:11 +0000 (UTC) From: Nicolas Saenz Julienne To: u.kleine-koenig@pengutronix.de, linux-kernel@vger.kernel.org Cc: f.fainelli@gmail.com, linux-pwm@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, wahrenst@gmx.net, linux-input@vger.kernel.org, dmitry.torokhov@gmail.com, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, p.zabel@pengutronix.de, linux-gpio@vger.kernel.org, linus.walleij@linaro.org, linux-clk@vger.kernel.org, sboyd@kernel.org, linux-rpi-kernel@lists.infradead.org, Nicolas Saenz Julienne Subject: [PATCH v2 05/10] soc: bcm: raspberrypi-power: Release firmware handle on unbind Date: Thu, 22 Oct 2020 17:58:52 +0200 Message-Id: <20201022155858.20867-6-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201022155858.20867-1-nsaenzjulienne@suse.de> References: <20201022155858.20867-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Upon unbinding the device make sure we release RPi's firmware interface. Signed-off-by: Nicolas Saenz Julienne --- 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