From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E596357CFA; Fri, 11 Sep 2026 21:05:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789160704; cv=none; b=WWlNKx24yqSBr2vomnDY+/MSRQ/fvoNe65lIJUEdCGTofmGxw0KmbJ4sHhnIezmXGM9BjSLeD7w1vx17nGcD4pGC7jtkV5fnznOGY9JF26VXmXyYRkmZR4lym2N5qPBfbBAU5e2wdt3RzmB1d1S+ffZ3Cwza87MBlCutx1WNMBM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789160704; c=relaxed/simple; bh=xGRrjOy0mmFjDs9E3DUlqzhSX076G9NWacDtUR3RYY0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=KWTT9r21+PAg4hWzYf+cldgJgaznVHckPpSI5qtBVAdr9tKeldEnqcna1FnYICgoFFhZNeM1kTfS2Ker1Wjv2N5SiNSePvpSLf/hB5ZcMZcKTmkM/4oIJUpWKN4vq3cMaSgwi1nnkMBlEUpxbU4S/9x65Du0JH0SmEsyrhSjbcw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b=R3tZbFSb; arc=none smtp.client-ip=212.227.15.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="R3tZbFSb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1789160691; x=1789765491; i=w_armin@gmx.de; bh=r647uEgXdU2W1rj+bkjhsQkrfrcaOHKP9kDAlAk6r6o=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc: References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=R3tZbFSbD4ui7GVxWBP3kXCKF4n62GtEsCA5Di72J/wN2G+DL+38J1l+v9xkQ2XD n6QH49L//KsgI1maP34pN5/+Ftv66AvWh2fO2b4rW2knWhVvTfk2DIiohAUkx0Gbs Jwi3D/A+IXtZA82XZxOLB5vuwQ1YM4KtCfDTSh19AQMOtLkVPrPIUZec2/pxtqgQA 6Mx55FLUdTpLxYYJM8xXK+E6vDUsFuGCJDLmbsFHXbR2qazqRyVjfaKBmJU4foYV1 23MqLkeNJHA+FEypxdaI3LbBSIxpPMW60c4zgLTvzmvLX0/GghhHn73U1u4I/raRR b5foTcqfnKINWSfNTA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from client.hidden.invalid by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MbzyP-1wXzP33m3j-00c7Ag; Fri, 11 Sep 2026 23:04:50 +0200 Message-ID: <7ef819c3-5155-48fb-828a-48d9bd72e54b@gmx.de> Date: Fri, 11 Sep 2026 23:04:50 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 03/10] thermal: core: Introduce thermal_cooling_device_create() To: "Rafael J. Wysocki" , Linux ACPI Cc: Andy Shevchenko , Daniel Lezcano , Hans de Goede , LKML , Linux PM , Lukasz Luba References: <1965933.tdWV9SEqCh@rafael.j.wysocki> <8729484.T7Z3S40VBb@rafael.j.wysocki> Content-Language: en-US From: Armin Wolf In-Reply-To: <8729484.T7Z3S40VBb@rafael.j.wysocki> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:MMlyr0h4n6o1uZBPpKsYw3N8Lj2UeFb85tkpuN6J/Vsp8H8mPst 62S0z8zvaeJWFfryguWalkH2FRxJB10Y7CjkltfVys6NNXs4HFOh11WunrJ+5qJs9a75kuB sIyhLm8ce+ud2GgTTCep9hDxlGTzAVAwsOosa26SSGRES7TUtKiCML3Y1pQRaDoBsvSp1AU 0nKLjJEbQ+LyZ/OmbE0xQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:2heknBkaCBk=;6Gps50F4T4FGAeiAc0ZVncNJdiK QlECjneqmejXsrb6O1YiCgc4wt/0aqfrXNAsL4pPhtQq+iQ+d2njbVKObHzhNCR02zSJInJyH 6DAZDywZFN+XDcUcZdFtWMU0guzrhF6Mk5xFEBmY0YlMFooAj2HeYsJYXFHxyycL3ssZzVKft PUg8Q4aHsdGwjBJzMuTITHcZdvYTKERVTPJtCW7FULSvP0RQ82OgAB8ZBi7+fMsG/pw2XHO/7 R1qtBbBKBBx1adGQREw0xdrRaw4esbRn22YmHyS+QnaNVGndwKeQIsXG3eb7eBkElWEV4eAJX h0OmfTBnvDHUtntglor9TSu58XucBYa3RBuxrL7ZVSWDYJqzMT1jdWNNTBJ6XV+j8u8z4u5l/ 5lHa/Iiau7M4L2jMSUtc+Rac5VeaCR0VqeDTQB2vaXiLiZfuJ3WtYUlbF6tou8ApQQUNupzlU BmkByJuj1vddc0IJvYMmYrjSWh1qRXsPeG61/Hd6ASAulDuALs+lIQpIRGIML4tdXq/VPB7nr HCGHw3k+icUtBYxliuQPqX2EftCyCPUh+z28FdbxaSGTRRjj3mkSpi4msbNRcNWOg9mAsVnFn yy4WptbZ3AKtqP30o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j7IMxHhTUnT9XwN0E5Yluh6nTIqEwIe80IlJrYmu/o2CiPgvS dfp8DVJUV2axnuV1YrMLcZFEMAnk56RfzVhrZyiwQYWw4PG2pUr3gwXX9SPOVvvLWCKcFE0sC UfzECXocxTepz5i2kpmn2aiQ/kKKiyTrpme6NNPSZv3I8D/7GXjgsF+YHw6duI+IQIojnu9hL 3IGWX4jmyT7MNO5rdN7BTVddBcSy6ClNRBe61P75AT43EsvJbl6CStl47ECBxow+uCOgn6zJA 5xm80DnJkE2WhPRf0uf4roUfr6BnayClcJ66gH76a5+bIZLnu6wurekPpQG6BdsPESedVJZLO Nn8+sEx8AEvj1uUnlm62GlVeXb0CYCbdugYtnKWf6y3FVfA3mod2K54gdmPkCaICGn+a+86pX 3xIJTl7iWsTJjFM2KAIMTVYyb5f3+q4gH+BEhNsxsJ2lfuDtKBPhVsB6W1gdHqVnWJpo8XNUG f/5TJjCCPrZGRKxFQUcuorGf9XQDbuKYoig== Am 11.09.26 um 15:02 schrieb Rafael J. Wysocki: > From: "Rafael J. Wysocki" > > Currently, thermal cooling devices have no parents, but it would be > generally useful to be able to create them under specific parents in > the device hierarchy (for instance, it may help to identify the device > representing the actual cooling hardware). > > To make that possible, add thermal_cooling_device_create() that will > work like thermal_cooling_device_register() except that it will take > an additional parent argument (which may be NULL). > > Redefine thermal_cooling_device_register() as a static inline wrapper > around thermal_cooling_device_create(). Hi, i like your idea with the new registration function, this gives us more ti= me for migrating the other drivers. Should we mark the original function as deprecated? For the patch itself: Reviewed-by: Armin Wolf > Signed-off-by: Rafael J. Wysocki > --- > drivers/thermal/thermal_core.c | 28 ++++++++++++++++------------ > drivers/thermal/thermal_core.h | 3 ++- > drivers/thermal/thermal_of.c | 2 +- > include/linux/thermal.h | 19 ++++++++++++++----- > 4 files changed, 33 insertions(+), 19 deletions(-) > > diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_co= re.c > index 82e2f0d8a26d..ac928c199829 100644 > --- a/drivers/thermal/thermal_core.c > +++ b/drivers/thermal/thermal_core.c > @@ -1005,7 +1005,8 @@ thermal_cooling_device_alloc(const char *type, con= st struct thermal_cooling_devi > return ERR_PTR(ret); > } > =20 > -int thermal_cooling_device_add(struct thermal_cooling_device *cdev, voi= d *devdata) > +int thermal_cooling_device_add(struct thermal_cooling_device *cdev, > + struct device *parent, void *devdata) > { > unsigned long current_state; > int ret; > @@ -1013,6 +1014,7 @@ int thermal_cooling_device_add(struct thermal_cool= ing_device *cdev, void *devdat > mutex_init(&cdev->lock); > INIT_LIST_HEAD(&cdev->thermal_instances); > cdev->updated =3D false; > + cdev->device.parent =3D parent; > cdev->device.class =3D &thermal_class; > cdev->device.release =3D thermal_cdev_release; > device_initialize(&cdev->device); > @@ -1062,21 +1064,23 @@ int thermal_cooling_device_add(struct thermal_co= oling_device *cdev, void *devdat > } > =20 > /** > - * thermal_cooling_device_register() - register a new thermal cooling d= evice > + * thermal_cooling_device_create() - register a new thermal cooling dev= ice > + * @parent: parent device (optional). > * @type: the thermal cooling device type. > * @devdata: device private data. > * @ops: standard thermal cooling devices callbacks. > * > - * This interface function adds a new thermal cooling device (fan/proce= ssor/...) > - * to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to bi= nd itself > - * to all the thermal zone devices registered at the same time. > + * Allocate and register a new thermal cooling device under the given p= arent (if > + * not NULL) and with the given type, device data, and operations. Dur= ing the > + * registration, it will be matched against all of the registered therm= al zones > + * and it will be bound to the matching ones. > * > - * Return: a pointer to the created struct thermal_cooling_device or an > - * ERR_PTR. Caller must check return value with IS_ERR*() helpers. > + * Return: A pointer to the created struct thermal_cooling_device or an= ERR_PTR. > + * Callers must use IS_ERR*() helpers to check the return value. > */ > -struct thermal_cooling_device * > -thermal_cooling_device_register(const char *type, void *devdata, > - const struct thermal_cooling_device_ops *ops) > +struct thermal_cooling_device *thermal_cooling_device_create( > + struct device *parent, const char *type, void *devdata, > + const struct thermal_cooling_device_ops *ops) > { > struct thermal_cooling_device *cdev; > int ret; > @@ -1085,13 +1089,13 @@ thermal_cooling_device_register(const char *type= , void *devdata, > if (IS_ERR(cdev)) > return cdev; > =20 > - ret =3D thermal_cooling_device_add(cdev, devdata); > + ret =3D thermal_cooling_device_add(cdev, parent, devdata); > if (ret) > return ERR_PTR(ret); > =20 > return cdev; > } > -EXPORT_SYMBOL_GPL(thermal_cooling_device_register); > +EXPORT_SYMBOL_GPL(thermal_cooling_device_create); > =20 > static void thermal_cooling_device_release(void *data) > { > diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_co= re.h > index e98b0aa5aacc..7ef7c6cab437 100644 > --- a/drivers/thermal/thermal_core.h > +++ b/drivers/thermal/thermal_core.h > @@ -270,7 +270,8 @@ void thermal_governor_update_tz(struct thermal_zone_= device *tz, > struct thermal_cooling_device * > thermal_cooling_device_alloc(const char *type, const struct thermal_co= oling_device_ops *ops); > =20 > -int thermal_cooling_device_add(struct thermal_cooling_device *cdev, voi= d *devdata); > +int thermal_cooling_device_add(struct thermal_cooling_device *cdev, > + struct device *parent, void *devdata); > =20 > /* Helpers */ > #define for_each_trip_desc(__tz, __td) \ > diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c > index 0217a49b08ae..14dfac9359b8 100644 > --- a/drivers/thermal/thermal_of.c > +++ b/drivers/thermal/thermal_of.c > @@ -561,7 +561,7 @@ thermal_of_cooling_device_register(struct device_nod= e *np, u32 cdev_id, > cdev->np =3D np; > cdev->cdev_id =3D cdev_id; > =20 > - ret =3D thermal_cooling_device_add(cdev, devdata); > + ret =3D thermal_cooling_device_add(cdev, NULL, devdata); > if (ret) > return ERR_PTR(ret); > =20 > diff --git a/include/linux/thermal.h b/include/linux/thermal.h > index 083b4f533933..306ad17aed89 100644 > --- a/include/linux/thermal.h > +++ b/include/linux/thermal.h > @@ -293,8 +293,9 @@ struct device *thermal_zone_device(struct thermal_zo= ne_device *tzd); > void thermal_zone_device_update(struct thermal_zone_device *, > enum thermal_notify_event); > =20 > -struct thermal_cooling_device *thermal_cooling_device_register(const ch= ar *, > - void *, const struct thermal_cooling_device_ops *); > +struct thermal_cooling_device *thermal_cooling_device_create( > + struct device *parent, const char *type, void *devdata, > + const struct thermal_cooling_device_ops *ops); > =20 > struct thermal_cooling_device * > devm_thermal_cooling_device_register(struct device *dev, const char *t= ype, void *devdata, > @@ -340,9 +341,9 @@ static inline void thermal_zone_device_update(struct= thermal_zone_device *tz, > enum thermal_notify_event event) > { } > =20 > -static inline struct thermal_cooling_device * > -thermal_cooling_device_register(const char *type, void *devdata, > - const struct thermal_cooling_device_ops *ops) > +static inline struct thermal_cooling_device *thermal_cooling_device_cre= ate( > + struct device *parent, const char *type, void *devdata, > + const struct thermal_cooling_device_ops *ops) > { return ERR_PTR(-ENODEV); } > =20 > static inline struct thermal_cooling_device * > @@ -391,4 +392,12 @@ static inline void thermal_pm_prepare(void) {} > static inline void thermal_pm_complete(void) {} > #endif /* CONFIG_THERMAL */ > =20 > +static inline struct thermal_cooling_device *thermal_cooling_device_reg= ister( > + const char *type, void *devdata, > + const struct thermal_cooling_device_ops *ops) > +{ > + return thermal_cooling_device_create(NULL, type, devdata, ops); > +} > + > + > #endif /* __THERMAL_H__ */