Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'thermal-6.6-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull more thermal control updates from Rafael Wysocki:
"Eliminate an obsolete thermal zone registration function"

* tag 'thermal-6.6-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
thermal: core: Drop thermal_zone_device_register()
thermal: Use thermal_tripless_zone_device_register()
thermal: core: Add function for registering tripless thermal zones
thermal: core: Clean up headers of thermal zone registration functions

+54 -36
+2 -2
drivers/power/supply/power_supply_core.c
··· 1309 1309 struct thermal_zone_params tzp = { 1310 1310 .no_hwmon = IS_ENABLED(CONFIG_POWER_SUPPLY_HWMON) 1311 1311 }; 1312 - psy->tzd = thermal_zone_device_register(psy->desc->name, 1313 - 0, 0, psy, &psy_tzd_ops, &tzp, 0, 0); 1312 + psy->tzd = thermal_tripless_zone_device_register(psy->desc->name, 1313 + psy, &psy_tzd_ops, &tzp); 1314 1314 if (IS_ERR(psy->tzd)) 1315 1315 return PTR_ERR(psy->tzd); 1316 1316 ret = thermal_zone_device_enable(psy->tzd);
+3 -2
drivers/thermal/armada_thermal.c
··· 876 876 /* Wait the sensors to be valid */ 877 877 armada_wait_sensor_validity(priv); 878 878 879 - tz = thermal_zone_device_register(priv->zone_name, 0, 0, priv, 880 - &legacy_ops, NULL, 0, 0); 879 + tz = thermal_tripless_zone_device_register(priv->zone_name, 880 + priv, &legacy_ops, 881 + NULL); 881 882 if (IS_ERR(tz)) { 882 883 dev_err(&pdev->dev, 883 884 "Failed to register thermal zone device\n");
+2 -2
drivers/thermal/dove_thermal.c
··· 139 139 return ret; 140 140 } 141 141 142 - thermal = thermal_zone_device_register("dove_thermal", 0, 0, 143 - priv, &ops, NULL, 0, 0); 142 + thermal = thermal_tripless_zone_device_register("dove_thermal", priv, 143 + &ops, NULL); 144 144 if (IS_ERR(thermal)) { 145 145 dev_err(&pdev->dev, 146 146 "Failed to register thermal zone device\n");
+3 -3
drivers/thermal/intel/int340x_thermal/int3400_thermal.c
··· 609 609 610 610 evaluate_odvp(priv); 611 611 612 - priv->thermal = thermal_zone_device_register("INT3400 Thermal", 0, 0, 613 - priv, &int3400_thermal_ops, 614 - &int3400_thermal_params, 0, 0); 612 + priv->thermal = thermal_tripless_zone_device_register("INT3400 Thermal", priv, 613 + &int3400_thermal_ops, 614 + &int3400_thermal_params); 615 615 if (IS_ERR(priv->thermal)) { 616 616 result = PTR_ERR(priv->thermal); 617 617 goto free_art_trt;
+2 -2
drivers/thermal/kirkwood_thermal.c
··· 71 71 if (IS_ERR(priv->sensor)) 72 72 return PTR_ERR(priv->sensor); 73 73 74 - thermal = thermal_zone_device_register("kirkwood_thermal", 0, 0, 75 - priv, &ops, NULL, 0, 0); 74 + thermal = thermal_tripless_zone_device_register("kirkwood_thermal", 75 + priv, &ops, NULL); 76 76 if (IS_ERR(thermal)) { 77 77 dev_err(&pdev->dev, 78 78 "Failed to register thermal zone device\n");
+2 -2
drivers/thermal/spear_thermal.c
··· 122 122 stdev->flags = val; 123 123 writel_relaxed(stdev->flags, stdev->thermal_base); 124 124 125 - spear_thermal = thermal_zone_device_register("spear_thermal", 0, 0, 126 - stdev, &ops, NULL, 0, 0); 125 + spear_thermal = thermal_tripless_zone_device_register("spear_thermal", 126 + stdev, &ops, NULL); 127 127 if (IS_ERR(spear_thermal)) { 128 128 dev_err(&pdev->dev, "thermal zone device is NULL\n"); 129 129 ret = PTR_ERR(spear_thermal);
+8 -8
drivers/thermal/thermal_core.c
··· 1389 1389 } 1390 1390 EXPORT_SYMBOL_GPL(thermal_zone_device_register_with_trips); 1391 1391 1392 - struct thermal_zone_device *thermal_zone_device_register(const char *type, int ntrips, int mask, 1393 - void *devdata, struct thermal_zone_device_ops *ops, 1394 - const struct thermal_zone_params *tzp, int passive_delay, 1395 - int polling_delay) 1392 + struct thermal_zone_device *thermal_tripless_zone_device_register( 1393 + const char *type, 1394 + void *devdata, 1395 + struct thermal_zone_device_ops *ops, 1396 + const struct thermal_zone_params *tzp) 1396 1397 { 1397 - return thermal_zone_device_register_with_trips(type, NULL, ntrips, mask, 1398 - devdata, ops, tzp, 1399 - passive_delay, polling_delay); 1398 + return thermal_zone_device_register_with_trips(type, NULL, 0, 0, devdata, 1399 + ops, tzp, 0, 0); 1400 1400 } 1401 - EXPORT_SYMBOL_GPL(thermal_zone_device_register); 1401 + EXPORT_SYMBOL_GPL(thermal_tripless_zone_device_register); 1402 1402 1403 1403 void *thermal_zone_device_priv(struct thermal_zone_device *tzd) 1404 1404 {
+32 -15
include/linux/thermal.h
··· 300 300 #endif 301 301 302 302 #ifdef CONFIG_THERMAL 303 - struct thermal_zone_device *thermal_zone_device_register(const char *, int, int, 304 - void *, struct thermal_zone_device_ops *, 305 - const struct thermal_zone_params *, int, int); 303 + struct thermal_zone_device *thermal_zone_device_register_with_trips( 304 + const char *type, 305 + struct thermal_trip *trips, 306 + int num_trips, int mask, 307 + void *devdata, 308 + struct thermal_zone_device_ops *ops, 309 + const struct thermal_zone_params *tzp, 310 + int passive_delay, int polling_delay); 306 311 307 - void thermal_zone_device_unregister(struct thermal_zone_device *); 312 + struct thermal_zone_device *thermal_tripless_zone_device_register( 313 + const char *type, 314 + void *devdata, 315 + struct thermal_zone_device_ops *ops, 316 + const struct thermal_zone_params *tzp); 308 317 309 - struct thermal_zone_device * 310 - thermal_zone_device_register_with_trips(const char *, struct thermal_trip *, int, int, 311 - void *, struct thermal_zone_device_ops *, 312 - const struct thermal_zone_params *, int, int); 318 + void thermal_zone_device_unregister(struct thermal_zone_device *tz); 313 319 314 320 void *thermal_zone_device_priv(struct thermal_zone_device *tzd); 315 321 const char *thermal_zone_device_type(struct thermal_zone_device *tzd); ··· 356 350 int thermal_zone_device_disable(struct thermal_zone_device *tz); 357 351 void thermal_zone_device_critical(struct thermal_zone_device *tz); 358 352 #else 359 - static inline struct thermal_zone_device *thermal_zone_device_register( 360 - const char *type, int trips, int mask, void *devdata, 361 - struct thermal_zone_device_ops *ops, 362 - const struct thermal_zone_params *tzp, 363 - int passive_delay, int polling_delay) 353 + static inline struct thermal_zone_device *thermal_zone_device_register_with_trips( 354 + const char *type, 355 + struct thermal_trip *trips, 356 + int num_trips, int mask, 357 + void *devdata, 358 + struct thermal_zone_device_ops *ops, 359 + const struct thermal_zone_params *tzp, 360 + int passive_delay, int polling_delay) 364 361 { return ERR_PTR(-ENODEV); } 365 - static inline void thermal_zone_device_unregister( 366 - struct thermal_zone_device *tz) 362 + 363 + static inline struct thermal_zone_device *thermal_tripless_zone_device_register( 364 + const char *type, 365 + void *devdata, 366 + struct thermal_zone_device_ops *ops, 367 + const struct thermal_zone_params *tzp) 368 + { return ERR_PTR(-ENODEV); } 369 + 370 + static inline void thermal_zone_device_unregister(struct thermal_zone_device *tz) 367 371 { } 372 + 368 373 static inline struct thermal_cooling_device * 369 374 thermal_cooling_device_register(const char *type, void *devdata, 370 375 const struct thermal_cooling_device_ops *ops)