[PATCH] gpio: serial: max310x: Use HW type for gpio_chip's label

Subsystems: the rest, tty layer and serial drivers

STALE3179d

3 messages, 3 authors, 2018-02-07 · open the first message on its own page

[PATCH] gpio: serial: max310x: Use HW type for gpio_chip's label

From: Jan Kundrát <hidden>
Date: 2018-01-26 19:59:44

Some debugging tools (/sys/kernel/debug/gpio, `lsgpio`) use the
gpio_chip's label for displaying an additional context. Right now, the
information duplicates stuff which is already available from the
parent's device. This is how e.g. `lsgpio`'s output looks like:

  GPIO chip: gpiochip2, "spi1.2", 16 GPIO lines

Comparing the output of other GPIO expanders that I have available:

  gpiochip4: GPIOs 464-479, parent: spi/spi1.1, mcp23s17, can sleep:
  gpiochip5: GPIOs 448-463, parent: i2c/0-0020, pca9555, can sleep:
  gpiochip2: GPIOs 496-511, parent: spi/spi1.2, spi1.2, can sleep:

This patch ensures that the type of the real HW device is shown instead
of duplicating the SPI path:

  gpiochip2: GPIOs 496-511, parent: spi/spi1.2, MAX14830, can sleep:

Signed-off-by: Jan Kundrát <redacted>
---
 drivers/tty/serial/max310x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
index 39f635812077..efe55a1a0615 100644
--- a/drivers/tty/serial/max310x.c
+++ b/drivers/tty/serial/max310x.c
@@ -1318,7 +1318,7 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype,
 	/* Setup GPIO cotroller */
 	s->gpio.owner		= THIS_MODULE;
 	s->gpio.parent		= dev;
-	s->gpio.label		= dev_name(dev);
+	s->gpio.label		= devtype->name;
 	s->gpio.direction_input	= max310x_gpio_direction_input;
 	s->gpio.get		= max310x_gpio_get;
 	s->gpio.direction_output= max310x_gpio_direction_output;
-- 
2.14.3

Re: [PATCH] gpio: serial: max310x: Use HW type for gpio_chip's label

From: Linus Walleij <hidden>
Date: 2018-02-07 13:36:34

On Fri, Jan 26, 2018 at 8:02 PM, Jan Kundrát [off-list ref] wrote:
Some debugging tools (/sys/kernel/debug/gpio, `lsgpio`) use the
gpio_chip's label for displaying an additional context. Right now, the
information duplicates stuff which is already available from the
parent's device. This is how e.g. `lsgpio`'s output looks like:

  GPIO chip: gpiochip2, "spi1.2", 16 GPIO lines

Comparing the output of other GPIO expanders that I have available:

  gpiochip4: GPIOs 464-479, parent: spi/spi1.1, mcp23s17, can sleep:
  gpiochip5: GPIOs 448-463, parent: i2c/0-0020, pca9555, can sleep:
  gpiochip2: GPIOs 496-511, parent: spi/spi1.2, spi1.2, can sleep:

This patch ensures that the type of the real HW device is shown instead
of duplicating the SPI path:

  gpiochip2: GPIOs 496-511, parent: spi/spi1.2, MAX14830, can sleep:

Signed-off-by: Jan Kundrát <redacted>
Reviewed-by: Linus Walleij <redacted>

Greg, pls apply this to your TTY tree.

Yours,
Linus Walleij

Re: [PATCH] gpio: serial: max310x: Use HW type for gpio_chip's label

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2018-02-07 14:23:52

On Wed, Feb 07, 2018 at 02:36:33PM +0100, Linus Walleij wrote:
On Fri, Jan 26, 2018 at 8:02 PM, Jan Kundrát [off-list ref] wrote:
quoted
Some debugging tools (/sys/kernel/debug/gpio, `lsgpio`) use the
gpio_chip's label for displaying an additional context. Right now, the
information duplicates stuff which is already available from the
parent's device. This is how e.g. `lsgpio`'s output looks like:

  GPIO chip: gpiochip2, "spi1.2", 16 GPIO lines

Comparing the output of other GPIO expanders that I have available:

  gpiochip4: GPIOs 464-479, parent: spi/spi1.1, mcp23s17, can sleep:
  gpiochip5: GPIOs 448-463, parent: i2c/0-0020, pca9555, can sleep:
  gpiochip2: GPIOs 496-511, parent: spi/spi1.2, spi1.2, can sleep:

This patch ensures that the type of the real HW device is shown instead
of duplicating the SPI path:

  gpiochip2: GPIOs 496-511, parent: spi/spi1.2, MAX14830, can sleep:

Signed-off-by: Jan Kundrát <redacted>
Reviewed-by: Linus Walleij <redacted>

Greg, pls apply this to your TTY tree.
Ok, let me wait until 4.16-rc1 is out first :)

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help