Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: twl6040: Do not use wrapper for irq request

The twl6040_request_irq/free_irq inline functions are going
to be removed, so replace them with direct calls.
The irq number is provided by the core driver via resource.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

+14 -5
+14 -5
sound/soc/codecs/twl6040.c
··· 76 76 77 77 /* codec private data */ 78 78 struct twl6040_data { 79 + int plug_irq; 79 80 int codec_powered; 80 81 int pll; 81 82 int non_lp; ··· 1528 1527 { 1529 1528 struct twl6040_data *priv; 1530 1529 struct twl4030_codec_data *pdata = dev_get_platdata(codec->dev); 1530 + struct platform_device *pdev = container_of(codec->dev, 1531 + struct platform_device, dev); 1531 1532 int ret = 0; 1532 1533 1533 1534 priv = kzalloc(sizeof(struct twl6040_data), GFP_KERNEL); ··· 1554 1551 } else { 1555 1552 priv->hf_left_step = 1; 1556 1553 priv->hf_right_step = 1; 1554 + } 1555 + 1556 + priv->plug_irq = platform_get_irq(pdev, 0); 1557 + if (priv->plug_irq < 0) { 1558 + dev_err(codec->dev, "invalid irq\n"); 1559 + ret = -EINVAL; 1560 + goto work_err; 1557 1561 } 1558 1562 1559 1563 priv->sysclk_constraints = &hp_constraints; ··· 1591 1581 INIT_DELAYED_WORK(&priv->hs_delayed_work, twl6040_pga_hs_work); 1592 1582 INIT_DELAYED_WORK(&priv->hf_delayed_work, twl6040_pga_hf_work); 1593 1583 1594 - ret = twl6040_request_irq(codec->control_data, TWL6040_IRQ_PLUG, 1595 - twl6040_audio_handler, 0, 1596 - "twl6040_irq_plug", codec); 1584 + ret = request_threaded_irq(priv->plug_irq, NULL, twl6040_audio_handler, 1585 + 0, "twl6040_irq_plug", codec); 1597 1586 if (ret) { 1598 1587 dev_err(codec->dev, "PLUG IRQ request failed: %d\n", ret); 1599 1588 goto plugirq_err; ··· 1613 1604 return 0; 1614 1605 1615 1606 bias_err: 1616 - twl6040_free_irq(codec->control_data, TWL6040_IRQ_PLUG, codec); 1607 + free_irq(priv->plug_irq, codec); 1617 1608 plugirq_err: 1618 1609 destroy_workqueue(priv->hs_workqueue); 1619 1610 hswq_err: ··· 1630 1621 struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); 1631 1622 1632 1623 twl6040_set_bias_level(codec, SND_SOC_BIAS_OFF); 1633 - twl6040_free_irq(codec->control_data, TWL6040_IRQ_PLUG, codec); 1624 + free_irq(priv->plug_irq, codec); 1634 1625 destroy_workqueue(priv->workqueue); 1635 1626 destroy_workqueue(priv->hf_workqueue); 1636 1627 destroy_workqueue(priv->hs_workqueue);