summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-wm8994.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2012-08-27 17:04:24 +0200
committerJiri Kosina <jkosina@suse.cz>2012-08-27 17:05:17 +0200
commit66a61fc0b2c3475f26f65b5f29ed5945b8efbf9e (patch)
tree28ebaaee56786cd9199e0e5802d166474d30d1e3 /drivers/gpio/gpio-wm8994.c
parentHID: hid-debug: Show rdesc for unclaimed devices (diff)
parentMerge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/gi... (diff)
downloadlinux-66a61fc0b2c3475f26f65b5f29ed5945b8efbf9e.tar.xz
linux-66a61fc0b2c3475f26f65b5f29ed5945b8efbf9e.zip
Merge branch 'master' into upstream
Sync with Linus' tree so that we don't have build falures due to Quanta 3001 ID reshuffling.
Diffstat (limited to 'drivers/gpio/gpio-wm8994.c')
-rw-r--r--drivers/gpio/gpio-wm8994.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/gpio/gpio-wm8994.c b/drivers/gpio/gpio-wm8994.c
index aa61ad2fcaaa..1c764e779d80 100644
--- a/drivers/gpio/gpio-wm8994.c
+++ b/drivers/gpio/gpio-wm8994.c
@@ -19,6 +19,7 @@
#include <linux/mfd/core.h>
#include <linux/platform_device.h>
#include <linux/seq_file.h>
+#include <linux/regmap.h>
#include <linux/mfd/wm8994/core.h>
#include <linux/mfd/wm8994/pdata.h>
@@ -112,10 +113,7 @@ static int wm8994_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip);
struct wm8994 *wm8994 = wm8994_gpio->wm8994;
- if (!wm8994->irq_base)
- return -EINVAL;
-
- return wm8994->irq_base + offset;
+ return regmap_irq_get_virq(wm8994->irq_data, offset);
}
@@ -254,7 +252,8 @@ static int __devinit wm8994_gpio_probe(struct platform_device *pdev)
struct wm8994_gpio *wm8994_gpio;
int ret;
- wm8994_gpio = kzalloc(sizeof(*wm8994_gpio), GFP_KERNEL);
+ wm8994_gpio = devm_kzalloc(&pdev->dev, sizeof(*wm8994_gpio),
+ GFP_KERNEL);
if (wm8994_gpio == NULL)
return -ENOMEM;
@@ -279,20 +278,14 @@ static int __devinit wm8994_gpio_probe(struct platform_device *pdev)
return ret;
err:
- kfree(wm8994_gpio);
return ret;
}
static int __devexit wm8994_gpio_remove(struct platform_device *pdev)
{
struct wm8994_gpio *wm8994_gpio = platform_get_drvdata(pdev);
- int ret;
- ret = gpiochip_remove(&wm8994_gpio->gpio_chip);
- if (ret == 0)
- kfree(wm8994_gpio);
-
- return ret;
+ return gpiochip_remove(&wm8994_gpio->gpio_chip);
}
static struct platform_driver wm8994_gpio_driver = {