b392bd0d0c6c5ba64c3a0e673677648e63110d95
[openwrt/staging/xback.git] /
1 From f64f610ec6ab59dd0391b03842cea3a4cd8ee34f Mon Sep 17 00:00:00 2001
2 From: Lucas Stach <l.stach@pengutronix.de>
3 Date: Wed, 18 Dec 2024 19:44:33 +0100
4 Subject: [PATCH] pmdomain: core: add dummy release function to genpd device
5
6 The genpd device, which is really only used as a handle to lookup
7 OPP, but not even registered to the device core otherwise and thus
8 lifetime linked to the genpd struct it is contained in, is missing
9 a release function. After b8f7bbd1f4ec ("pmdomain: core: Add
10 missing put_device()") the device will be cleaned up going through
11 the driver core device_release() function, which will warn when no
12 release callback is present for the device. Add a dummy release
13 function to shut up the warning.
14
15 Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
16 Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
17 Fixes: b8f7bbd1f4ec ("pmdomain: core: Add missing put_device()")
18 Cc: stable@vger.kernel.org
19 Message-ID: <20241218184433.1930532-1-l.stach@pengutronix.de>
20 Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
21 ---
22 drivers/base/power/domain.c | 6 ++++++
23 1 file changed, 6 insertions(+)
24
25 --- a/drivers/base/power/domain.c
26 +++ b/drivers/base/power/domain.c
27 @@ -2040,6 +2040,11 @@ static void genpd_lock_init(struct gener
28 }
29 }
30
31 +static void genpd_provider_release(struct device *dev)
32 +{
33 + /* nothing to be done here */
34 +}
35 +
36 /**
37 * pm_genpd_init - Initialize a generic I/O PM domain object.
38 * @genpd: PM domain object to initialize.
39 @@ -2106,6 +2111,7 @@ int pm_genpd_init(struct generic_pm_doma
40 return ret;
41
42 device_initialize(&genpd->dev);
43 + genpd->dev.release = genpd_provider_release;
44 dev_set_name(&genpd->dev, "%s", genpd->name);
45
46 mutex_lock(&gpd_list_lock);