diff mbox

[v3,03/10] input: tps65218-pwrbutton: Add platform_device_id table

Message ID 1467093980-11458-4-git-send-email-j-keerthy@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

J, KEERTHY June 28, 2016, 6:06 a.m. UTC
platform_device_id table is needed for adding the tps65218-pwrbutton
module to the mfd_cell array.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 drivers/input/misc/tps65218-pwrbutton.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

kernel test robot June 28, 2016, 6:25 a.m. UTC | #1
Hi,

[auto build test ERROR on robh/for-next]
[also build test ERROR on v4.7-rc5 next-20160627]
[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/Keerthy/mfd-tps65218-Clean-ups/20160628-141354
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: tile-allmodconfig (attached as .config)
compiler: tilegx-linux-gcc (GCC) 4.6.2
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=tile 

All errors (new ones prefixed by >>):

>> drivers/input/misc/tps65218-pwrbutton.c:120:1: error: expected ',' or ';' before 'extern'

vim +120 drivers/input/misc/tps65218-pwrbutton.c

   114	MODULE_DEVICE_TABLE(of, of_tps65218_pwr_match);
   115	
   116	static const struct platform_device_id tps65218_pwrbtn_id_table[] = {
   117		{ "tps65218-pwrbutton", },
   118		{ /* sentinel */ }
   119	}
 > 120	MODULE_DEVICE_TABLE(platform, tps65218_pwrbtn_id_table);
   121	
   122	static struct platform_driver tps65218_pwron_driver = {
   123		.probe	= tps65218_pwron_probe,

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

[auto build test ERROR on robh/for-next]
[also build test ERROR on v4.7-rc5 next-20160627]
[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/Keerthy/mfd-tps65218-Clean-ups/20160628-141354
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: sparc64-allmodconfig (attached as .config)
compiler: sparc64-linux-gnu-gcc (Debian 5.3.1-8) 5.3.1 20160205
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=sparc64 

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

   In file included from drivers/input/misc/tps65218-pwrbutton.c:22:0:
>> include/linux/module.h:223:1: error: expected ',' or ';' before 'extern'
    extern const typeof(name) __mod_##type##__##name##_device_table  \
    ^
>> drivers/input/misc/tps65218-pwrbutton.c:120:1: note: in expansion of macro 'MODULE_DEVICE_TABLE'
    MODULE_DEVICE_TABLE(platform, tps65218_pwrbtn_id_table);
    ^

vim +/MODULE_DEVICE_TABLE +120 drivers/input/misc/tps65218-pwrbutton.c

    16	
    17	#include <linux/init.h>
    18	#include <linux/input.h>
    19	#include <linux/interrupt.h>
    20	#include <linux/kernel.h>
    21	#include <linux/mfd/tps65218.h>
  > 22	#include <linux/module.h>
    23	#include <linux/of.h>
    24	#include <linux/platform_device.h>
    25	#include <linux/regmap.h>
    26	#include <linux/slab.h>
    27	
    28	struct tps65218_pwrbutton {
    29		struct device *dev;
    30		struct tps65218 *tps;
    31		struct input_dev *idev;
    32	};
    33	
    34	static irqreturn_t tps65218_pwr_irq(int irq, void *_pwr)
    35	{
    36		struct tps65218_pwrbutton *pwr = _pwr;
    37		unsigned int reg;
    38		int error;
    39	
    40		error = regmap_read(pwr->tps->regmap, TPS65218_REG_STATUS, &reg);
    41		if (error) {
    42			dev_err(pwr->dev, "can't read register: %d\n", error);
    43			goto out;
    44		}
    45	
    46		if (reg & TPS65218_STATUS_PB_STATE) {
    47			input_report_key(pwr->idev, KEY_POWER, 1);
    48			pm_wakeup_event(pwr->dev, 0);
    49		} else {
    50			input_report_key(pwr->idev, KEY_POWER, 0);
    51		}
    52	
    53		input_sync(pwr->idev);
    54	
    55	out:
    56		return IRQ_HANDLED;
    57	}
    58	
    59	static int tps65218_pwron_probe(struct platform_device *pdev)
    60	{
    61		struct tps65218 *tps = dev_get_drvdata(pdev->dev.parent);
    62		struct device *dev = &pdev->dev;
    63		struct tps65218_pwrbutton *pwr;
    64		struct input_dev *idev;
    65		int error;
    66		int irq;
    67	
    68		pwr = devm_kzalloc(dev, sizeof(*pwr), GFP_KERNEL);
    69		if (!pwr)
    70			return -ENOMEM;
    71	
    72		idev = devm_input_allocate_device(dev);
    73		if (!idev)
    74			return -ENOMEM;
    75	
    76		idev->name = "tps65218_pwrbutton";
    77		idev->phys = "tps65218_pwrbutton/input0";
    78		idev->dev.parent = dev;
    79		idev->id.bustype = BUS_I2C;
    80	
    81		input_set_capability(idev, EV_KEY, KEY_POWER);
    82	
    83		pwr->tps = tps;
    84		pwr->dev = dev;
    85		pwr->idev = idev;
    86		platform_set_drvdata(pdev, pwr);
    87		device_init_wakeup(dev, true);
    88	
    89		irq = platform_get_irq(pdev, 0);
    90		error = devm_request_threaded_irq(dev, irq, NULL, tps65218_pwr_irq,
    91						  IRQF_TRIGGER_RISING |
    92							IRQF_TRIGGER_FALLING |
    93							IRQF_ONESHOT,
    94						  "tps65218-pwrbutton", pwr);
    95		if (error) {
    96			dev_err(dev, "failed to request IRQ #%d: %d\n",
    97				irq, error);
    98			return error;
    99		}
   100	
   101		error= input_register_device(idev);
   102		if (error) {
   103			dev_err(dev, "Can't register power button: %d\n", error);
   104			return error;
   105		}
   106	
   107		return 0;
   108	}
   109	
   110	static const struct of_device_id of_tps65218_pwr_match[] = {
   111		{ .compatible = "ti,tps65218-pwrbutton" },
   112		{ },
   113	};
   114	MODULE_DEVICE_TABLE(of, of_tps65218_pwr_match);
   115	
   116	static const struct platform_device_id tps65218_pwrbtn_id_table[] = {
   117		{ "tps65218-pwrbutton", },
   118		{ /* sentinel */ }
   119	}
 > 120	MODULE_DEVICE_TABLE(platform, tps65218_pwrbtn_id_table);
   121	
   122	static struct platform_driver tps65218_pwron_driver = {
   123		.probe	= tps65218_pwron_probe,

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
Lee Jones June 28, 2016, 6:49 a.m. UTC | #3
On Tue, 28 Jun 2016, Keerthy wrote:

> platform_device_id table is needed for adding the tps65218-pwrbutton
> module to the mfd_cell array.
> 
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
>  drivers/input/misc/tps65218-pwrbutton.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/input/misc/tps65218-pwrbutton.c b/drivers/input/misc/tps65218-pwrbutton.c
> index 2bba8de..a0cb7d2 100644
> --- a/drivers/input/misc/tps65218-pwrbutton.c
> +++ b/drivers/input/misc/tps65218-pwrbutton.c
> @@ -113,12 +113,19 @@ static const struct of_device_id of_tps65218_pwr_match[] = {
>  };
>  MODULE_DEVICE_TABLE(of, of_tps65218_pwr_match);
>  
> +static const struct platform_device_id tps65218_pwrbtn_id_table[] = {
> +	{ "tps65218-pwrbutton", },
> +	{ /* sentinel */ }
> +}

Missing ';'.  Did you build test this?

> +MODULE_DEVICE_TABLE(platform, tps65218_pwrbtn_id_table);
> +
>  static struct platform_driver tps65218_pwron_driver = {
>  	.probe	= tps65218_pwron_probe,
>  	.driver	= {
>  		.name	= "tps65218_pwrbutton",
>  		.of_match_table = of_tps65218_pwr_match,
>  	},
> +	.id_table = tps65218_pwrbtn_id_table,
>  };
>  module_platform_driver(tps65218_pwron_driver);
>
Keerthy June 28, 2016, 6:55 a.m. UTC | #4
On Tuesday 28 June 2016 12:19 PM, Lee Jones wrote:
> On Tue, 28 Jun 2016, Keerthy wrote:
>
>> platform_device_id table is needed for adding the tps65218-pwrbutton
>> module to the mfd_cell array.
>>
>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>> ---
>>   drivers/input/misc/tps65218-pwrbutton.c | 7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/input/misc/tps65218-pwrbutton.c b/drivers/input/misc/tps65218-pwrbutton.c
>> index 2bba8de..a0cb7d2 100644
>> --- a/drivers/input/misc/tps65218-pwrbutton.c
>> +++ b/drivers/input/misc/tps65218-pwrbutton.c
>> @@ -113,12 +113,19 @@ static const struct of_device_id of_tps65218_pwr_match[] = {
>>   };
>>   MODULE_DEVICE_TABLE(of, of_tps65218_pwr_match);
>>
>> +static const struct platform_device_id tps65218_pwrbtn_id_table[] = {
>> +	{ "tps65218-pwrbutton", },
>> +	{ /* sentinel */ }
>> +}
>
> Missing ';'.  Did you build test this?

Oops sorry for the mess. Yes i built and booted. While reviewing and 
just before sending i have accidentally deleted. I will send a v4 in a 
bit. I will send v4 of this patch.

I just checked now. It somehow compiles silently even with the ';' 
missing! I will send a v4.


>
>> +MODULE_DEVICE_TABLE(platform, tps65218_pwrbtn_id_table);
>> +
>>   static struct platform_driver tps65218_pwron_driver = {
>>   	.probe	= tps65218_pwron_probe,
>>   	.driver	= {
>>   		.name	= "tps65218_pwrbutton",
>>   		.of_match_table = of_tps65218_pwr_match,
>>   	},
>> +	.id_table = tps65218_pwrbtn_id_table,
>>   };
>>   module_platform_driver(tps65218_pwron_driver);
>>
>
--
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
Lee Jones June 28, 2016, 7:41 a.m. UTC | #5
On Tue, 28 Jun 2016, Keerthy wrote:

> 
> 
> On Tuesday 28 June 2016 12:19 PM, Lee Jones wrote:
> >On Tue, 28 Jun 2016, Keerthy wrote:
> >
> >>platform_device_id table is needed for adding the tps65218-pwrbutton
> >>module to the mfd_cell array.
> >>
> >>Signed-off-by: Keerthy <j-keerthy@ti.com>
> >>---
> >>  drivers/input/misc/tps65218-pwrbutton.c | 7 +++++++
> >>  1 file changed, 7 insertions(+)
> >>
> >>diff --git a/drivers/input/misc/tps65218-pwrbutton.c b/drivers/input/misc/tps65218-pwrbutton.c
> >>index 2bba8de..a0cb7d2 100644
> >>--- a/drivers/input/misc/tps65218-pwrbutton.c
> >>+++ b/drivers/input/misc/tps65218-pwrbutton.c
> >>@@ -113,12 +113,19 @@ static const struct of_device_id of_tps65218_pwr_match[] = {
> >>  };
> >>  MODULE_DEVICE_TABLE(of, of_tps65218_pwr_match);
> >>
> >>+static const struct platform_device_id tps65218_pwrbtn_id_table[] = {
> >>+	{ "tps65218-pwrbutton", },
> >>+	{ /* sentinel */ }
> >>+}
> >
> >Missing ';'.  Did you build test this?
> 
> Oops sorry for the mess. Yes i built and booted. While reviewing and just
> before sending i have accidentally deleted. I will send a v4 in a bit. I
> will send v4 of this patch.
> 
> I just checked now. It somehow compiles silently even with the ';' missing!
> I will send a v4.

Are you sure this driver is enable in the CONFIG?

> >>+MODULE_DEVICE_TABLE(platform, tps65218_pwrbtn_id_table);
> >>+
> >>  static struct platform_driver tps65218_pwron_driver = {
> >>  	.probe	= tps65218_pwron_probe,
> >>  	.driver	= {
> >>  		.name	= "tps65218_pwrbutton",
> >>  		.of_match_table = of_tps65218_pwr_match,
> >>  	},
> >>+	.id_table = tps65218_pwrbtn_id_table,
> >>  };
> >>  module_platform_driver(tps65218_pwron_driver);
> >>
> >
Keerthy June 28, 2016, 7:43 a.m. UTC | #6
On Tuesday 28 June 2016 01:11 PM, Lee Jones wrote:
> On Tue, 28 Jun 2016, Keerthy wrote:
>
>>
>>
>> On Tuesday 28 June 2016 12:19 PM, Lee Jones wrote:
>>> On Tue, 28 Jun 2016, Keerthy wrote:
>>>
>>>> platform_device_id table is needed for adding the tps65218-pwrbutton
>>>> module to the mfd_cell array.
>>>>
>>>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>>>> ---
>>>>   drivers/input/misc/tps65218-pwrbutton.c | 7 +++++++
>>>>   1 file changed, 7 insertions(+)
>>>>
>>>> diff --git a/drivers/input/misc/tps65218-pwrbutton.c b/drivers/input/misc/tps65218-pwrbutton.c
>>>> index 2bba8de..a0cb7d2 100644
>>>> --- a/drivers/input/misc/tps65218-pwrbutton.c
>>>> +++ b/drivers/input/misc/tps65218-pwrbutton.c
>>>> @@ -113,12 +113,19 @@ static const struct of_device_id of_tps65218_pwr_match[] = {
>>>>   };
>>>>   MODULE_DEVICE_TABLE(of, of_tps65218_pwr_match);
>>>>
>>>> +static const struct platform_device_id tps65218_pwrbtn_id_table[] = {
>>>> +	{ "tps65218-pwrbutton", },
>>>> +	{ /* sentinel */ }
>>>> +}
>>>
>>> Missing ';'.  Did you build test this?
>>
>> Oops sorry for the mess. Yes i built and booted. While reviewing and just
>> before sending i have accidentally deleted. I will send a v4 in a bit. I
>> will send v4 of this patch.
>>
>> I just checked now. It somehow compiles silently even with the ';' missing!
>> I will send a v4.
>
> Are you sure this driver is enable in the CONFIG?

Yes! I think the MACRO Below covers up for the missing ';' and hence 
went unnoticed :-/

>
>>>> +MODULE_DEVICE_TABLE(platform, tps65218_pwrbtn_id_table);
>>>> +
>>>>   static struct platform_driver tps65218_pwron_driver = {
>>>>   	.probe	= tps65218_pwron_probe,
>>>>   	.driver	= {
>>>>   		.name	= "tps65218_pwrbutton",
>>>>   		.of_match_table = of_tps65218_pwr_match,
>>>>   	},
>>>> +	.id_table = tps65218_pwrbtn_id_table,
>>>>   };
>>>>   module_platform_driver(tps65218_pwron_driver);
>>>>
>>>
>
--
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/input/misc/tps65218-pwrbutton.c b/drivers/input/misc/tps65218-pwrbutton.c
index 2bba8de..a0cb7d2 100644
--- a/drivers/input/misc/tps65218-pwrbutton.c
+++ b/drivers/input/misc/tps65218-pwrbutton.c
@@ -113,12 +113,19 @@  static const struct of_device_id of_tps65218_pwr_match[] = {
 };
 MODULE_DEVICE_TABLE(of, of_tps65218_pwr_match);
 
+static const struct platform_device_id tps65218_pwrbtn_id_table[] = {
+	{ "tps65218-pwrbutton", },
+	{ /* sentinel */ }
+}
+MODULE_DEVICE_TABLE(platform, tps65218_pwrbtn_id_table);
+
 static struct platform_driver tps65218_pwron_driver = {
 	.probe	= tps65218_pwron_probe,
 	.driver	= {
 		.name	= "tps65218_pwrbutton",
 		.of_match_table = of_tps65218_pwr_match,
 	},
+	.id_table = tps65218_pwrbtn_id_table,
 };
 module_platform_driver(tps65218_pwron_driver);