Skip to content

Commit 1a2d572

Browse files
committed
Test correctly for wheel supporting FFB
Don't create the sysfs entries for wheels not supporting FFB. The check for FFB was incorrect and the compiler was throwing a warning.
1 parent 89d2b09 commit 1a2d572

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hid-lg4ff.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2374,7 +2374,7 @@ int lg4ff_init(struct hid_device *hid)
23742374
hid_warn(hid, "Unable to create sysfs interface for \"alternate_modes\", errno %d\n", error);
23752375
}
23762376

2377-
if (dev->ffbit) {
2377+
if (test_bit(FF_CONSTANT, dev->ffbit)) {
23782378
error = device_create_file(&hid->dev, &dev_attr_gain);
23792379
if (error)
23802380
hid_warn(hid, "Unable to create sysfs interface for \"gain\", errno %d\n", error);
@@ -2468,7 +2468,7 @@ int lg4ff_deinit(struct hid_device *hid)
24682468
device_remove_file(&hid->dev, &dev_attr_combine_pedals);
24692469
device_remove_file(&hid->dev, &dev_attr_range);
24702470

2471-
if (dev->ffbit) {
2471+
if (test_bit(FF_CONSTANT, dev->ffbit)) {
24722472
device_remove_file(&hid->dev, &dev_attr_gain);
24732473
if (test_bit(FF_AUTOCENTER, dev->ffbit)) {
24742474
device_remove_file(&hid->dev, &dev_attr_autocenter);

0 commit comments

Comments
 (0)