static int acpi_fan_remove(struct acpi_device *device, int type) { struct thermal_cooling_device *cdev = acpi_driver_data(device); if (!device || !cdev) return -EINVAL; acpi_fan_remove_fs(device); sysfs_remove_link(&device->dev.kobj, "thermal_cooling"); sysfs_remove_link(&cdev->device.kobj, "device"); thermal_cooling_device_unregister(cdev); return 0; }
int acpi_fan_remove ( struct acpi_device *device, int type) { struct acpi_fan *fan = NULL; ACPI_FUNCTION_TRACE("acpi_fan_remove"); if (!device || !acpi_driver_data(device)) return_VALUE(-EINVAL); fan = (struct acpi_fan *) acpi_driver_data(device); acpi_fan_remove_fs(device); kfree(fan); return_VALUE(0); }