static int __devexit wf_smu_remove(struct platform_device *ddev) { wf_unregister_client(&wf_smu_events); /* XXX We don't have yet a guarantee that our callback isn't * in progress when returning from wf_unregister_client, so * we add an arbitrary delay. I'll have to fix that in the core */ msleep(1000); /* Release all sensors */ /* One more crappy race: I don't think we have any guarantee here * that the attribute callback won't race with the sensor beeing * disposed of, and I'm not 100% certain what best way to deal * with that except by adding locks all over... I'll do that * eventually but heh, who ever rmmod this module anyway ? */ if (sensor_cpu_power) wf_put_sensor(sensor_cpu_power); if (sensor_cpu_temp) wf_put_sensor(sensor_cpu_temp); if (sensor_hd_temp) wf_put_sensor(sensor_hd_temp); if (sensor_slots_power) wf_put_sensor(sensor_slots_power); /* Release all controls */ if (fan_cpu_main) wf_put_control(fan_cpu_main); if (fan_cpu_second) wf_put_control(fan_cpu_second); if (fan_cpu_third) wf_put_control(fan_cpu_third); if (fan_hd) wf_put_control(fan_hd); if (fan_slots) wf_put_control(fan_slots); if (cpufreq_clamp) wf_put_control(cpufreq_clamp); /* Destroy control loops state structures */ if (wf_smu_slots_fans) kfree(wf_smu_cpu_fans); if (wf_smu_drive_fans) kfree(wf_smu_cpu_fans); if (wf_smu_cpu_fans) kfree(wf_smu_cpu_fans); return 0; }
static int __devexit wf_smu_remove(struct platform_device *ddev) { wf_unregister_client(&wf_smu_events); msleep(1000); if (sensor_cpu_power) wf_put_sensor(sensor_cpu_power); if (sensor_cpu_temp) wf_put_sensor(sensor_cpu_temp); if (sensor_hd_temp) wf_put_sensor(sensor_hd_temp); if (sensor_slots_power) wf_put_sensor(sensor_slots_power); if (fan_cpu_main) wf_put_control(fan_cpu_main); if (fan_cpu_second) wf_put_control(fan_cpu_second); if (fan_cpu_third) wf_put_control(fan_cpu_third); if (fan_hd) wf_put_control(fan_hd); if (fan_slots) wf_put_control(fan_slots); if (cpufreq_clamp) wf_put_control(cpufreq_clamp); if (wf_smu_slots_fans) kfree(wf_smu_cpu_fans); if (wf_smu_drive_fans) kfree(wf_smu_cpu_fans); if (wf_smu_cpu_fans) kfree(wf_smu_cpu_fans); return 0; }