diff options
Diffstat (limited to 'drivers/mfd/tps65010.c')
-rw-r--r-- | drivers/mfd/tps65010.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/mfd/tps65010.c b/drivers/mfd/tps65010.c index da2691f22e11..743fb524fc8a 100644 --- a/drivers/mfd/tps65010.c +++ b/drivers/mfd/tps65010.c | |||
@@ -242,8 +242,8 @@ static int dbg_show(struct seq_file *s, void *_) | |||
242 | seq_printf(s, "mask2 %s\n", buf); | 242 | seq_printf(s, "mask2 %s\n", buf); |
243 | /* ignore ackint2 */ | 243 | /* ignore ackint2 */ |
244 | 244 | ||
245 | schedule_delayed_work(&tps->work, POWER_POLL_DELAY); | 245 | queue_delayed_work(system_power_efficient_wq, &tps->work, |
246 | 246 | POWER_POLL_DELAY); | |
247 | 247 | ||
248 | /* VMAIN voltage, enable lowpower, etc */ | 248 | /* VMAIN voltage, enable lowpower, etc */ |
249 | value = i2c_smbus_read_byte_data(tps->client, TPS_VDCDC1); | 249 | value = i2c_smbus_read_byte_data(tps->client, TPS_VDCDC1); |
@@ -400,7 +400,8 @@ static void tps65010_interrupt(struct tps65010 *tps) | |||
400 | && (tps->chgstatus & (TPS_CHG_USB|TPS_CHG_AC))) | 400 | && (tps->chgstatus & (TPS_CHG_USB|TPS_CHG_AC))) |
401 | poll = 1; | 401 | poll = 1; |
402 | if (poll) | 402 | if (poll) |
403 | schedule_delayed_work(&tps->work, POWER_POLL_DELAY); | 403 | queue_delayed_work(system_power_efficient_wq, &tps->work, |
404 | POWER_POLL_DELAY); | ||
404 | 405 | ||
405 | /* also potentially gpio-in rise or fall */ | 406 | /* also potentially gpio-in rise or fall */ |
406 | } | 407 | } |
@@ -448,7 +449,7 @@ static irqreturn_t tps65010_irq(int irq, void *_tps) | |||
448 | 449 | ||
449 | disable_irq_nosync(irq); | 450 | disable_irq_nosync(irq); |
450 | set_bit(FLAG_IRQ_ENABLE, &tps->flags); | 451 | set_bit(FLAG_IRQ_ENABLE, &tps->flags); |
451 | schedule_delayed_work(&tps->work, 0); | 452 | queue_delayed_work(system_power_efficient_wq, &tps->work, 0); |
452 | return IRQ_HANDLED; | 453 | return IRQ_HANDLED; |
453 | } | 454 | } |
454 | 455 | ||
@@ -517,7 +518,7 @@ static struct tps65010 *the_tps; | |||
517 | static int __exit tps65010_remove(struct i2c_client *client) | 518 | static int __exit tps65010_remove(struct i2c_client *client) |
518 | { | 519 | { |
519 | struct tps65010 *tps = i2c_get_clientdata(client); | 520 | struct tps65010 *tps = i2c_get_clientdata(client); |
520 | struct tps65010_board *board = client->dev.platform_data; | 521 | struct tps65010_board *board = dev_get_platdata(&client->dev); |
521 | 522 | ||
522 | if (board && board->teardown) { | 523 | if (board && board->teardown) { |
523 | int status = board->teardown(client, board->context); | 524 | int status = board->teardown(client, board->context); |
@@ -529,7 +530,6 @@ static int __exit tps65010_remove(struct i2c_client *client) | |||
529 | free_irq(client->irq, tps); | 530 | free_irq(client->irq, tps); |
530 | cancel_delayed_work_sync(&tps->work); | 531 | cancel_delayed_work_sync(&tps->work); |
531 | debugfs_remove(tps->file); | 532 | debugfs_remove(tps->file); |
532 | kfree(tps); | ||
533 | the_tps = NULL; | 533 | the_tps = NULL; |
534 | return 0; | 534 | return 0; |
535 | } | 535 | } |
@@ -539,7 +539,7 @@ static int tps65010_probe(struct i2c_client *client, | |||
539 | { | 539 | { |
540 | struct tps65010 *tps; | 540 | struct tps65010 *tps; |
541 | int status; | 541 | int status; |
542 | struct tps65010_board *board = client->dev.platform_data; | 542 | struct tps65010_board *board = dev_get_platdata(&client->dev); |
543 | 543 | ||
544 | if (the_tps) { | 544 | if (the_tps) { |
545 | dev_dbg(&client->dev, "only one tps6501x chip allowed\n"); | 545 | dev_dbg(&client->dev, "only one tps6501x chip allowed\n"); |
@@ -549,7 +549,7 @@ static int tps65010_probe(struct i2c_client *client, | |||
549 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 549 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
550 | return -EINVAL; | 550 | return -EINVAL; |
551 | 551 | ||
552 | tps = kzalloc(sizeof *tps, GFP_KERNEL); | 552 | tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL); |
553 | if (!tps) | 553 | if (!tps) |
554 | return -ENOMEM; | 554 | return -ENOMEM; |
555 | 555 | ||
@@ -567,7 +567,7 @@ static int tps65010_probe(struct i2c_client *client, | |||
567 | if (status < 0) { | 567 | if (status < 0) { |
568 | dev_dbg(&client->dev, "can't get IRQ %d, err %d\n", | 568 | dev_dbg(&client->dev, "can't get IRQ %d, err %d\n", |
569 | client->irq, status); | 569 | client->irq, status); |
570 | goto fail1; | 570 | return status; |
571 | } | 571 | } |
572 | /* annoying race here, ideally we'd have an option | 572 | /* annoying race here, ideally we'd have an option |
573 | * to claim the irq now and enable it later. | 573 | * to claim the irq now and enable it later. |
@@ -667,9 +667,6 @@ static int tps65010_probe(struct i2c_client *client, | |||
667 | } | 667 | } |
668 | 668 | ||
669 | return 0; | 669 | return 0; |
670 | fail1: | ||
671 | kfree(tps); | ||
672 | return status; | ||
673 | } | 670 | } |
674 | 671 | ||
675 | static const struct i2c_device_id tps65010_id[] = { | 672 | static const struct i2c_device_id tps65010_id[] = { |
@@ -718,7 +715,8 @@ int tps65010_set_vbus_draw(unsigned mA) | |||
718 | && test_and_set_bit( | 715 | && test_and_set_bit( |
719 | FLAG_VBUS_CHANGED, &the_tps->flags)) { | 716 | FLAG_VBUS_CHANGED, &the_tps->flags)) { |
720 | /* gadget drivers call this in_irq() */ | 717 | /* gadget drivers call this in_irq() */ |
721 | schedule_delayed_work(&the_tps->work, 0); | 718 | queue_delayed_work(system_power_efficient_wq, &the_tps->work, |
719 | 0); | ||
722 | } | 720 | } |
723 | local_irq_restore(flags); | 721 | local_irq_restore(flags); |
724 | 722 | ||