aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/tc3589x.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-05 20:36:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-05 20:36:20 -0400
commitd7ab7302f970a254997687a1cdede421a5635c68 (patch)
tree71341b72e81c8e031b98e8115c51682427192798 /drivers/mfd/tc3589x.c
parent01227a889ed56ae53aeebb9f93be9d54dd8b2de8 (diff)
parent99f4c6b66a9ae362d21e6df95d04bc74e04d285e (diff)
Merge tag 'mfd-3.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-next
Pull MFD update from Samuel Ortiz: "For 3.10 we have a few new MFD drivers for: - The ChromeOS embedded controller which provides keyboard, battery and power management services. This controller is accessible through i2c or SPI. - Silicon Laboratories 476x controller, providing access to their FM chipset and their audio codec. - Realtek's RTS5249, a memory stick, MMC and SD/SDIO PCI based reader. - Nokia's Tahvo power button and watchdog device. This device is very similar to Retu and is thus supported by the same code base. - STMicroelectronics STMPE1801, a keyboard and GPIO controller supported by the stmpe driver. - ST-Ericsson AB8540 and AB8505 power management and voltage converter controllers through the existing ab8500 code. Some other drivers got cleaned up or improved. In particular: - The Linaro/STE guys got the ab8500 driver in sync with their internal code through a series of optimizations, fixes and improvements. - The AS3711 and OMAP USB drivers now have DT support. - The arizona clock and interrupt handling code got improved. - The wm5102 register patch and boot mechanism also got improved." * tag 'mfd-3.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-next: (104 commits) mfd: si476x: Don't use 0bNNN mfd: vexpress: Handle pending config transactions mfd: ab8500: Export ab8500_gpadc_sw_hw_convert properly mfd: si476x: Fix i2c warning mfd: si476x: Add header files and Kbuild plumbing mfd: si476x: Add chip properties handling code mfd: si476x: Add the bulk of the core driver mfd: si476x: Add commands abstraction layer mfd: rtsx: Support RTS5249 mfd: retu: Add Tahvo support mfd: ucb1400: Pass ucb1400-gpio data through ac97 bus mfd: wm8994: Add some OF properties mfd: wm8994: Add device ID data to WM8994 OF device IDs input: Export matrix_keypad_parse_of_params() mfd: tps65090: Add compatible string for charger subnode mfd: db8500-prcmu: Support platform dependant device selection mfd: syscon: Fix warnings when printing resource_size_t of: Add stub of_get_parent for non-OF builds mfd: omap-usb-tll: Convert to devm_ioremap_resource() mfd: omap-usb-host: Convert to devm_ioremap_resource() ...
Diffstat (limited to 'drivers/mfd/tc3589x.c')
-rw-r--r--drivers/mfd/tc3589x.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c
index ecc092c7f745..4cb92bb2aea2 100644
--- a/drivers/mfd/tc3589x.c
+++ b/drivers/mfd/tc3589x.c
@@ -350,7 +350,8 @@ static int tc3589x_probe(struct i2c_client *i2c,
350 | I2C_FUNC_SMBUS_I2C_BLOCK)) 350 | I2C_FUNC_SMBUS_I2C_BLOCK))
351 return -EIO; 351 return -EIO;
352 352
353 tc3589x = kzalloc(sizeof(struct tc3589x), GFP_KERNEL); 353 tc3589x = devm_kzalloc(&i2c->dev, sizeof(struct tc3589x),
354 GFP_KERNEL);
354 if (!tc3589x) 355 if (!tc3589x)
355 return -ENOMEM; 356 return -ENOMEM;
356 357
@@ -366,33 +367,27 @@ static int tc3589x_probe(struct i2c_client *i2c,
366 367
367 ret = tc3589x_chip_init(tc3589x); 368 ret = tc3589x_chip_init(tc3589x);
368 if (ret) 369 if (ret)
369 goto out_free; 370 return ret;
370 371
371 ret = tc3589x_irq_init(tc3589x, np); 372 ret = tc3589x_irq_init(tc3589x, np);
372 if (ret) 373 if (ret)
373 goto out_free; 374 return ret;
374 375
375 ret = request_threaded_irq(tc3589x->i2c->irq, NULL, tc3589x_irq, 376 ret = request_threaded_irq(tc3589x->i2c->irq, NULL, tc3589x_irq,
376 IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 377 IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
377 "tc3589x", tc3589x); 378 "tc3589x", tc3589x);
378 if (ret) { 379 if (ret) {
379 dev_err(tc3589x->dev, "failed to request IRQ: %d\n", ret); 380 dev_err(tc3589x->dev, "failed to request IRQ: %d\n", ret);
380 goto out_free; 381 return ret;
381 } 382 }
382 383
383 ret = tc3589x_device_init(tc3589x); 384 ret = tc3589x_device_init(tc3589x);
384 if (ret) { 385 if (ret) {
385 dev_err(tc3589x->dev, "failed to add child devices\n"); 386 dev_err(tc3589x->dev, "failed to add child devices\n");
386 goto out_freeirq; 387 return ret;
387 } 388 }
388 389
389 return 0; 390 return 0;
390
391out_freeirq:
392 free_irq(tc3589x->i2c->irq, tc3589x);
393out_free:
394 kfree(tc3589x);
395 return ret;
396} 391}
397 392
398static int tc3589x_remove(struct i2c_client *client) 393static int tc3589x_remove(struct i2c_client *client)
@@ -401,10 +396,6 @@ static int tc3589x_remove(struct i2c_client *client)
401 396
402 mfd_remove_devices(tc3589x->dev); 397 mfd_remove_devices(tc3589x->dev);
403 398
404 free_irq(tc3589x->i2c->irq, tc3589x);
405
406 kfree(tc3589x);
407
408 return 0; 399 return 0;
409} 400}
410 401