diff mbox series

[08/18] serial: sc16is7xx: add driver name to struct uart_driver

Message ID 20231219171903.3530985-9-hugo@hugovil.com
State Superseded
Headers show
Series serial: sc16is7xx: fixes, cleanups and improvements | expand

Commit Message

Hugo Villeneuve Dec. 19, 2023, 5:18 p.m. UTC
From: Hugo Villeneuve <hvilleneuve@dimonoff.com>

Make sure that the driver name is displayed instead of "unknown" when
displaying the driver infos:

Before:
    cat /proc/tty/drivers | grep ttySC
    unknown              /dev/ttySC    243 0-7 serial

After:
    cat /proc/tty/drivers | grep ttySC
    sc16is7xx            /dev/ttySC    243 0-7 serial

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
---
 drivers/tty/serial/sc16is7xx.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Andy Shevchenko Dec. 20, 2023, 3:48 p.m. UTC | #1
On Tue, Dec 19, 2023 at 12:18:52PM -0500, Hugo Villeneuve wrote:
> From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> 
> Make sure that the driver name is displayed instead of "unknown" when
> displaying the driver infos:
> 
> Before:
>     cat /proc/tty/drivers | grep ttySC
>     unknown              /dev/ttySC    243 0-7 serial
> 
> After:
>     cat /proc/tty/drivers | grep ttySC
>     sc16is7xx            /dev/ttySC    243 0-7 serial

"Useless use of cat" (you can google for this phrase, it's famous).

	grep ... /proc/...

will work :-)

Otherwise LGTM!
Hugo Villeneuve Dec. 20, 2023, 4:11 p.m. UTC | #2
On Wed, 20 Dec 2023 17:48:03 +0200
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:

> On Tue, Dec 19, 2023 at 12:18:52PM -0500, Hugo Villeneuve wrote:
> > From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> > 
> > Make sure that the driver name is displayed instead of "unknown" when
> > displaying the driver infos:
> > 
> > Before:
> >     cat /proc/tty/drivers | grep ttySC
> >     unknown              /dev/ttySC    243 0-7 serial
> > 
> > After:
> >     cat /proc/tty/drivers | grep ttySC
> >     sc16is7xx            /dev/ttySC    243 0-7 serial
> 
> "Useless use of cat" (you can google for this phrase, it's famous).
> 
> 	grep ... /proc/...
> 
> will work :-)
> 
> Otherwise LGTM!

Old habits die hard :)

Interesting read!

Will modify commit message in V2.

Thank you.

Hugo Villeneuve
Andy Shevchenko Dec. 20, 2023, 6:59 p.m. UTC | #3
On Wed, Dec 20, 2023 at 11:11:36AM -0500, Hugo Villeneuve wrote:
> On Wed, 20 Dec 2023 17:48:03 +0200
> Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> > On Tue, Dec 19, 2023 at 12:18:52PM -0500, Hugo Villeneuve wrote:

...

> > "Useless use of cat" (you can google for this phrase, it's famous).

> Interesting read!

Yep! Then there are categories: (instead of "cat" you may use) "grep", "gzip"
(e.g., better use zless / zgrep) and so on :-)
diff mbox series

Patch

diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index 97a97a4bd71a..3fb99b6929f3 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -350,6 +350,7 @@  static DECLARE_BITMAP(sc16is7xx_lines, SC16IS7XX_MAX_DEVS);
 
 static struct uart_driver sc16is7xx_uart = {
 	.owner		= THIS_MODULE,
+	.driver_name    = SC16IS7XX_NAME,
 	.dev_name	= "ttySC",
 	.nr		= SC16IS7XX_MAX_DEVS,
 };