From: Luiz Sampaio <sampaio.ime@gmail.com>
To: "Sean Young" <sean@mess.org>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
"David Härdeman" <david@hardeman.nu>
Cc: linux-kernel@vger.kernel.org,
Luiz Sampaio <sampaio.ime@gmail.com>,
linux-media@vger.kernel.org
Subject: [PATCH 11/31] media: rc: changing LED_* from enum led_brightness to actual value
Date: Fri, 21 Jan 2022 13:54:16 -0300 [thread overview]
Message-ID: <20220121165436.30956-12-sampaio.ime@gmail.com> (raw)
In-Reply-To: <20220121165436.30956-1-sampaio.ime@gmail.com>
The enum led_brightness, which contains the declaration of LED_OFF,
LED_ON, LED_HALF and LED_FULL is obsolete, as the led class now supports
max_brightness.
---
drivers/media/rc/rc-main.c | 4 ++--
drivers/media/rc/redrat3.c | 4 ++--
drivers/media/rc/ttusbir.c | 4 ++--
drivers/media/rc/winbond-cir.c | 6 +++---
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index b90438a71c80..76580f1920e2 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -641,7 +641,7 @@ static void ir_do_keyup(struct rc_dev *dev, bool sync)
dev_dbg(&dev->dev, "keyup key 0x%04x\n", dev->last_keycode);
del_timer(&dev->timer_repeat);
input_report_key(dev->input_dev, dev->last_keycode, 0);
- led_trigger_event(led_feedback, LED_OFF);
+ led_trigger_event(led_feedback, 0);
if (sync)
input_sync(dev->input_dev);
dev->keypressed = false;
@@ -812,7 +812,7 @@ static void ir_do_keydown(struct rc_dev *dev, enum rc_proto protocol,
dev->device_name, keycode, protocol, scancode);
input_report_key(dev->input_dev, keycode, 1);
- led_trigger_event(led_feedback, LED_FULL);
+ led_trigger_event(led_feedback, 255);
}
/*
diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c
index cb22316b3f00..7c255f7d790c 100644
--- a/drivers/media/rc/redrat3.c
+++ b/drivers/media/rc/redrat3.c
@@ -855,7 +855,7 @@ static void redrat3_brightness_set(struct led_classdev *led_dev, enum
struct redrat3_dev *rr3 = container_of(led_dev, struct redrat3_dev,
led);
- if (brightness != LED_OFF && atomic_cmpxchg(&rr3->flash, 0, 1) == 0) {
+ if (brightness != 0 && atomic_cmpxchg(&rr3->flash, 0, 1) == 0) {
int ret = usb_submit_urb(rr3->flash_urb, GFP_ATOMIC);
if (ret != 0) {
dev_dbg(rr3->dev, "%s: unexpected ret of %d\n",
@@ -919,7 +919,7 @@ static void redrat3_led_complete(struct urb *urb)
break;
}
- rr3->led.brightness = LED_OFF;
+ rr3->led.brightness = 0;
atomic_dec(&rr3->flash);
}
diff --git a/drivers/media/rc/ttusbir.c b/drivers/media/rc/ttusbir.c
index 629787d53ee1..a295112644c3 100644
--- a/drivers/media/rc/ttusbir.c
+++ b/drivers/media/rc/ttusbir.c
@@ -44,7 +44,7 @@ static enum led_brightness ttusbir_brightness_get(struct led_classdev *led_dev)
{
struct ttusbir *tt = container_of(led_dev, struct ttusbir, led);
- return tt->led_on ? LED_FULL : LED_OFF;
+ return tt->led_on ? 255 : 0;
}
static void ttusbir_set_led(struct ttusbir *tt)
@@ -70,7 +70,7 @@ static void ttusbir_brightness_set(struct led_classdev *led_dev, enum
{
struct ttusbir *tt = container_of(led_dev, struct ttusbir, led);
- tt->led_on = brightness != LED_OFF;
+ tt->led_on = brightness != 0;
ttusbir_set_led(tt);
}
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
index 94efb035d21b..d14e495a8641 100644
--- a/drivers/media/rc/winbond-cir.c
+++ b/drivers/media/rc/winbond-cir.c
@@ -265,7 +265,7 @@ wbcir_led_brightness_get(struct led_classdev *led_cdev)
if (inb(data->ebase + WBCIR_REG_ECEIR_CTS) & WBCIR_LED_ENABLE)
return LED_FULL;
else
- return LED_OFF;
+ return 0;
}
static void
@@ -277,7 +277,7 @@ wbcir_led_brightness_set(struct led_classdev *led_cdev,
led);
wbcir_set_bits(data->ebase + WBCIR_REG_ECEIR_CTS,
- brightness == LED_OFF ? 0x00 : WBCIR_LED_ENABLE,
+ brightness == 0 ? 0x00 : WBCIR_LED_ENABLE,
WBCIR_LED_ENABLE);
}
@@ -1167,7 +1167,7 @@ wbcir_remove(struct pnp_dev *device)
led_classdev_unregister(&data->led);
/* This is ok since &data->led isn't actually used */
- wbcir_led_brightness_set(&data->led, LED_OFF);
+ wbcir_led_brightness_set(&data->led, 0);
release_region(data->wbase, WAKEUP_IOMEM_LEN);
release_region(data->ebase, EHFUNC_IOMEM_LEN);
--
2.34.1
next prev parent reply other threads:[~2022-01-21 16:56 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-21 16:54 [PATCH 00/31] leds: start removing obsolete/useless enum Luiz Sampaio
2022-01-21 16:54 ` [PATCH 01/31] gpu: nouveau: nouveau_led: changing LED_FULL to actual value Luiz Sampaio
2022-01-22 13:33 ` Fabio Estevam
2022-01-21 16:54 ` [PATCH 02/31] hid: changing LED_* from enum led_brightness " Luiz Sampaio
2022-01-21 16:54 ` [PATCH 03/31] hwmon: pmbus: " Luiz Sampaio
2022-01-25 2:03 ` Guenter Roeck
2022-01-21 16:54 ` [PATCH 04/31] iio: light: cm3605: " Luiz Sampaio
2022-01-22 16:38 ` Jonathan Cameron
2022-01-21 16:54 ` [PATCH 05/31] input: keyboard: " Luiz Sampaio
2022-01-21 16:54 ` [PATCH 06/31] input: misc: " Luiz Sampaio
2022-01-21 16:54 ` [PATCH 07/31] input: touchscreen: " Luiz Sampaio
2022-01-21 16:54 ` [PATCH 08/31] leds: " Luiz Sampaio
2022-01-21 16:54 ` [PATCH 09/31] macintosh: " Luiz Sampaio
2022-01-21 16:54 ` [PATCH 10/31] media: radio: " Luiz Sampaio
2022-01-21 16:54 ` Luiz Sampaio [this message]
2022-01-21 18:06 ` [PATCH 11/31] media: rc: " Sean Young
2022-01-21 16:54 ` [PATCH 12/31] media: v4l2-core: " Luiz Sampaio
2022-02-02 12:54 ` Sakari Ailus
2022-11-26 10:14 ` Hans Verkuil
2022-01-21 16:54 ` [PATCH 13/31] mmc: " Luiz Sampaio
2022-01-21 16:54 ` [PATCH 14/31] net: wireless: ath: " Luiz Sampaio
2022-01-21 16:54 ` [PATCH 15/31] net: wireless: atmel: " Luiz Sampaio
2022-01-21 16:54 ` [PATCH 16/31] net: broadcom: " Luiz Sampaio
2022-01-22 8:21 ` Arend van Spriel
2022-01-21 16:54 ` [PATCH 17/31] net: intersil: " Luiz Sampaio
2022-01-21 16:54 ` [PATCH 18/31] net: wireless: ralink: " Luiz Sampaio
2022-01-21 16:54 ` [PATCH 19/31] net: realtek: " Luiz Sampaio
2022-01-21 16:54 ` [PATCH 20/31] platform: x86: " Luiz Sampaio
2022-01-22 12:07 ` Jonathan Woithe
2022-01-24 10:14 ` Hans de Goede
2022-01-21 16:54 ` [PATCH 21/31] power: supply: " Luiz Sampaio
2022-01-21 16:54 ` [PATCH 22/31] tty: vt: " Luiz Sampaio
2022-01-22 7:32 ` Greg Kroah-Hartman
2022-01-21 16:54 ` [PATCH 23/31] usb: core: " Luiz Sampaio
2022-01-22 7:22 ` Greg Kroah-Hartman
2022-01-21 16:54 ` [PATCH 24/31] video: backlight: " Luiz Sampaio
2022-01-21 17:05 ` Daniel Thompson
2022-01-21 18:06 ` Luiz Sampaio
2022-01-21 18:09 ` Luiz Sampaio
2022-01-24 10:53 ` Lee Jones
2022-01-21 16:54 ` [PATCH 25/31] include: linux: leds: " Luiz Sampaio
2022-01-21 16:54 ` [PATCH 26/31] net: bluetooth: " Luiz Sampaio
2022-01-21 20:19 ` Marcel Holtmann
2022-01-21 16:54 ` [PATCH 27/31] net: mac80211 : " Luiz Sampaio
2022-01-21 19:28 ` Johannes Berg
2022-01-21 16:54 ` [PATCH 28/31] net: netfilter: " Luiz Sampaio
2022-01-21 16:54 ` [PATCH 29/31] net: rfkill: " Luiz Sampaio
2022-01-21 16:54 ` [PATCH 30/31] sound: core: " Luiz Sampaio
2022-01-21 16:54 ` [PATCH 31/31] sound: soc: sof: " Luiz Sampaio
2022-02-11 11:58 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220121165436.30956-12-sampaio.ime@gmail.com \
--to=sampaio.ime@gmail.com \
--cc=david@hardeman.nu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sean@mess.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®