Skip to content

driver core/thermal: Fail registration of thermal object when thermal_class is not registered

Rafael J. Wysocki linux-pm lkml 1 version In review

Get series with b4
b4 am 5905717.lOV4Wx5bFT@kreacher

Versions newest first

  1. v1 Latest2 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2driver core: class: Clear private pointer on registration failuresdrivers/base/class.c+11 -51 reply
2/2thermal: Fail object registration if thermal class is not registereddrivers/thermal/thermal_core.c include/linux/device/class.h+11 -06 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchDaniel Lezcano
1/2A-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH v1 0/2] driver core/thermal: Fail registration of thermal object when thermal_class is not registered

Hi All,

If thermal_class is not registered, the whole thermal framework is basically unusable, because the governors are not there and its sysfs interface is not present.

In that case it doesn't make sense to register thermal zones and cooling devices, because they cannot be used as expected anyway, so make it possible to fail the registration of these things if the registration of thermal_class has failed.

To that end, make sure that the private pointer of a class is NULL when that class is not registered with the driver core (patch [1/2]).

Next, make the thermal framework check the value of the thermal_class' private pointer against NULL and fail the registration of thermal zones and cooling devices when it is NULL (patch [2/2]).

Thanks!