diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/thermal/thermal_sys.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c index 11237bc2aa9c..db5d8f882668 100644 --- a/drivers/thermal/thermal_sys.c +++ b/drivers/thermal/thermal_sys.c | |||
@@ -64,7 +64,7 @@ static int get_idr(struct idr *idr, struct mutex *lock, int *id) | |||
64 | { | 64 | { |
65 | int err; | 65 | int err; |
66 | 66 | ||
67 | again: | 67 | again: |
68 | if (unlikely(idr_pre_get(idr, GFP_KERNEL) == 0)) | 68 | if (unlikely(idr_pre_get(idr, GFP_KERNEL) == 0)) |
69 | return -ENOMEM; | 69 | return -ENOMEM; |
70 | 70 | ||
@@ -816,15 +816,14 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz, | |||
816 | return 0; | 816 | return 0; |
817 | 817 | ||
818 | device_remove_file(&tz->device, &dev->attr); | 818 | device_remove_file(&tz->device, &dev->attr); |
819 | remove_symbol_link: | 819 | remove_symbol_link: |
820 | sysfs_remove_link(&tz->device.kobj, dev->name); | 820 | sysfs_remove_link(&tz->device.kobj, dev->name); |
821 | release_idr: | 821 | release_idr: |
822 | release_idr(&tz->idr, &tz->lock, dev->id); | 822 | release_idr(&tz->idr, &tz->lock, dev->id); |
823 | free_mem: | 823 | free_mem: |
824 | kfree(dev); | 824 | kfree(dev); |
825 | return result; | 825 | return result; |
826 | } | 826 | } |
827 | |||
828 | EXPORT_SYMBOL(thermal_zone_bind_cooling_device); | 827 | EXPORT_SYMBOL(thermal_zone_bind_cooling_device); |
829 | 828 | ||
830 | /** | 829 | /** |
@@ -854,14 +853,13 @@ int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz, | |||
854 | 853 | ||
855 | return -ENODEV; | 854 | return -ENODEV; |
856 | 855 | ||
857 | unbind: | 856 | unbind: |
858 | device_remove_file(&tz->device, &pos->attr); | 857 | device_remove_file(&tz->device, &pos->attr); |
859 | sysfs_remove_link(&tz->device.kobj, pos->name); | 858 | sysfs_remove_link(&tz->device.kobj, pos->name); |
860 | release_idr(&tz->idr, &tz->lock, pos->id); | 859 | release_idr(&tz->idr, &tz->lock, pos->id); |
861 | kfree(pos); | 860 | kfree(pos); |
862 | return 0; | 861 | return 0; |
863 | } | 862 | } |
864 | |||
865 | EXPORT_SYMBOL(thermal_zone_unbind_cooling_device); | 863 | EXPORT_SYMBOL(thermal_zone_unbind_cooling_device); |
866 | 864 | ||
867 | static void thermal_release(struct device *dev) | 865 | static void thermal_release(struct device *dev) |
@@ -869,7 +867,8 @@ static void thermal_release(struct device *dev) | |||
869 | struct thermal_zone_device *tz; | 867 | struct thermal_zone_device *tz; |
870 | struct thermal_cooling_device *cdev; | 868 | struct thermal_cooling_device *cdev; |
871 | 869 | ||
872 | if (!strncmp(dev_name(dev), "thermal_zone", sizeof "thermal_zone" - 1)) { | 870 | if (!strncmp(dev_name(dev), "thermal_zone", |
871 | sizeof("thermal_zone") - 1)) { | ||
873 | tz = to_thermal_zone(dev); | 872 | tz = to_thermal_zone(dev); |
874 | kfree(tz); | 873 | kfree(tz); |
875 | } else { | 874 | } else { |
@@ -889,8 +888,9 @@ static struct class thermal_class = { | |||
889 | * @devdata: device private data. | 888 | * @devdata: device private data. |
890 | * @ops: standard thermal cooling devices callbacks. | 889 | * @ops: standard thermal cooling devices callbacks. |
891 | */ | 890 | */ |
892 | struct thermal_cooling_device *thermal_cooling_device_register( | 891 | struct thermal_cooling_device * |
893 | char *type, void *devdata, const struct thermal_cooling_device_ops *ops) | 892 | thermal_cooling_device_register(char *type, void *devdata, |
893 | const struct thermal_cooling_device_ops *ops) | ||
894 | { | 894 | { |
895 | struct thermal_cooling_device *cdev; | 895 | struct thermal_cooling_device *cdev; |
896 | struct thermal_zone_device *pos; | 896 | struct thermal_zone_device *pos; |
@@ -955,12 +955,11 @@ struct thermal_cooling_device *thermal_cooling_device_register( | |||
955 | if (!result) | 955 | if (!result) |
956 | return cdev; | 956 | return cdev; |
957 | 957 | ||
958 | unregister: | 958 | unregister: |
959 | release_idr(&thermal_cdev_idr, &thermal_idr_lock, cdev->id); | 959 | release_idr(&thermal_cdev_idr, &thermal_idr_lock, cdev->id); |
960 | device_unregister(&cdev->device); | 960 | device_unregister(&cdev->device); |
961 | return ERR_PTR(result); | 961 | return ERR_PTR(result); |
962 | } | 962 | } |
963 | |||
964 | EXPORT_SYMBOL(thermal_cooling_device_register); | 963 | EXPORT_SYMBOL(thermal_cooling_device_register); |
965 | 964 | ||
966 | /** | 965 | /** |
@@ -1005,7 +1004,6 @@ void thermal_cooling_device_unregister(struct | |||
1005 | device_unregister(&cdev->device); | 1004 | device_unregister(&cdev->device); |
1006 | return; | 1005 | return; |
1007 | } | 1006 | } |
1008 | |||
1009 | EXPORT_SYMBOL(thermal_cooling_device_unregister); | 1007 | EXPORT_SYMBOL(thermal_cooling_device_unregister); |
1010 | 1008 | ||
1011 | /** | 1009 | /** |
@@ -1081,7 +1079,7 @@ void thermal_zone_device_update(struct thermal_zone_device *tz) | |||
1081 | 1079 | ||
1082 | tz->last_temperature = temp; | 1080 | tz->last_temperature = temp; |
1083 | 1081 | ||
1084 | leave: | 1082 | leave: |
1085 | if (tz->passive) | 1083 | if (tz->passive) |
1086 | thermal_zone_device_set_polling(tz, tz->passive_delay); | 1084 | thermal_zone_device_set_polling(tz, tz->passive_delay); |
1087 | else if (tz->polling_delay) | 1085 | else if (tz->polling_delay) |
@@ -1221,12 +1219,11 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, | |||
1221 | if (!result) | 1219 | if (!result) |
1222 | return tz; | 1220 | return tz; |
1223 | 1221 | ||
1224 | unregister: | 1222 | unregister: |
1225 | release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); | 1223 | release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); |
1226 | device_unregister(&tz->device); | 1224 | device_unregister(&tz->device); |
1227 | return ERR_PTR(result); | 1225 | return ERR_PTR(result); |
1228 | } | 1226 | } |
1229 | |||
1230 | EXPORT_SYMBOL(thermal_zone_device_register); | 1227 | EXPORT_SYMBOL(thermal_zone_device_register); |
1231 | 1228 | ||
1232 | /** | 1229 | /** |
@@ -1278,7 +1275,6 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz) | |||
1278 | device_unregister(&tz->device); | 1275 | device_unregister(&tz->device); |
1279 | return; | 1276 | return; |
1280 | } | 1277 | } |
1281 | |||
1282 | EXPORT_SYMBOL(thermal_zone_device_unregister); | 1278 | EXPORT_SYMBOL(thermal_zone_device_unregister); |
1283 | 1279 | ||
1284 | #ifdef CONFIG_NET | 1280 | #ifdef CONFIG_NET |