From b003e5e59922d0e9458ebf4af7243454989672f3 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sat, 1 Sep 2012 17:44:27 +0800 Subject: [PATCH] --- yaml --- r: 328447 b: refs/heads/master c: 45e253a7eb23844344bf08dad9961771a643758e h: refs/heads/master i: 328445: d85cdda8f8e57dc3d380b0c3298683e6189d1846 328443: 9d8af2601f187e8451b705a68368934449a0304f 328439: 160197e2ac19b02985dce8fa82b2370b21ccb904 328431: 5ab4a8885298ab8d464b1455eacf8f9af58bf2c6 328415: 25cbb0d41621f5aa1251db02b99e8fc1f983b051 328383: 3bf36d231bf64f67f1aaaee5efb282fa9fa4f48e 328319: 5b6bc56cffff3cb229646b544f615dea4f0f10b7 328191: ac852d27170ed6603614b48034e0bae0e5f1865c v: v3 --- [refs] | 2 +- trunk/drivers/gpio/gpio-tps65912.c | 17 ++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/[refs] b/[refs] index fbc4f858906e..7d5cc0e96927 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: eb7cf95a55a0d737e5f5694e71f65966a1c4e7aa +refs/heads/master: 45e253a7eb23844344bf08dad9961771a643758e diff --git a/trunk/drivers/gpio/gpio-tps65912.c b/trunk/drivers/gpio/gpio-tps65912.c index 79e66c002350..99106d1e2e55 100644 --- a/trunk/drivers/gpio/gpio-tps65912.c +++ b/trunk/drivers/gpio/gpio-tps65912.c @@ -70,7 +70,6 @@ static int tps65912_gpio_input(struct gpio_chip *gc, unsigned offset) return tps65912_clear_bits(tps65912, TPS65912_GPIO1 + offset, GPIO_CFG_MASK); - } static struct gpio_chip template_chip = { @@ -92,7 +91,8 @@ static int __devinit tps65912_gpio_probe(struct platform_device *pdev) struct tps65912_gpio_data *tps65912_gpio; int ret; - tps65912_gpio = kzalloc(sizeof(*tps65912_gpio), GFP_KERNEL); + tps65912_gpio = devm_kzalloc(&pdev->dev, sizeof(*tps65912_gpio), + GFP_KERNEL); if (tps65912_gpio == NULL) return -ENOMEM; @@ -105,28 +105,19 @@ static int __devinit tps65912_gpio_probe(struct platform_device *pdev) ret = gpiochip_add(&tps65912_gpio->gpio_chip); if (ret < 0) { dev_err(&pdev->dev, "Failed to register gpiochip, %d\n", ret); - goto err; + return ret; } platform_set_drvdata(pdev, tps65912_gpio); return ret; - -err: - kfree(tps65912_gpio); - return ret; } static int __devexit tps65912_gpio_remove(struct platform_device *pdev) { struct tps65912_gpio_data *tps65912_gpio = platform_get_drvdata(pdev); - int ret; - - ret = gpiochip_remove(&tps65912_gpio->gpio_chip); - if (ret == 0) - kfree(tps65912_gpio); - return ret; + return gpiochip_remove(&tps65912_gpio->gpio_chip); } static struct platform_driver tps65912_gpio_driver = {