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>
static struct class vibrator_class = {
.name = "vibrator",
.owner = THIS_MODULE,
static struct class vibrator_class = {
.name = "vibrator",
.owner = THIS_MODULE,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
.dev_groups = vibrator_groups,
.dev_groups = vibrator_groups,
};
static DEFINE_IDA(minors);
};
static DEFINE_IDA(minors);
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,11,0)
- /*
- * Newer kernels handle this in a race-free manner, by the dev_groups
- * field in the struct class up above. But for older kernels, we need
- * to "open code this :(
- */
- retval = sysfs_create_group(&dev->kobj, vibrator_groups[0]);
- if (retval) {
- device_unregister(dev);
- goto err_ida_remove;
- }
-#endif
-
INIT_DELAYED_WORK(&vib->delayed_work, gb_vibrator_worker);
gb_pm_runtime_put_autosuspend(bundle);
INIT_DELAYED_WORK(&vib->delayed_work, gb_vibrator_worker);
gb_pm_runtime_put_autosuspend(bundle);
if (cancel_delayed_work_sync(&vib->delayed_work))
turn_off(vib);
if (cancel_delayed_work_sync(&vib->delayed_work))
turn_off(vib);
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,11,0)
- sysfs_remove_group(&vib->dev->kobj, vibrator_groups[0]);
-#endif
device_unregister(vib->dev);
ida_simple_remove(&minors, vib->minor);
gb_connection_disable(vib->connection);
device_unregister(vib->dev);
ida_simple_remove(&minors, vib->minor);
gb_connection_disable(vib->connection);