3.9 compatibility

Builds and works fine on kernel 3.8 and 3.9.
Thanks to ksv1986!