From cc1f1ad1d16105eb55285a8525271d8810ae0b5f Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Wed, 12 Mar 2025 22:51:00 +0900 Subject: [PATCH] pmdomain: core: add dummy release function to genpd device BugLink: https://bugs.launchpad.net/bugs/2102118 commit f64f610ec6ab59dd0391b03842cea3a4cd8ee34f upstream. The genpd device, which is really only used as a handle to lookup OPP, but not even registered to the device core otherwise and thus lifetime linked to the genpd struct it is contained in, is missing a release function. After b8f7bbd1f4ec ("pmdomain: core: Add missing put_device()") the device will be cleaned up going through the driver core device_release() function, which will warn when no release callback is present for the device. Add a dummy release function to shut up the warning. Signed-off-by: Lucas Stach Tested-by: Luca Ceresoli Fixes: b8f7bbd1f4ec ("pmdomain: core: Add missing put_device()") Cc: stable@vger.kernel.org Message-ID: <20241218184433.1930532-1-l.stach@pengutronix.de> Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman (cherry picked from commit cba9d51794ecde58a21e4e96bcfd0a18f7dd4ff8 linux-6.12.y) [koichiroden: follow-up fix for "pmdomain: core: Add missing put_device()", from v6.12.9] Signed-off-by: Koichiro Den Signed-off-by: Stefan Bader --- drivers/pmdomain/core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c index 1e890266a4d2..7e941b4d813e 100644 --- a/drivers/pmdomain/core.c +++ b/drivers/pmdomain/core.c @@ -2003,6 +2003,11 @@ static int genpd_set_default_power_state(struct generic_pm_domain *genpd) return 0; } +static void genpd_provider_release(struct device *dev) +{ + /* nothing to be done here */ +} + static int genpd_alloc_data(struct generic_pm_domain *genpd) { struct genpd_governor_data *gd = NULL; @@ -2034,6 +2039,7 @@ static int genpd_alloc_data(struct generic_pm_domain *genpd) genpd->gd = gd; device_initialize(&genpd->dev); + genpd->dev.release = genpd_provider_release; if (!genpd_is_dev_name_fw(genpd)) { dev_set_name(&genpd->dev, "%s", genpd->name);