GPIO fixes for v4.15 take three:

- Fix a build problem in the gpio single register created by
   refactorings.
 
 - Fix assignment of GPIO line names, something that was
   mangled by another patch.
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJaP6Y/AAoJEEEQszewGV1zG7wP/0muM/n/boAMHuBs2mBtC1qh
 P8UAZjCO23Li4vX67d6kodYcVQhES8ntBhSANykaAdaNaluAHm6FTxrM0fGDt2Wd
 MtwwzbmXgOFQT8/Vvou6fx2YLJBZgYf/x3U+G0tkXYQTmZTH5zHgl8vBz8+L8+5p
 gWm02CVuogy8K/r11aYg3goj8wih6MTrMHKtBab9qvF9mB2/C2yrPdstDvXlvkvy
 KiTSnZu4AHHm0cdFgQXgB3SAp2bnqqVz0jYuZjMofzLmNYdxQjLWDJvWfkNmxuzQ
 +zsG4UG9AjHtjObdtsEs6e00V4oHbnyoHwFwXqvcBDumR56axbyfNpQYhB8zTtCm
 4JrxJoM5pZG9V7oXv346eDspf+gVqEI8gVWpll+PPMRQ+Vlt9TvYsP+XOVA7eNcd
 rM8wnK4xzXzTQRfKY5r7drhMtCOmaihnV8g599YPlzhS5rnmYLHNO6v6V9y6rmVd
 gysskKtyKe0C4B2rFJdUHNihXTw9wdzMdiT2dlGDiH1o9k+NkCDLe4WeJ08Cg8Hb
 LP+J5r+8dGqUItu77wSb3ZwmfTUq+0eG05CozggoTUDPphJz6OHaBf2xDKQolamL
 RRLVgYbr0n58B1WJMGquLkV6wJOUVPRwQL9HvW4l7UmcObROv3rbKDTGmdte4BTY
 uCDSUXTog2vubl20s36D
 =9KOX
 -----END PGP SIGNATURE-----

Merge tag 'gpio-v4.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO fixes from Linus Walleij:
 "Two fixes. They are both kind of important, so why not send a pull
  request on christmas eve.

   - Fix a build problem in the gpio single register created by
     refactorings.

   - Fix assignment of GPIO line names, something that was mangled by
     another patch"

* tag 'gpio-v4.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio: fix "gpio-line-names" property retrieval
  gpio: gpio-reg: fix build
This commit is contained in:
Linus Torvalds 2017-12-26 18:17:18 -08:00
Родитель 464e1d5f23 8227033547
Коммит e2a930071d
5 изменённых файлов: 14 добавлений и 15 удалений

Просмотреть файл

@ -103,8 +103,8 @@ static int gpio_reg_to_irq(struct gpio_chip *gc, unsigned offset)
struct gpio_reg *r = to_gpio_reg(gc);
int irq = r->irqs[offset];
if (irq >= 0 && r->irq.domain)
irq = irq_find_mapping(r->irq.domain, irq);
if (irq >= 0 && r->irqdomain)
irq = irq_find_mapping(r->irqdomain, irq);
return irq;
}

Просмотреть файл

@ -1074,7 +1074,7 @@ void acpi_gpiochip_add(struct gpio_chip *chip)
}
if (!chip->names)
devprop_gpiochip_set_names(chip);
devprop_gpiochip_set_names(chip, dev_fwnode(chip->parent));
acpi_gpiochip_request_regions(acpi_gpio);
acpi_gpiochip_scan_gpios(acpi_gpio);

Просмотреть файл

@ -19,30 +19,27 @@
/**
* devprop_gpiochip_set_names - Set GPIO line names using device properties
* @chip: GPIO chip whose lines should be named, if possible
* @fwnode: Property Node containing the gpio-line-names property
*
* Looks for device property "gpio-line-names" and if it exists assigns
* GPIO line names for the chip. The memory allocated for the assigned
* names belong to the underlying firmware node and should not be released
* by the caller.
*/
void devprop_gpiochip_set_names(struct gpio_chip *chip)
void devprop_gpiochip_set_names(struct gpio_chip *chip,
const struct fwnode_handle *fwnode)
{
struct gpio_device *gdev = chip->gpiodev;
const char **names;
int ret, i;
if (!chip->parent) {
dev_warn(&gdev->dev, "GPIO chip parent is NULL\n");
return;
}
ret = device_property_read_string_array(chip->parent, "gpio-line-names",
ret = fwnode_property_read_string_array(fwnode, "gpio-line-names",
NULL, 0);
if (ret < 0)
return;
if (ret != gdev->ngpio) {
dev_warn(chip->parent,
dev_warn(&gdev->dev,
"names %d do not match number of GPIOs %d\n", ret,
gdev->ngpio);
return;
@ -52,10 +49,10 @@ void devprop_gpiochip_set_names(struct gpio_chip *chip)
if (!names)
return;
ret = device_property_read_string_array(chip->parent, "gpio-line-names",
ret = fwnode_property_read_string_array(fwnode, "gpio-line-names",
names, gdev->ngpio);
if (ret < 0) {
dev_warn(chip->parent, "failed to read GPIO line names\n");
dev_warn(&gdev->dev, "failed to read GPIO line names\n");
kfree(names);
return;
}

Просмотреть файл

@ -493,7 +493,8 @@ int of_gpiochip_add(struct gpio_chip *chip)
/* If the chip defines names itself, these take precedence */
if (!chip->names)
devprop_gpiochip_set_names(chip);
devprop_gpiochip_set_names(chip,
of_fwnode_handle(chip->of_node));
of_node_get(chip->of_node);

Просмотреть файл

@ -228,7 +228,8 @@ static inline int gpio_chip_hwgpio(const struct gpio_desc *desc)
return desc - &desc->gdev->descs[0];
}
void devprop_gpiochip_set_names(struct gpio_chip *chip);
void devprop_gpiochip_set_names(struct gpio_chip *chip,
const struct fwnode_handle *fwnode);
/* With descriptor prefix */