Loading drivers/thermal/thermal.c +13 −13 Original line number Original line Diff line number Diff line Loading @@ -448,20 +448,20 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *type, int result; int result; if (strlen(type) >= THERMAL_NAME_LENGTH) if (strlen(type) >= THERMAL_NAME_LENGTH) return NULL; return ERR_PTR(-EINVAL); if (!ops || !ops->get_max_state || !ops->get_cur_state || if (!ops || !ops->get_max_state || !ops->get_cur_state || !ops->set_cur_state) !ops->set_cur_state) return NULL; return ERR_PTR(-EINVAL); cdev = kzalloc(sizeof(struct thermal_cooling_device), GFP_KERNEL); cdev = kzalloc(sizeof(struct thermal_cooling_device), GFP_KERNEL); if (!cdev) if (!cdev) return NULL; return ERR_PTR(-ENOMEM); result = get_idr(&thermal_cdev_idr, &thermal_idr_lock, &cdev->id); result = get_idr(&thermal_cdev_idr, &thermal_idr_lock, &cdev->id); if (result) { if (result) { kfree(cdev); kfree(cdev); return NULL; return ERR_PTR(result); } } strcpy(cdev->type, type); strcpy(cdev->type, type); Loading @@ -473,7 +473,7 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *type, if (result) { if (result) { release_idr(&thermal_cdev_idr, &thermal_idr_lock, cdev->id); release_idr(&thermal_cdev_idr, &thermal_idr_lock, cdev->id); kfree(cdev); kfree(cdev); return NULL; return ERR_PTR(result); } } /* sys I/F */ /* sys I/F */ Loading Loading @@ -509,7 +509,7 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *type, unregister: unregister: release_idr(&thermal_cdev_idr, &thermal_idr_lock, cdev->id); release_idr(&thermal_cdev_idr, &thermal_idr_lock, cdev->id); device_unregister(&cdev->device); device_unregister(&cdev->device); return NULL; return ERR_PTR(result); } } EXPORT_SYMBOL(thermal_cooling_device_register); EXPORT_SYMBOL(thermal_cooling_device_register); Loading Loading @@ -581,17 +581,17 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, int count; int count; if (strlen(type) >= THERMAL_NAME_LENGTH) if (strlen(type) >= THERMAL_NAME_LENGTH) return NULL; return ERR_PTR(-EINVAL); if (trips > THERMAL_MAX_TRIPS || trips < 0) if (trips > THERMAL_MAX_TRIPS || trips < 0) return NULL; return ERR_PTR(-EINVAL); if (!ops || !ops->get_temp) if (!ops || !ops->get_temp) return NULL; return ERR_PTR(-EINVAL); tz = kzalloc(sizeof(struct thermal_zone_device), GFP_KERNEL); tz = kzalloc(sizeof(struct thermal_zone_device), GFP_KERNEL); if (!tz) if (!tz) return NULL; return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&tz->cooling_devices); INIT_LIST_HEAD(&tz->cooling_devices); idr_init(&tz->idr); idr_init(&tz->idr); Loading @@ -599,7 +599,7 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, result = get_idr(&thermal_tz_idr, &thermal_idr_lock, &tz->id); result = get_idr(&thermal_tz_idr, &thermal_idr_lock, &tz->id); if (result) { if (result) { kfree(tz); kfree(tz); return NULL; return ERR_PTR(result); } } strcpy(tz->type, type); strcpy(tz->type, type); Loading @@ -612,7 +612,7 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, if (result) { if (result) { release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); kfree(tz); kfree(tz); return NULL; return ERR_PTR(result); } } /* sys I/F */ /* sys I/F */ Loading Loading @@ -654,7 +654,7 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, unregister: unregister: release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); device_unregister(&tz->device); device_unregister(&tz->device); return NULL; return ERR_PTR(result); } } EXPORT_SYMBOL(thermal_zone_device_register); EXPORT_SYMBOL(thermal_zone_device_register); Loading Loading
drivers/thermal/thermal.c +13 −13 Original line number Original line Diff line number Diff line Loading @@ -448,20 +448,20 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *type, int result; int result; if (strlen(type) >= THERMAL_NAME_LENGTH) if (strlen(type) >= THERMAL_NAME_LENGTH) return NULL; return ERR_PTR(-EINVAL); if (!ops || !ops->get_max_state || !ops->get_cur_state || if (!ops || !ops->get_max_state || !ops->get_cur_state || !ops->set_cur_state) !ops->set_cur_state) return NULL; return ERR_PTR(-EINVAL); cdev = kzalloc(sizeof(struct thermal_cooling_device), GFP_KERNEL); cdev = kzalloc(sizeof(struct thermal_cooling_device), GFP_KERNEL); if (!cdev) if (!cdev) return NULL; return ERR_PTR(-ENOMEM); result = get_idr(&thermal_cdev_idr, &thermal_idr_lock, &cdev->id); result = get_idr(&thermal_cdev_idr, &thermal_idr_lock, &cdev->id); if (result) { if (result) { kfree(cdev); kfree(cdev); return NULL; return ERR_PTR(result); } } strcpy(cdev->type, type); strcpy(cdev->type, type); Loading @@ -473,7 +473,7 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *type, if (result) { if (result) { release_idr(&thermal_cdev_idr, &thermal_idr_lock, cdev->id); release_idr(&thermal_cdev_idr, &thermal_idr_lock, cdev->id); kfree(cdev); kfree(cdev); return NULL; return ERR_PTR(result); } } /* sys I/F */ /* sys I/F */ Loading Loading @@ -509,7 +509,7 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *type, unregister: unregister: release_idr(&thermal_cdev_idr, &thermal_idr_lock, cdev->id); release_idr(&thermal_cdev_idr, &thermal_idr_lock, cdev->id); device_unregister(&cdev->device); device_unregister(&cdev->device); return NULL; return ERR_PTR(result); } } EXPORT_SYMBOL(thermal_cooling_device_register); EXPORT_SYMBOL(thermal_cooling_device_register); Loading Loading @@ -581,17 +581,17 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, int count; int count; if (strlen(type) >= THERMAL_NAME_LENGTH) if (strlen(type) >= THERMAL_NAME_LENGTH) return NULL; return ERR_PTR(-EINVAL); if (trips > THERMAL_MAX_TRIPS || trips < 0) if (trips > THERMAL_MAX_TRIPS || trips < 0) return NULL; return ERR_PTR(-EINVAL); if (!ops || !ops->get_temp) if (!ops || !ops->get_temp) return NULL; return ERR_PTR(-EINVAL); tz = kzalloc(sizeof(struct thermal_zone_device), GFP_KERNEL); tz = kzalloc(sizeof(struct thermal_zone_device), GFP_KERNEL); if (!tz) if (!tz) return NULL; return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&tz->cooling_devices); INIT_LIST_HEAD(&tz->cooling_devices); idr_init(&tz->idr); idr_init(&tz->idr); Loading @@ -599,7 +599,7 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, result = get_idr(&thermal_tz_idr, &thermal_idr_lock, &tz->id); result = get_idr(&thermal_tz_idr, &thermal_idr_lock, &tz->id); if (result) { if (result) { kfree(tz); kfree(tz); return NULL; return ERR_PTR(result); } } strcpy(tz->type, type); strcpy(tz->type, type); Loading @@ -612,7 +612,7 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, if (result) { if (result) { release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); kfree(tz); kfree(tz); return NULL; return ERR_PTR(result); } } /* sys I/F */ /* sys I/F */ Loading Loading @@ -654,7 +654,7 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, unregister: unregister: release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); device_unregister(&tz->device); device_unregister(&tz->device); return NULL; return ERR_PTR(result); } } EXPORT_SYMBOL(thermal_zone_device_register); EXPORT_SYMBOL(thermal_zone_device_register); Loading