diff mbox

[2/2] mfd: twl4030-audio: make module DT only

Message ID 1479196880-20344-3-git-send-email-Nicolae_Rosia@mentor.com (mailing list archive)
State New, archived
Headers show

Commit Message

Nicolae Rosia Nov. 15, 2016, 8:01 a.m. UTC
Remove dead code since all users are DT enabled and
the code remains untested.
Move struct twl4030_codec_data to codec/twl4030.c since
it is only used there.

Signed-off-by: Nicolae Rosia <Nicolae_Rosia@mentor.com>
---
 drivers/mfd/twl4030-audio.c | 46 +++++++--------------------------------------
 include/linux/i2c/twl.h     | 23 -----------------------
 sound/soc/codecs/twl4030.c  |  8 ++++++++
 3 files changed, 15 insertions(+), 62 deletions(-)

Comments

kernel test robot Nov. 15, 2016, 9:55 a.m. UTC | #1
Hi Nicolae,

[auto build test ERROR on asoc/for-next]
[also build test ERROR on v4.9-rc5 next-20161115]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Nicolae-Rosia/ASoC-omap-twl4030-rework-probing-for-device-tree-only/20161115-165843
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: i386-randconfig-s1-201646 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/mfd/twl-core.c: In function 'add_children':
>> drivers/mfd/twl-core.c:858:26: error: dereferencing pointer to incomplete type 'struct twl4030_audio_data'
        pdata->audio, sizeof(*pdata->audio),
                             ^~~~~~~~~~~~~

vim +858 drivers/mfd/twl-core.c

80e45b1e drivers/mfd/twl4030-core.c Timo Kokkonen     2009-03-27  852  			return PTR_ERR(child);
80e45b1e drivers/mfd/twl4030-core.c Timo Kokkonen     2009-03-27  853  	}
80e45b1e drivers/mfd/twl4030-core.c Timo Kokkonen     2009-03-27  854  
f78959cf drivers/mfd/twl-core.c     Thierry Reding    2012-09-18  855  	if (IS_ENABLED(CONFIG_MFD_TWL4030_AUDIO) && pdata->audio &&
f78959cf drivers/mfd/twl-core.c     Thierry Reding    2012-09-18  856  	    twl_class_is_4030()) {
3c330279 drivers/mfd/twl-core.c     Peter Ujfalusi    2013-01-16  857  		child = add_child(TWL4030_MODULE_AUDIO_VOICE, "twl4030-audio",
4ae6df5e drivers/mfd/twl-core.c     Peter Ujfalusi    2011-05-31 @858  				pdata->audio, sizeof(*pdata->audio),
d62abe56 drivers/mfd/twl-core.c     Misael Lopez Cruz 2010-02-23  859  				false, 0, 0);
d62abe56 drivers/mfd/twl-core.c     Misael Lopez Cruz 2010-02-23  860  		if (IS_ERR(child))
d62abe56 drivers/mfd/twl-core.c     Misael Lopez Cruz 2010-02-23  861  			return PTR_ERR(child);

:::::: The code at line 858 was first introduced by commit
:::::: 4ae6df5e1018796ce260be59b2c603bd0f9faa94 MFD: twl4030-audio: Rename platform data

:::::: TO: Peter Ujfalusi <peter.ujfalusi@ti.com>
:::::: CC: Peter Ujfalusi <peter.ujfalusi@ti.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
kernel test robot Nov. 15, 2016, 10 a.m. UTC | #2
Hi Nicolae,

[auto build test ERROR on asoc/for-next]
[also build test ERROR on v4.9-rc5 next-20161115]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Nicolae-Rosia/ASoC-omap-twl4030-rework-probing-for-device-tree-only/20161115-165843
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: i386-randconfig-i0-201646 (attached as .config)
compiler: gcc-4.8 (Debian 4.8.4-1) 4.8.4
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All error/warnings (new ones prefixed by >>):

>> drivers/input/misc/twl4030-vibra.c:181:17: warning: 'struct twl4030_vibra_data' declared inside parameter list [enabled by default]
             struct device_node *node)
                    ^
>> drivers/input/misc/twl4030-vibra.c:181:17: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
   drivers/input/misc/twl4030-vibra.c: In function 'twl4030_vibra_check_coexist':
>> drivers/input/misc/twl4030-vibra.c:183:20: error: dereferencing pointer to incomplete type
     if (pdata && pdata->coexist)
                       ^
   drivers/input/misc/twl4030-vibra.c: In function 'twl4030_vibra_probe':
>> drivers/input/misc/twl4030-vibra.c:212:2: warning: passing argument 1 of 'twl4030_vibra_check_coexist' from incompatible pointer type [enabled by default]
     info->coexist = twl4030_vibra_check_coexist(pdata, twl4030_core_node);
     ^
   drivers/input/misc/twl4030-vibra.c:180:13: note: expected 'struct twl4030_vibra_data *' but argument is of type 'struct twl4030_vibra_data *'
    static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata,
                ^

vim +181 drivers/input/misc/twl4030-vibra.c

3dd1b3949 Jari Vanhala   2010-03-09  175  }
3dd1b3949 Jari Vanhala   2010-03-09  176  
3dd1b3949 Jari Vanhala   2010-03-09  177  static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops,
3dd1b3949 Jari Vanhala   2010-03-09  178  			 twl4030_vibra_suspend, twl4030_vibra_resume);
3dd1b3949 Jari Vanhala   2010-03-09  179  
64b9e4d80 Peter Ujfalusi 2012-09-10  180  static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata,
64b9e4d80 Peter Ujfalusi 2012-09-10 @181  			      struct device_node *node)
64b9e4d80 Peter Ujfalusi 2012-09-10  182  {
64b9e4d80 Peter Ujfalusi 2012-09-10 @183  	if (pdata && pdata->coexist)
64b9e4d80 Peter Ujfalusi 2012-09-10  184  		return true;
64b9e4d80 Peter Ujfalusi 2012-09-10  185  
e661d0a04 Marek Belisko  2015-07-29  186  	node = of_find_node_by_name(node, "codec");
e661d0a04 Marek Belisko  2015-07-29  187  	if (node) {
a9e1d3c04 Libo Chen      2014-01-03  188  		of_node_put(node);
64b9e4d80 Peter Ujfalusi 2012-09-10  189  		return true;
a9e1d3c04 Libo Chen      2014-01-03  190  	}
64b9e4d80 Peter Ujfalusi 2012-09-10  191  
64b9e4d80 Peter Ujfalusi 2012-09-10  192  	return false;
64b9e4d80 Peter Ujfalusi 2012-09-10  193  }
64b9e4d80 Peter Ujfalusi 2012-09-10  194  
5298cc4cc Bill Pemberton 2012-11-23  195  static int twl4030_vibra_probe(struct platform_device *pdev)
3dd1b3949 Jari Vanhala   2010-03-09  196  {
c838cb3d4 Jingoo Han     2013-12-05  197  	struct twl4030_vibra_data *pdata = dev_get_platdata(&pdev->dev);
64b9e4d80 Peter Ujfalusi 2012-09-10  198  	struct device_node *twl4030_core_node = pdev->dev.parent->of_node;
3dd1b3949 Jari Vanhala   2010-03-09  199  	struct vibra_info *info;
3dd1b3949 Jari Vanhala   2010-03-09  200  	int ret;
3dd1b3949 Jari Vanhala   2010-03-09  201  
64b9e4d80 Peter Ujfalusi 2012-09-10  202  	if (!pdata && !twl4030_core_node) {
3dd1b3949 Jari Vanhala   2010-03-09  203  		dev_dbg(&pdev->dev, "platform_data not available\n");
3dd1b3949 Jari Vanhala   2010-03-09  204  		return -EINVAL;
3dd1b3949 Jari Vanhala   2010-03-09  205  	}
3dd1b3949 Jari Vanhala   2010-03-09  206  
c3ead16e7 Peter Ujfalusi 2013-01-11  207  	info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
3dd1b3949 Jari Vanhala   2010-03-09  208  	if (!info)
3dd1b3949 Jari Vanhala   2010-03-09  209  		return -ENOMEM;
3dd1b3949 Jari Vanhala   2010-03-09  210  
3dd1b3949 Jari Vanhala   2010-03-09  211  	info->dev = &pdev->dev;
64b9e4d80 Peter Ujfalusi 2012-09-10 @212  	info->coexist = twl4030_vibra_check_coexist(pdata, twl4030_core_node);
3dd1b3949 Jari Vanhala   2010-03-09  213  	INIT_WORK(&info->play_work, vibra_play_work);
3dd1b3949 Jari Vanhala   2010-03-09  214  
c3ead16e7 Peter Ujfalusi 2013-01-11  215  	info->input_dev = devm_input_allocate_device(&pdev->dev);

:::::: The code at line 181 was first introduced by commit
:::::: 64b9e4d803b154a78a2e76bd466bb32ad6f383de input: twl4030-vibra: Support for DT booted kernel

:::::: TO: Peter Ujfalusi <peter.ujfalusi@ti.com>
:::::: CC: Samuel Ortiz <sameo@linux.intel.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
Nicolae Rosia Nov. 15, 2016, 12:19 p.m. UTC | #3
Hi,

On Tue, Nov 15, 2016 at 12:00 PM, kbuild test robot <lkp@intel.com> wrote:
> Hi Nicolae,
>
> [auto build test ERROR on asoc/for-next]
> [also build test ERROR on v4.9-rc5 next-20161115]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
Thanks, I forgot to convert twl4030-vibra, will send v2.

Best regards,
Nicolae Rosia
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mfd/twl4030-audio.c b/drivers/mfd/twl4030-audio.c
index 0a16064..5bda789 100644
--- a/drivers/mfd/twl4030-audio.c
+++ b/drivers/mfd/twl4030-audio.c
@@ -158,43 +158,17 @@  unsigned int twl4030_audio_get_mclk(void)
 }
 EXPORT_SYMBOL_GPL(twl4030_audio_get_mclk);
 
-static bool twl4030_audio_has_codec(struct twl4030_audio_data *pdata,
-			      struct device_node *node)
-{
-	if (pdata && pdata->codec)
-		return true;
-
-	if (of_find_node_by_name(node, "codec"))
-		return true;
-
-	return false;
-}
-
-static bool twl4030_audio_has_vibra(struct twl4030_audio_data *pdata,
-			      struct device_node *node)
-{
-	int vibra;
-
-	if (pdata && pdata->vibra)
-		return true;
-
-	if (!of_property_read_u32(node, "ti,enable-vibra", &vibra) && vibra)
-		return true;
-
-	return false;
-}
-
 static int twl4030_audio_probe(struct platform_device *pdev)
 {
 	struct twl4030_audio *audio;
-	struct twl4030_audio_data *pdata = dev_get_platdata(&pdev->dev);
 	struct device_node *node = pdev->dev.of_node;
 	struct mfd_cell *cell = NULL;
+	u32 enable_vibra = 0;
 	int ret, childs = 0;
 	u8 val;
 
-	if (!pdata && !node) {
-		dev_err(&pdev->dev, "Platform data is missing\n");
+	if (!node) {
+		dev_err(&pdev->dev, "no DT info\n");
 		return -EINVAL;
 	}
 
@@ -231,22 +205,16 @@  static int twl4030_audio_probe(struct platform_device *pdev)
 	audio->resource[TWL4030_AUDIO_RES_APLL].reg = TWL4030_REG_APLL_CTL;
 	audio->resource[TWL4030_AUDIO_RES_APLL].mask = TWL4030_APLL_EN;
 
-	if (twl4030_audio_has_codec(pdata, node)) {
+	if (of_find_node_by_name(node, "codec")) {
 		cell = &audio->cells[childs];
 		cell->name = "twl4030-codec";
-		if (pdata) {
-			cell->platform_data = pdata->codec;
-			cell->pdata_size = sizeof(*pdata->codec);
-		}
 		childs++;
 	}
-	if (twl4030_audio_has_vibra(pdata, node)) {
+
+	of_property_read_u32(node, "ti,enable-vibra", &enable_vibra);
+	if (enable_vibra == 1) {
 		cell = &audio->cells[childs];
 		cell->name = "twl4030-vibra";
-		if (pdata) {
-			cell->platform_data = pdata->vibra;
-			cell->pdata_size = sizeof(*pdata->vibra);
-		}
 		childs++;
 	}
 
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 9ad7828..983791a 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -681,29 +681,6 @@  struct twl4030_power_data {
 extern int twl4030_remove_script(u8 flags);
 extern void twl4030_power_off(void);
 
-struct twl4030_codec_data {
-	unsigned int digimic_delay; /* in ms */
-	unsigned int ramp_delay_value;
-	unsigned int offset_cncl_path;
-	unsigned int hs_extmute:1;
-	int hs_extmute_gpio;
-};
-
-struct twl4030_vibra_data {
-	unsigned int	coexist;
-};
-
-struct twl4030_audio_data {
-	unsigned int	audio_mclk;
-	struct twl4030_codec_data *codec;
-	struct twl4030_vibra_data *vibra;
-
-	/* twl6040 */
-	int audpwron_gpio;	/* audio power-on gpio */
-	int naudint_irq;	/* audio interrupt */
-	unsigned int irq_base;
-};
-
 struct twl4030_platform_data {
 	struct twl4030_clock_init_data		*clock;
 	struct twl4030_bci_platform_data	*bci;
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index a2104d6..5cba27b 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -48,6 +48,14 @@ 
 
 #define TWL4030_CACHEREGNUM	(TWL4030_REG_MISC_SET_2 + 1)
 
+struct twl4030_codec_data {
+	unsigned int digimic_delay; /* in ms */
+	unsigned int ramp_delay_value;
+	unsigned int offset_cncl_path;
+	unsigned int hs_extmute:1;
+	int hs_extmute_gpio;
+};
+
 /* codec private data */
 struct twl4030_priv {
 	unsigned int codec_powered;