Commit 937804f3 authored by Jiri Kosina's avatar Jiri Kosina

HID: corsair: boolify struct k90_led.removed

'removed' field of struct k90_led is in its nature bool, let's use it
that way.
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 6f78193e
...@@ -28,7 +28,7 @@ struct k90_led { ...@@ -28,7 +28,7 @@ struct k90_led {
struct led_classdev cdev; struct led_classdev cdev;
int brightness; int brightness;
struct work_struct work; struct work_struct work;
int removed; bool removed;
}; };
struct k90_drvdata { struct k90_drvdata {
...@@ -410,7 +410,7 @@ static int k90_init_backlight(struct hid_device *dev) ...@@ -410,7 +410,7 @@ static int k90_init_backlight(struct hid_device *dev)
} }
snprintf(name, name_sz, "%s" K90_BACKLIGHT_LED_SUFFIX, snprintf(name, name_sz, "%s" K90_BACKLIGHT_LED_SUFFIX,
dev_name(&dev->dev)); dev_name(&dev->dev));
drvdata->backlight->removed = 0; drvdata->backlight->removed = false;
drvdata->backlight->cdev.name = name; drvdata->backlight->cdev.name = name;
drvdata->backlight->cdev.max_brightness = 3; drvdata->backlight->cdev.max_brightness = 3;
drvdata->backlight->cdev.brightness_set = k90_brightness_set; drvdata->backlight->cdev.brightness_set = k90_brightness_set;
...@@ -455,7 +455,7 @@ static int k90_init_macro_functions(struct hid_device *dev) ...@@ -455,7 +455,7 @@ static int k90_init_macro_functions(struct hid_device *dev)
} }
snprintf(name, name_sz, "%s" K90_RECORD_LED_SUFFIX, snprintf(name, name_sz, "%s" K90_RECORD_LED_SUFFIX,
dev_name(&dev->dev)); dev_name(&dev->dev));
k90->record_led.removed = 0; k90->record_led.removed = false;
k90->record_led.cdev.name = name; k90->record_led.cdev.name = name;
k90->record_led.cdev.max_brightness = 1; k90->record_led.cdev.max_brightness = 1;
k90->record_led.cdev.brightness_set = k90_brightness_set; k90->record_led.cdev.brightness_set = k90_brightness_set;
...@@ -474,7 +474,7 @@ static int k90_init_macro_functions(struct hid_device *dev) ...@@ -474,7 +474,7 @@ static int k90_init_macro_functions(struct hid_device *dev)
return 0; return 0;
fail_sysfs: fail_sysfs:
k90->record_led.removed = 1; k90->record_led.removed = true;
led_classdev_unregister(&k90->record_led.cdev); led_classdev_unregister(&k90->record_led.cdev);
cancel_work_sync(&k90->record_led.work); cancel_work_sync(&k90->record_led.work);
fail_record_led: fail_record_led:
...@@ -491,7 +491,7 @@ static void k90_cleanup_backlight(struct hid_device *dev) ...@@ -491,7 +491,7 @@ static void k90_cleanup_backlight(struct hid_device *dev)
struct corsair_drvdata *drvdata = hid_get_drvdata(dev); struct corsair_drvdata *drvdata = hid_get_drvdata(dev);
if (drvdata->backlight) { if (drvdata->backlight) {
drvdata->backlight->removed = 1; drvdata->backlight->removed = true;
led_classdev_unregister(&drvdata->backlight->cdev); led_classdev_unregister(&drvdata->backlight->cdev);
cancel_work_sync(&drvdata->backlight->work); cancel_work_sync(&drvdata->backlight->work);
kfree(drvdata->backlight->cdev.name); kfree(drvdata->backlight->cdev.name);
...@@ -507,7 +507,7 @@ static void k90_cleanup_macro_functions(struct hid_device *dev) ...@@ -507,7 +507,7 @@ static void k90_cleanup_macro_functions(struct hid_device *dev)
if (k90) { if (k90) {
sysfs_remove_group(&dev->dev.kobj, &k90_attr_group); sysfs_remove_group(&dev->dev.kobj, &k90_attr_group);
k90->record_led.removed = 1; k90->record_led.removed = true;
led_classdev_unregister(&k90->record_led.cdev); led_classdev_unregister(&k90->record_led.cdev);
cancel_work_sync(&k90->record_led.work); cancel_work_sync(&k90->record_led.work);
kfree(k90->record_led.cdev.name); kfree(k90->record_led.cdev.name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment