aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-wm8994.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-26 16:56:38 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-26 16:56:38 -0400
commitf948ad0787de7b393c325803014fd7d5f1b501b1 (patch)
treed5ac20ec61151809b8e365a137099a3f93562692 /drivers/gpio/gpio-wm8994.c
parent608adca52305e4d14ca5978f9c62698ca45d3f42 (diff)
parent4fbb0022cba37eef4a263183fdb7dbee89b299f2 (diff)
Merge tag 'gpio-for-v3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio
Pull GPIO changes from Linus Walleij: - New driver for AMD-8111 southbridge GPIOs - New driver for Wolfson Micro Arizona devices - Propagate device tree parse errors - Probe deferral finalizations - all expected calls to GPIO will now hopefully request deferral where apropriate - Misc updates to TCA6424, WM8994, LPC32xx, PCF857x, Samsung MXC, OMAP and PCA953X drivers. Fix up gpio_idx conflicts in drivers/gpio/gpio-mxc.c * tag 'gpio-for-v3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: gpio: of_get_named_gpio_flags() return -EPROBE_DEFER if GPIO not yet available gpiolib: Defer failed gpio requests by default MAINTAINERS: add entry OMAP GPIO driver gpio/pca953x: increase variables size to support 24 bit of data GPIO: PCA953X: Increase size of invert variable to support 24 bit gpio/omap: move bank->dbck initialization to omap_gpio_mod_init() gpio/mxc: use the edge_sel feature if available gpio: propagate of_parse_phandle_with_args errors gpio: samsung: add flags specifier to device-tree binding gpiolib: Add support for Wolfson Microelectronics Arizona class devices gpio: gpio-lpc32xx: Add gpio_to_irq mapping gpio: pcf857x: share 8/16 bit access functions gpio: LPC32xx: Driver cleanup MAINTAINERS: Add Wolfson gpiolib drivers to the Wolfson entry gpiolib: wm8994: Convert to devm_kzalloc() gpiolib: wm8994: Use irq_domain mappings for gpios gpio: add a driver for GPIO pins found on AMD-8111 south bridge chips gpio/tca6424: merge I2C transactions, remove cast gpio/of: fix a typo of comment message
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 @@
19#include <linux/mfd/core.h> 19#include <linux/mfd/core.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/seq_file.h> 21#include <linux/seq_file.h>
22#include <linux/regmap.h>
22 23
23#include <linux/mfd/wm8994/core.h> 24#include <linux/mfd/wm8994/core.h>
24#include <linux/mfd/wm8994/pdata.h> 25#include <linux/mfd/wm8994/pdata.h>
@@ -112,10 +113,7 @@ static int wm8994_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
112 struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip); 113 struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip);
113 struct wm8994 *wm8994 = wm8994_gpio->wm8994; 114 struct wm8994 *wm8994 = wm8994_gpio->wm8994;
114 115
115 if (!wm8994->irq_base) 116 return regmap_irq_get_virq(wm8994->irq_data, offset);
116 return -EINVAL;
117
118 return wm8994->irq_base + offset;
119} 117}
120 118
121 119
@@ -254,7 +252,8 @@ static int __devinit wm8994_gpio_probe(struct platform_device *pdev)
254 struct wm8994_gpio *wm8994_gpio; 252 struct wm8994_gpio *wm8994_gpio;
255 int ret; 253 int ret;
256 254
257 wm8994_gpio = kzalloc(sizeof(*wm8994_gpio), GFP_KERNEL); 255 wm8994_gpio = devm_kzalloc(&pdev->dev, sizeof(*wm8994_gpio),
256 GFP_KERNEL);
258 if (wm8994_gpio == NULL) 257 if (wm8994_gpio == NULL)
259 return -ENOMEM; 258 return -ENOMEM;
260 259
@@ -279,20 +278,14 @@ static int __devinit wm8994_gpio_probe(struct platform_device *pdev)
279 return ret; 278 return ret;
280 279
281err: 280err:
282 kfree(wm8994_gpio);
283 return ret; 281 return ret;
284} 282}
285 283
286static int __devexit wm8994_gpio_remove(struct platform_device *pdev) 284static int __devexit wm8994_gpio_remove(struct platform_device *pdev)
287{ 285{
288 struct wm8994_gpio *wm8994_gpio = platform_get_drvdata(pdev); 286 struct wm8994_gpio *wm8994_gpio = platform_get_drvdata(pdev);
289 int ret;
290 287
291 ret = gpiochip_remove(&wm8994_gpio->gpio_chip); 288 return gpiochip_remove(&wm8994_gpio->gpio_chip);
292 if (ret == 0)
293 kfree(wm8994_gpio);
294
295 return ret;
296} 289}
297 290
298static struct platform_driver wm8994_gpio_driver = { 291static struct platform_driver wm8994_gpio_driver = {