Skip to contentSkip to conversation

leds: ledtrig-tty: add tty_led_mode xtension

PATCH Superseded Florian Eckert 2 participants 5 messages Feb 20, 2023

Subsystems (2)

v4 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#1 lore raw

PATCH v4 1/2 tty: new helper function tty_get_mget

In reply to Florian Eckert

For a given struct tty_struct, this provides the appropriate tty line state flags needed to add more modes to the ledtrig-tty trigger.

The new function is then used to get via tty_tiocmget() the different tty line states.

---
 drivers/tty/tty_io.c | 28 ++++++++++++++++++++++------
 include/linux/tty.h  |  1 +
 2 files changed, 23 insertions(+), 6 deletions(-)
drivers/tty/tty_io.c +22 -6
index 3149114bf130..a068b03a0828 100644
@@ -2493,6 +2493,24 @@ static int send_break(struct tty_struct *tty, unsigned int duration)
 	return retval;
 }
 
+/**
+ * tty_get_mget		-	get modem status
+ * @tty: tty device
+ *
+ * Obtain the modem status bits from the tty driver if the feature
+ * is supported. Return -%ENOTTY if it is not available.
+ */
+int tty_get_mget(struct tty_struct *tty)
+{
+	int retval = -ENOTTY;
+
+	if (tty->ops->tiocmget)
+		retval = tty->ops->tiocmget(tty);
+
+	return retval;
+}
+EXPORT_SYMBOL_GPL(tty_get_mget);
+
 /**
  * tty_tiocmget		-	get modem status
  * @tty: tty device
@@ -2505,14 +2523,12 @@ static int send_break(struct tty_struct *tty, unsigned int duration)
  */
 static int tty_tiocmget(struct tty_struct *tty, int __user *p)
 {
-	int retval = -ENOTTY;
+	int retval;
 
-	if (tty->ops->tiocmget) {
-		retval = tty->ops->tiocmget(tty);
+	retval = tty_get_mget(tty);
+	if (retval >= 0)
+		retval = put_user(retval, p);
 
-		if (retval >= 0)
-			retval = put_user(retval, p);
-	}
 	return retval;
 }
 
include/linux/tty.h +1 -0
index 730c3301d710..825186c0fec1 100644
@@ -421,6 +421,7 @@ int tty_unthrottle_safe(struct tty_struct *tty);
 int tty_do_resize(struct tty_struct *tty, struct winsize *ws);
 int tty_get_icount(struct tty_struct *tty,
 		struct serial_icounter_struct *icount);
+int tty_get_mget(struct tty_struct *tty);
 int is_current_pgrp_orphaned(void);
 void tty_hangup(struct tty_struct *tty);
 void tty_vhangup(struct tty_struct *tty);
Signature · 1 line
2.30.2
#2 lore raw

PATCH v4 2/2 trigger: ledtrig-tty: add additional modes

In reply to Florian Eckert

Add additional modes to trigger the selected LED.
The following modes are supported:

Tx/Rx: Flash LED on data transmission (default)
CTS: DCE Ready to accept data from the DTE.
DSR: DCE is ready to receive and send data.
CAR: DCE is receiving a carrier from a remote DTE.
RNG: DCE has detected an incoming ring signal.

The mode can be changed for example with the following command:
echo "CTS" > /sys/class/leds/<led>/mode

This would turn on the LED, when the DTE(modem) signals the DCE that it is ready to accept data.

---
 .../ABI/testing/sysfs-class-led-trigger-tty   |  16 ++
 drivers/leds/trigger/ledtrig-tty.c            | 144 ++++++++++++++++--
 2 files changed, 145 insertions(+), 15 deletions(-)
Documentation/ABI/testing/sysfs-class-led-trigger-tty +16 -0
index 2bf6b24e781b..31d62a5ae095 100644
@@ -4,3 +4,19 @@ KernelVersion:	5.10
 Contact:	[email protected]
 Description:
 		Specifies the tty device name of the triggering tty
+
+What:		/sys/class/leds/<led>/mode
+Date:		January 2023
+KernelVersion:	6.3
+Description:
+		Specifies the operating to trigger the LED.
+		The following operating modes are supported:
+		Tx/Rx: Flash LED on data transmission (default)
+		CTS:   DCE Ready to accept data from the DTE.
+		       LED on if line is high.
+		DSR:   DCE is ready to receive and send data.
+		       LED on if line is high.
+		CAR:   DCE is receiving a carrier from a remote DTE.
+		       LED on if line is high.
+		RNG:   DCE has detected an incoming ring signal.
+		       LED on if line is high.
drivers/leds/trigger/ledtrig-tty.c +129 -15

186 lines not on this page · raw message

Signature · 1 line
2.30.2
#0 lore raw

v4 cover leds: ledtrig-tty: add tty_led_mode xtension

Hello,

here commes v4 of this series to add additional tty_led_modes.

v4:
Changes compared to the v3 patchset with
[email protected] are.

Addressed review comments by Jiri Slaby are:

ledtrig-tty.c:
- Do not use __TTY_LED_MAX pattern us instead __TTY_LED_LAST = TTY_LED_RNG
- Move declartion and assignment into one singel line
- Use __TTY_LED_LAST pattern, to simplify tty_mode_show and tty_mode_store handling

v3:
Changes compared to the v2 patchset with
[email protected] are.

Addressed review comments by Greg K-H are:

tty.h:
- Fix first comment line and remark -%ENOTTY for the new function 'tty_get_mget' to make a proper kernel doc.
- Add the return value -%ENOTTY again, I thought it was no longer needed.

v2:
Changes compared to the initial patchset with
[email protected] are.

Addressed review comments by Jiri Slaby are:

tty.h:
- Fix compilation error because of wrong rebaseing
- Remove empty lines
- Use new 'tty_get_mget' in 'tty_tiocmget'

ledtrig-tty.c:
- Update commit description
- Use enum for tty_led_mod in struct ledtrig_tty_date
- Rename sysfs file from 'mode' to 'tty_led_mode'
- Change tty_led_mode show function to use loop instead of switch/case
- Change tty_led_mode store function to use loop instead of switch/case
- Check return value of function tty_get_mget

Florian Eckert (2):
tty: new helper function tty_get_mget
trigger: ledtrig-tty: add additional modes

 .../ABI/testing/sysfs-class-led-trigger-tty   |  16 ++
 drivers/leds/trigger/ledtrig-tty.c            | 146 ++++++++++++++++--
 drivers/tty/tty_io.c                          |  28 +++-
 include/linux/tty.h                           |   1 +
 4 files changed, 170 insertions(+), 21 deletions(-)
Signature · 1 line
2.30.2
#3 lore raw

Re: [PATCH v4 2/2] trigger: ledtrig-tty: add additional modes

In reply to Florian Eckert
Thank you for the patch! Perhaps something to improve:

Hi Florian,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tty/tty-testing]
[also build test WARNING on tty/tty-next tty/tty-linus pavel-leds/for-next staging/staging-testing staging/staging-next staging/staging-linus linus/master v6.2 next-20230220] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Florian-Eckert/tty-new-helper-function-tty_get_mget/20230220-232129
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
patch link:    https://lore.kernel.org/r/20230220152038.3877596-3-fe%40dev.tdt.de
patch subject: [PATCH v4 2/2] trigger: ledtrig-tty: add additional modes
config: ia64-allyesconfig (https://download.01.org/0day-ci/archive/20230221/[email protected]/config)
compiler: ia64-linux-gcc (GCC) 12.1.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/8da3a8a2edcad2e4b36fce551cac1961a5cd90a6
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Florian-Eckert/tty-new-helper-function-tty_get_mget/20230220-232129 git checkout 8da3a8a2edcad2e4b36fce551cac1961a5cd90a6
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/leds/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

drivers/leds/trigger/ledtrig-tty.c:15:24: error: 'TTY_LED_RNG' undeclared here (not in a function); did you mean 'TTY_LED_CNT'?

      15 |         TTY_LED_LAST = TTY_LED_RNG
         |                        ^~~~~~~~~~~
         |                        TTY_LED_CNT
   drivers/leds/trigger/ledtrig-tty.c:33:10: error: array index in initializer not of integer type
      33 |         [TTY_LED_RNG] = "RNG", // RNG Ring Indicator (RI)
         |          ^~~~~~~~~~~
   drivers/leds/trigger/ledtrig-tty.c:33:10: note: (near initialization for 'mode')
   drivers/leds/trigger/ledtrig-tty.c: In function 'ledtrig_tty_mode_show':
   drivers/leds/trigger/ledtrig-tty.c:48:34: error: '__TTY_LED_LAST' undeclared (first use in this function); did you mean 'TTY_LED_LAST'?
      48 |                 bool last = i == __TTY_LED_LAST;
         |                                  ^~~~~~~~~~~~~~
         |                                  TTY_LED_LAST
   drivers/leds/trigger/ledtrig-tty.c:48:34: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/leds/trigger/ledtrig-tty.c:50:48: warning: too many arguments for format [-Wformat-extra-args]
      50 |                 len += sysfs_emit_at(buf, len, "%s%s%s",
         |                                                ^~~~~~~~
   drivers/leds/trigger/ledtrig-tty.c: In function 'tty_led_mode_store':
   drivers/leds/trigger/ledtrig-tty.c:81:38: error: '__TTY_LED_MAX' undeclared (first use in this function); did you mean 'TTY_LED_CAR'?
      81 |         enum tty_led_mode tty_mode = __TTY_LED_MAX;
         |                                      ^~~~~~~~~~~~~
         |                                      TTY_LED_CAR
   drivers/leds/trigger/ledtrig-tty.c:88:26: error: '__TTY_LED_LAST' undeclared (first use in this function); did you mean 'TTY_LED_LAST'?
      88 |         for (i = 0; i <= __TTY_LED_LAST; i++)
         |                          ^~~~~~~~~~~~~~
         |                          TTY_LED_LAST
>> drivers/leds/trigger/ledtrig-tty.c:89:17: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
      89 |                 if (strncmp(buf, mode[i], size) == 0)
         |                 ^~
   drivers/leds/trigger/ledtrig-tty.c:91:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
      91 |                         break;
         |                         ^~~~~
   drivers/leds/trigger/ledtrig-tty.c:91:25: error: break statement not within loop or switch
>> drivers/leds/trigger/ledtrig-tty.c:81:27: warning: variable 'tty_mode' set but not used [-Wunused-but-set-variable]
      81 |         enum tty_led_mode tty_mode = __TTY_LED_MAX;
         |                           ^~~~~~~~
   drivers/leds/trigger/ledtrig-tty.c:80:17: warning: unused variable 'ret' [-Wunused-variable]
      80 |         ssize_t ret = size;
         |                 ^~~
   drivers/leds/trigger/ledtrig-tty.c:79:34: warning: unused variable 'trigger_data' [-Wunused-variable]
      79 |         struct ledtrig_tty_data *trigger_data = led_trigger_get_drvdata(dev);
         |                                  ^~~~~~~~~~~~
   drivers/leds/trigger/ledtrig-tty.c:92:17: error: no return statement in function returning non-void [-Werror=return-type]
      92 |                 }
         |                 ^
   drivers/leds/trigger/ledtrig-tty.c: At top level:
   drivers/leds/trigger/ledtrig-tty.c:94:9: error: expected identifier or '(' before 'if'
      94 |         if (tty_mode > __TTY_LED_LAST)
         |         ^~
   drivers/leds/trigger/ledtrig-tty.c:97:20: error: expected declaration specifiers or '...' before '&' token
      97 |         mutex_lock(&trigger_data->mutex);
         |                    ^
   drivers/leds/trigger/ledtrig-tty.c:98:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
      98 |         trigger_data->mode = tty_mode;
         |                     ^~
   drivers/leds/trigger/ledtrig-tty.c:99:22: error: expected declaration specifiers or '...' before '&' token
      99 |         mutex_unlock(&trigger_data->mutex);
         |                      ^
   drivers/leds/trigger/ledtrig-tty.c:101:9: error: expected identifier or '(' before 'return'
     101 |         return ret;
         |         ^~~~~~
   drivers/leds/trigger/ledtrig-tty.c:102:1: error: expected identifier or '(' before '}' token
     102 | }
         | ^

cc1: some warnings being treated as errors

vim +50 drivers/leds/trigger/ledtrig-tty.c

    40	
    41	static ssize_t ledtrig_tty_mode_show(char *buf, enum tty_led_mode tty_mode)
    42	{
    43		int len = 0;
    44		int i;
    45	
    46		for (i = 0; i <= TTY_LED_LAST; i++) {
    47			bool hit = tty_mode == i;
    48			bool last = i == __TTY_LED_LAST;
    49	
  > 50			len += sysfs_emit_at(buf, len, "%s%s%s",
    51					  hit ? "[" : "",
    52					  mode[i],
    53					  hit ? "]" : "",
    54					  last ? "" : " ");
    55		}
    56	
    57		len += sysfs_emit_at(buf, len, "\n");
    58	
    59		return len;
    60	}
    61	
    62	static ssize_t tty_led_mode_show(struct device *dev,
    63				 struct device_attribute *attr, char *buf)
    64	{
    65		struct ledtrig_tty_data *trigger_data = led_trigger_get_drvdata(dev);
    66		enum tty_led_mode tty_mode;
    67	
    68		mutex_lock(&trigger_data->mutex);
    69		tty_mode = trigger_data->mode;
    70		mutex_unlock(&trigger_data->mutex);
    71	
    72		return ledtrig_tty_mode_show(buf, tty_mode);
    73	}
    74	
    75	static ssize_t tty_led_mode_store(struct device *dev,
    76				  struct device_attribute *attr, const char *buf,
    77				  size_t size)
    78	{
    79		struct ledtrig_tty_data *trigger_data = led_trigger_get_drvdata(dev);
    80		ssize_t ret = size;
  > 81		enum tty_led_mode tty_mode = __TTY_LED_MAX;
    82		int i;
    83	
    84		/* Check for new line in string*/
    85		if (size > 0 && buf[size - 1] == '\n')
    86			size -= 1;
    87	
    88		for (i = 0; i <= __TTY_LED_LAST; i++)
  > 89			if (strncmp(buf, mode[i], size) == 0)
    90				tty_mode = i;
    91				break;
    92			}
    93	
    94		if (tty_mode > __TTY_LED_LAST)
    95			return -EINVAL;
    96	
    97		mutex_lock(&trigger_data->mutex);
    98		trigger_data->mode = tty_mode;
    99		mutex_unlock(&trigger_data->mutex);

100
101 return ret;
102 }
103 static DEVICE_ATTR_RW(tty_led_mode);
104

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
#4 lore raw

Re: [PATCH v4 2/2] trigger: ledtrig-tty: add additional modes

In reply to Florian Eckert
Thank you for the patch! Perhaps something to improve:

Hi Florian,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tty/tty-testing]
[also build test WARNING on tty/tty-next tty/tty-linus pavel-leds/for-next staging/staging-testing staging/staging-next staging/staging-linus linus/master v6.2] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Florian-Eckert/tty-new-helper-function-tty_get_mget/20230220-232129
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
patch link:    https://lore.kernel.org/r/20230220152038.3877596-3-fe%40dev.tdt.de
patch subject: [PATCH v4 2/2] trigger: ledtrig-tty: add additional modes
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20230221/[email protected]/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0

reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/8da3a8a2edcad2e4b36fce551cac1961a5cd90a6
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Florian-Eckert/tty-new-helper-function-tty_get_mget/20230220-232129 git checkout 8da3a8a2edcad2e4b36fce551cac1961a5cd90a6
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 olddefconfig
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/leds/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

drivers/leds/trigger/ledtrig-tty.c:15:24: error: 'TTY_LED_RNG' undeclared here (not in a function); did you mean 'TTY_LED_CNT'?

      15 |         TTY_LED_LAST = TTY_LED_RNG
         |                        ^~~~~~~~~~~
         |                        TTY_LED_CNT
   drivers/leds/trigger/ledtrig-tty.c:33:10: error: array index in initializer not of integer type
      33 |         [TTY_LED_RNG] = "RNG", // RNG Ring Indicator (RI)
         |          ^~~~~~~~~~~
   drivers/leds/trigger/ledtrig-tty.c:33:10: note: (near initialization for 'mode')
   drivers/leds/trigger/ledtrig-tty.c: In function 'ledtrig_tty_mode_show':
   drivers/leds/trigger/ledtrig-tty.c:48:34: error: '__TTY_LED_LAST' undeclared (first use in this function); did you mean 'TTY_LED_LAST'?
      48 |                 bool last = i == __TTY_LED_LAST;
         |                                  ^~~~~~~~~~~~~~
         |                                  TTY_LED_LAST
   drivers/leds/trigger/ledtrig-tty.c:48:34: note: each undeclared identifier is reported only once for each function it appears in
   drivers/leds/trigger/ledtrig-tty.c:50:48: warning: too many arguments for format [-Wformat-extra-args]
      50 |                 len += sysfs_emit_at(buf, len, "%s%s%s",
         |                                                ^~~~~~~~
   drivers/leds/trigger/ledtrig-tty.c: In function 'tty_led_mode_store':
   drivers/leds/trigger/ledtrig-tty.c:81:38: error: '__TTY_LED_MAX' undeclared (first use in this function); did you mean 'TTY_LED_CAR'?
      81 |         enum tty_led_mode tty_mode = __TTY_LED_MAX;
         |                                      ^~~~~~~~~~~~~
         |                                      TTY_LED_CAR
   drivers/leds/trigger/ledtrig-tty.c:88:26: error: '__TTY_LED_LAST' undeclared (first use in this function); did you mean 'TTY_LED_LAST'?
      88 |         for (i = 0; i <= __TTY_LED_LAST; i++)
         |                          ^~~~~~~~~~~~~~
         |                          TTY_LED_LAST
   drivers/leds/trigger/ledtrig-tty.c:89:17: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
      89 |                 if (strncmp(buf, mode[i], size) == 0)
         |                 ^~
   drivers/leds/trigger/ledtrig-tty.c:91:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
      91 |                         break;
         |                         ^~~~~
   drivers/leds/trigger/ledtrig-tty.c:91:25: error: break statement not within loop or switch
   drivers/leds/trigger/ledtrig-tty.c:81:27: warning: variable 'tty_mode' set but not used [-Wunused-but-set-variable]
      81 |         enum tty_led_mode tty_mode = __TTY_LED_MAX;
         |                           ^~~~~~~~
>> drivers/leds/trigger/ledtrig-tty.c:80:17: warning: unused variable 'ret' [-Wunused-variable]
      80 |         ssize_t ret = size;
         |                 ^~~
>> drivers/leds/trigger/ledtrig-tty.c:79:34: warning: unused variable 'trigger_data' [-Wunused-variable]
      79 |         struct ledtrig_tty_data *trigger_data = led_trigger_get_drvdata(dev);
         |                                  ^~~~~~~~~~~~
   drivers/leds/trigger/ledtrig-tty.c:92:17: error: no return statement in function returning non-void [-Werror=return-type]
      92 |                 }
         |                 ^
   drivers/leds/trigger/ledtrig-tty.c: At top level:
   drivers/leds/trigger/ledtrig-tty.c:94:9: error: expected identifier or '(' before 'if'
      94 |         if (tty_mode > __TTY_LED_LAST)
         |         ^~
   In file included from include/linux/rhashtable-types.h:14,
                    from include/linux/ipc.h:7,
                    from include/uapi/linux/sem.h:5,
                    from include/linux/sem.h:5,
                    from include/linux/sched.h:15,
                    from include/linux/delay.h:23,
                    from drivers/leds/trigger/ledtrig-tty.c:3:
   drivers/leds/trigger/ledtrig-tty.c:97:20: error: expected declaration specifiers or '...' before '&' token
      97 |         mutex_lock(&trigger_data->mutex);
         |                    ^
   include/linux/mutex.h:187:44: note: in definition of macro 'mutex_lock'
     187 | #define mutex_lock(lock) mutex_lock_nested(lock, 0)
         |                                            ^~~~
   include/linux/mutex.h:187:50: error: expected declaration specifiers or '...' before numeric constant
     187 | #define mutex_lock(lock) mutex_lock_nested(lock, 0)
         |                                                  ^
   drivers/leds/trigger/ledtrig-tty.c:97:9: note: in expansion of macro 'mutex_lock'
      97 |         mutex_lock(&trigger_data->mutex);
         |         ^~~~~~~~~~
   drivers/leds/trigger/ledtrig-tty.c:98:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
      98 |         trigger_data->mode = tty_mode;
         |                     ^~
   drivers/leds/trigger/ledtrig-tty.c:99:22: error: expected declaration specifiers or '...' before '&' token
      99 |         mutex_unlock(&trigger_data->mutex);
         |                      ^
   drivers/leds/trigger/ledtrig-tty.c:101:9: error: expected identifier or '(' before 'return'
     101 |         return ret;
         |         ^~~~~~
   drivers/leds/trigger/ledtrig-tty.c:102:1: error: expected identifier or '(' before '}' token
     102 | }
         | ^

cc1: some warnings being treated as errors

vim +/ret +80 drivers/leds/trigger/ledtrig-tty.c

    74	
    75	static ssize_t tty_led_mode_store(struct device *dev,
    76				  struct device_attribute *attr, const char *buf,
    77				  size_t size)
    78	{
  > 79		struct ledtrig_tty_data *trigger_data = led_trigger_get_drvdata(dev);
  > 80		ssize_t ret = size;
    81		enum tty_led_mode tty_mode = __TTY_LED_MAX;
    82		int i;
    83	
    84		/* Check for new line in string*/
    85		if (size > 0 && buf[size - 1] == '\n')
    86			size -= 1;
    87	
    88		for (i = 0; i <= __TTY_LED_LAST; i++)
    89			if (strncmp(buf, mode[i], size) == 0)
    90				tty_mode = i;
  > 91				break;
    92			}
    93	
    94		if (tty_mode > __TTY_LED_LAST)
    95			return -EINVAL;
    96	
    97		mutex_lock(&trigger_data->mutex);
    98		trigger_data->mode = tty_mode;
    99		mutex_unlock(&trigger_data->mutex);

100
101 return ret;
102 }
103 static DEVICE_ATTR_RW(tty_led_mode);
104

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests