greybus: can't use devm anymore, we aren't tieing into the driver model lifecycle :(

This commit is contained in:
Greg Kroah-Hartman 2014-08-30 17:11:41 -07:00
parent ba4468d464
commit e5f167f1df
2 changed files with 5 additions and 2 deletions

View File

@ -59,7 +59,7 @@ int gb_gpio_probe(struct greybus_device *gdev,
struct device *dev = &gdev->dev; struct device *dev = &gdev->dev;
int retval; int retval;
gb_gpio = devm_kzalloc(dev, sizeof(*gb_gpio), GFP_KERNEL); gb_gpio = kzalloc(dev, sizeof(*gb_gpio), GFP_KERNEL);
if (!gb_gpio) if (!gb_gpio)
return -ENOMEM; return -ENOMEM;
gb_gpio->gdev = gdev; gb_gpio->gdev = gdev;
@ -95,6 +95,7 @@ void gb_gpio_disconnect(struct greybus_device *gdev)
gb_gpio_dev = gdev->gb_gpio_dev; gb_gpio_dev = gdev->gb_gpio_dev;
gpiochip_remove(&gb_gpio_dev->chip); gpiochip_remove(&gb_gpio_dev->chip);
kfree(gb_gpio_dev);
} }
#if 0 #if 0

View File

@ -390,7 +390,7 @@ int gb_tty_probe(struct greybus_device *gdev,
int retval; int retval;
int minor; 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) if (!gb_tty)
return -ENOMEM; return -ENOMEM;
@ -455,6 +455,8 @@ void gb_tty_disconnect(struct greybus_device *gdev)
/* FIXME - free transmit / recieve buffers */ /* FIXME - free transmit / recieve buffers */
tty_port_put(&gb_tty->port); tty_port_put(&gb_tty->port);
kfree(gb_tty);
} }
static struct greybus_driver tty_gb_driver = { static struct greybus_driver tty_gb_driver = {