Commit 5128f8d4 authored by Linus Walleij's avatar Linus Walleij Committed by Ulf Hansson

gpio: name PCA953x gpio chips after device name

Instead of using the name directly from the I2C client
to name the gpio_chip, use dev_name() on the client->dev,
so we get the sometimes more unique device name, as I2C has
a mechanism for naming its devices explicitly in e.g.
board data.

This is a prerequisite for being able to reference
uniquely any I2C GPIO expander defined in a board file
when setting up GPIO descriptor tables.
Reviewed-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent d2951dfa
...@@ -449,7 +449,7 @@ static void pca953x_setup_gpio(struct pca953x_chip *chip, int gpios) ...@@ -449,7 +449,7 @@ static void pca953x_setup_gpio(struct pca953x_chip *chip, int gpios)
gc->base = chip->gpio_start; gc->base = chip->gpio_start;
gc->ngpio = gpios; gc->ngpio = gpios;
gc->label = chip->client->name; gc->label = dev_name(&chip->client->dev);
gc->parent = &chip->client->dev; gc->parent = &chip->client->dev;
gc->owner = THIS_MODULE; gc->owner = THIS_MODULE;
gc->names = chip->names; gc->names = chip->names;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment