From: Greg Kroah-Hartman Date: Sun, 31 Aug 2014 00:11:41 +0000 (-0700) Subject: greybus: can't use devm anymore, we aren't tieing into the driver model lifecycle :( X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e5f167f1df8c0975ab90489724e7f542cd72dc45;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git greybus: can't use devm anymore, we aren't tieing into the driver model lifecycle :( --- diff --git a/drivers/staging/greybus/gpio-gb.c b/drivers/staging/greybus/gpio-gb.c index 7b8b85f6f9e5..43fd0d350723 100644 --- a/drivers/staging/greybus/gpio-gb.c +++ b/drivers/staging/greybus/gpio-gb.c @@ -59,7 +59,7 @@ int gb_gpio_probe(struct greybus_device *gdev, struct device *dev = &gdev->dev; int retval; - gb_gpio = devm_kzalloc(dev, sizeof(*gb_gpio), GFP_KERNEL); + gb_gpio = kzalloc(dev, sizeof(*gb_gpio), GFP_KERNEL); if (!gb_gpio) return -ENOMEM; gb_gpio->gdev = gdev; @@ -95,6 +95,7 @@ void gb_gpio_disconnect(struct greybus_device *gdev) gb_gpio_dev = gdev->gb_gpio_dev; gpiochip_remove(&gb_gpio_dev->chip); + kfree(gb_gpio_dev); } #if 0 diff --git a/drivers/staging/greybus/uart-gb.c b/drivers/staging/greybus/uart-gb.c index 377ad3846020..298b9ff7841b 100644 --- a/drivers/staging/greybus/uart-gb.c +++ b/drivers/staging/greybus/uart-gb.c @@ -390,7 +390,7 @@ int gb_tty_probe(struct greybus_device *gdev, int retval; int minor; - gb_tty = devm_kzalloc(&gdev->dev, sizeof(*gb_tty), GFP_KERNEL); + gb_tty = kzalloc(&gdev->dev, sizeof(*gb_tty), GFP_KERNEL); if (!gb_tty) return -ENOMEM; @@ -455,6 +455,8 @@ void gb_tty_disconnect(struct greybus_device *gdev) /* FIXME - free transmit / recieve buffers */ tty_port_put(&gb_tty->port); + + kfree(gb_tty); } static struct greybus_driver tty_gb_driver = {