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

Message ID 5905717.lOV4Wx5bFT@kreacher
Headers
Series driver core/thermal: Fail registration of thermal object when thermal_class is not registered |

Message

Rafael J. Wysocki Jan. 20, 2023, 7:45 p.m. UTC
  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!