gpio: mockup: pass the chip label as device property
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Tue, 29 Sep 2020 10:10:02 +0000 (12:10 +0200)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 30 Sep 2020 08:52:11 +0000 (10:52 +0200)
commit148c2560c55b5d4a46849324498f4f0b14a8243d
tree242846269f599c7c6eb75282f014966545107380
parent383bb2de4d494ec0a62a1ab2cd8438c04e9100bd
gpio: mockup: pass the chip label as device property

While we do check the "chip-name" property in probe(), we never actually
use it. Let's pass the chip label to the driver using device properties
as we'll want to allow users to define their own once dynamically
created chips are supported.

The property is renamed to "chip-label" to not cause any confusion with
the actual chip name which is of the form: "gpiochipX".

If the "chip-label" property is missing, let's do what most devices in
drivers/gpio/ do and use dev_name().

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/gpio/gpio-mockup.c