Message ID | 1455945199-5068-1-git-send-email-bamv2005@gmail.com |
---|---|
State | New |
Headers | show |
On Sat, Feb 20, 2016 at 6:13 AM, Bamvor Jian Zhang <bamv2005@gmail.com> wrote: > From: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> > > Commit cb464a88e1ed ("gpio: make the gpiochip a real device") call > gpiochip_sysfs_unregister after the gpiochip is empty. It lead to the > following crash: Patch applied. Thanks for fixing my screw-ups! Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 59f0045..7181807 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -624,11 +624,10 @@ void gpiochip_remove(struct gpio_chip *chip) unsigned i; bool requested = false; - /* Numb the device, cancelling all outstanding operations */ - gdev->chip = NULL; - /* FIXME: should the legacy sysfs handling be moved to gpio_device? */ gpiochip_sysfs_unregister(gdev); + /* Numb the device, cancelling all outstanding operations */ + gdev->chip = NULL; gpiochip_irqchip_remove(chip); acpi_gpiochip_remove(chip); gpiochip_remove_pin_ranges(chip);