@@ -600,10 +600,9 @@ struct thermal_zone_device *thermal_zone_get_by_id(int id)
600600 */
601601
602602/**
603- * thermal_zone_bind_cooling_device() - bind a cooling device to a thermal zone
603+ * thermal_bind_cdev_to_trip - bind a cooling device to a thermal zone
604604 * @tz: pointer to struct thermal_zone_device
605- * @trip_index: indicates which trip point the cooling devices is
606- * associated with in this thermal zone.
605+ * @trip: trip point the cooling devices is associated with in this zone.
607606 * @cdev: pointer to struct thermal_cooling_device
608607 * @upper: the Maximum cooling state for this trip point.
609608 * THERMAL_NO_LIMIT means no upper limit,
@@ -621,8 +620,8 @@ struct thermal_zone_device *thermal_zone_get_by_id(int id)
621620 *
622621 * Return: 0 on success, the proper error value otherwise.
623622 */
624- int thermal_zone_bind_cooling_device (struct thermal_zone_device * tz ,
625- int trip_index ,
623+ int thermal_bind_cdev_to_trip (struct thermal_zone_device * tz ,
624+ const struct thermal_trip * trip ,
626625 struct thermal_cooling_device * cdev ,
627626 unsigned long upper , unsigned long lower ,
628627 unsigned int weight )
@@ -631,15 +630,9 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
631630 struct thermal_instance * pos ;
632631 struct thermal_zone_device * pos1 ;
633632 struct thermal_cooling_device * pos2 ;
634- const struct thermal_trip * trip ;
635633 bool upper_no_limit ;
636634 int result ;
637635
638- if (trip_index >= tz -> num_trips || trip_index < 0 )
639- return - EINVAL ;
640-
641- trip = & tz -> trips [trip_index ];
642-
643636 list_for_each_entry (pos1 , & thermal_tz_list , node ) {
644637 if (pos1 == tz )
645638 break ;
@@ -736,14 +729,26 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
736729 kfree (dev );
737730 return result ;
738731}
732+ EXPORT_SYMBOL_GPL (thermal_bind_cdev_to_trip );
733+
734+ int thermal_zone_bind_cooling_device (struct thermal_zone_device * tz ,
735+ int trip_index ,
736+ struct thermal_cooling_device * cdev ,
737+ unsigned long upper , unsigned long lower ,
738+ unsigned int weight )
739+ {
740+ if (trip_index < 0 || trip_index >= tz -> num_trips )
741+ return - EINVAL ;
742+
743+ return thermal_bind_cdev_to_trip (tz , & tz -> trips [trip_index ], cdev ,
744+ upper , lower , weight );
745+ }
739746EXPORT_SYMBOL_GPL (thermal_zone_bind_cooling_device );
740747
741748/**
742- * thermal_zone_unbind_cooling_device() - unbind a cooling device from a
743- * thermal zone.
749+ * thermal_unbind_cdev_from_trip - unbind a cooling device from a thermal zone.
744750 * @tz: pointer to a struct thermal_zone_device.
745- * @trip_index: indicates which trip point the cooling devices is
746- * associated with in this thermal zone.
751+ * @trip: trip point the cooling devices is associated with in this zone.
747752 * @cdev: pointer to a struct thermal_cooling_device.
748753 *
749754 * This interface function unbind a thermal cooling device from the certain
@@ -752,16 +757,14 @@ EXPORT_SYMBOL_GPL(thermal_zone_bind_cooling_device);
752757 *
753758 * Return: 0 on success, the proper error value otherwise.
754759 */
755- int thermal_zone_unbind_cooling_device (struct thermal_zone_device * tz ,
756- int trip_index ,
757- struct thermal_cooling_device * cdev )
760+ int thermal_unbind_cdev_from_trip (struct thermal_zone_device * tz ,
761+ const struct thermal_trip * trip ,
762+ struct thermal_cooling_device * cdev )
758763{
759764 struct thermal_instance * pos , * next ;
760- const struct thermal_trip * trip ;
761765
762766 mutex_lock (& tz -> lock );
763767 mutex_lock (& cdev -> lock );
764- trip = & tz -> trips [trip_index ];
765768 list_for_each_entry_safe (pos , next , & tz -> thermal_instances , tz_node ) {
766769 if (pos -> tz == tz && pos -> trip == trip && pos -> cdev == cdev ) {
767770 list_del (& pos -> tz_node );
@@ -784,6 +787,17 @@ int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz,
784787 kfree (pos );
785788 return 0 ;
786789}
790+ EXPORT_SYMBOL_GPL (thermal_unbind_cdev_from_trip );
791+
792+ int thermal_zone_unbind_cooling_device (struct thermal_zone_device * tz ,
793+ int trip_index ,
794+ struct thermal_cooling_device * cdev )
795+ {
796+ if (trip_index < 0 || trip_index >= tz -> num_trips )
797+ return - EINVAL ;
798+
799+ return thermal_unbind_cdev_from_trip (tz , & tz -> trips [trip_index ], cdev );
800+ }
787801EXPORT_SYMBOL_GPL (thermal_zone_unbind_cooling_device );
788802
789803static void thermal_release (struct device * dev )
0 commit comments