Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: greybus: vibrator: remove KERNEL_VERSION checks

No need to support older kernel versions in the Greybus Vibrator driver,
so remove the checks as needed, we can now rely on all of the correct
driver core apis being present.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>

-18
-18
drivers/staging/greybus/vibrator.c
··· 108 108 static struct class vibrator_class = { 109 109 .name = "vibrator", 110 110 .owner = THIS_MODULE, 111 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) 112 111 .dev_groups = vibrator_groups, 113 - #endif 114 112 }; 115 113 116 114 static DEFINE_IDA(minors); ··· 167 169 } 168 170 vib->dev = dev; 169 171 170 - #if LINUX_VERSION_CODE <= KERNEL_VERSION(3,11,0) 171 - /* 172 - * Newer kernels handle this in a race-free manner, by the dev_groups 173 - * field in the struct class up above. But for older kernels, we need 174 - * to "open code this :( 175 - */ 176 - retval = sysfs_create_group(&dev->kobj, vibrator_groups[0]); 177 - if (retval) { 178 - device_unregister(dev); 179 - goto err_ida_remove; 180 - } 181 - #endif 182 - 183 172 INIT_DELAYED_WORK(&vib->delayed_work, gb_vibrator_worker); 184 173 185 174 gb_pm_runtime_put_autosuspend(bundle); ··· 197 212 if (cancel_delayed_work_sync(&vib->delayed_work)) 198 213 turn_off(vib); 199 214 200 - #if LINUX_VERSION_CODE <= KERNEL_VERSION(3,11,0) 201 - sysfs_remove_group(&vib->dev->kobj, vibrator_groups[0]); 202 - #endif 203 215 device_unregister(vib->dev); 204 216 ida_simple_remove(&minors, vib->minor); 205 217 gb_connection_disable(vib->connection);