提交 4d0fa8a0 编写于 作者: L Linus Torvalds

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

Pull gpio fixes from Linus Walleij:
 "A small batch of GPIO fixes for the v3.15 series.  I expect more to
  come in but I'm a bit behind on mail, might as well get these to you
  right now:

   - Change a crucial semantic ordering in the GPIO irqchip helpers

   - Fix two nasty regressions in the ACPI gpiolib extensions"

* tag 'gpio-v3.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio / ACPI: Prevent potential wrap of GPIO value on OpRegion read
  gpio / ACPI: Don't crash on NULL chip->dev
  gpio: set data first, then chip and handler
...@@ -233,7 +233,7 @@ static void acpi_gpiochip_request_interrupts(struct acpi_gpio_chip *acpi_gpio) ...@@ -233,7 +233,7 @@ static void acpi_gpiochip_request_interrupts(struct acpi_gpio_chip *acpi_gpio)
{ {
struct gpio_chip *chip = acpi_gpio->chip; struct gpio_chip *chip = acpi_gpio->chip;
if (!chip->dev || !chip->to_irq) if (!chip->to_irq)
return; return;
INIT_LIST_HEAD(&acpi_gpio->events); INIT_LIST_HEAD(&acpi_gpio->events);
...@@ -253,7 +253,7 @@ static void acpi_gpiochip_free_interrupts(struct acpi_gpio_chip *acpi_gpio) ...@@ -253,7 +253,7 @@ static void acpi_gpiochip_free_interrupts(struct acpi_gpio_chip *acpi_gpio)
struct acpi_gpio_event *event, *ep; struct acpi_gpio_event *event, *ep;
struct gpio_chip *chip = acpi_gpio->chip; struct gpio_chip *chip = acpi_gpio->chip;
if (!chip->dev || !chip->to_irq) if (!chip->to_irq)
return; return;
list_for_each_entry_safe_reverse(event, ep, &acpi_gpio->events, node) { list_for_each_entry_safe_reverse(event, ep, &acpi_gpio->events, node) {
...@@ -451,7 +451,7 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address, ...@@ -451,7 +451,7 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address,
if (function == ACPI_WRITE) if (function == ACPI_WRITE)
gpiod_set_raw_value(desc, !!((1 << i) & *value)); gpiod_set_raw_value(desc, !!((1 << i) & *value));
else else
*value |= gpiod_get_raw_value(desc) << i; *value |= (u64)gpiod_get_raw_value(desc) << i;
} }
out: out:
...@@ -501,6 +501,9 @@ void acpi_gpiochip_add(struct gpio_chip *chip) ...@@ -501,6 +501,9 @@ void acpi_gpiochip_add(struct gpio_chip *chip)
acpi_handle handle; acpi_handle handle;
acpi_status status; acpi_status status;
if (!chip || !chip->dev)
return;
handle = ACPI_HANDLE(chip->dev); handle = ACPI_HANDLE(chip->dev);
if (!handle) if (!handle)
return; return;
...@@ -531,6 +534,9 @@ void acpi_gpiochip_remove(struct gpio_chip *chip) ...@@ -531,6 +534,9 @@ void acpi_gpiochip_remove(struct gpio_chip *chip)
acpi_handle handle; acpi_handle handle;
acpi_status status; acpi_status status;
if (!chip || !chip->dev)
return;
handle = ACPI_HANDLE(chip->dev); handle = ACPI_HANDLE(chip->dev);
if (!handle) if (!handle)
return; return;
......
...@@ -1387,8 +1387,8 @@ static int gpiochip_irq_map(struct irq_domain *d, unsigned int irq, ...@@ -1387,8 +1387,8 @@ static int gpiochip_irq_map(struct irq_domain *d, unsigned int irq,
{ {
struct gpio_chip *chip = d->host_data; struct gpio_chip *chip = d->host_data;
irq_set_chip_and_handler(irq, chip->irqchip, chip->irq_handler);
irq_set_chip_data(irq, chip); irq_set_chip_data(irq, chip);
irq_set_chip_and_handler(irq, chip->irqchip, chip->irq_handler);
#ifdef CONFIG_ARM #ifdef CONFIG_ARM
set_irq_flags(irq, IRQF_VALID); set_irq_flags(irq, IRQF_VALID);
#else #else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册