linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lis3lv02d: switch to using input device polling mode
@ 2019-10-02 21:56 Dmitry Torokhov
  2019-10-02 23:02 ` kbuild test robot
  2019-10-02 23:30 ` kbuild test robot
  0 siblings, 2 replies; 6+ messages in thread
From: Dmitry Torokhov @ 2019-10-02 21:56 UTC (permalink / raw)
  To: Eric Piel; +Cc: Arnd Bergmann, Greg Kroah-Hartman, linux-kernel

Now that instances of input_dev support polling mode natively,
we no longer need to create input_polled_dev instance.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/misc/Kconfig               |  1 -
 drivers/misc/lis3lv02d/lis3lv02d.c | 80 ++++++++++++++++--------------
 drivers/misc/lis3lv02d/lis3lv02d.h |  4 +-
 3 files changed, 46 insertions(+), 39 deletions(-)

diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 16900357afc2..02c53b20c632 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -8,7 +8,6 @@ menu "Misc devices"
 config SENSORS_LIS3LV02D
 	tristate
 	depends on INPUT
-	select INPUT_POLLDEV
 
 config AD525X_DPOT
 	tristate "Analog Devices Digital Potentiometers"
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c
index 057d7bbde402..dd65cedf3b12 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d.c
@@ -16,7 +16,7 @@
 #include <linux/types.h>
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
-#include <linux/input-polldev.h>
+#include <linux/input.h>
 #include <linux/delay.h>
 #include <linux/wait.h>
 #include <linux/poll.h>
@@ -434,23 +434,23 @@ int lis3lv02d_poweron(struct lis3lv02d *lis3)
 EXPORT_SYMBOL_GPL(lis3lv02d_poweron);
 
 
-static void lis3lv02d_joystick_poll(struct input_polled_dev *pidev)
+static void lis3lv02d_joystick_poll(struct input_dev *input)
 {
-	struct lis3lv02d *lis3 = pidev->private;
+	struct lis3lv02d *lis3 = input_get_drvdata(input);
 	int x, y, z;
 
 	mutex_lock(&lis3->mutex);
 	lis3lv02d_get_xyz(lis3, &x, &y, &z);
-	input_report_abs(pidev->input, ABS_X, x);
-	input_report_abs(pidev->input, ABS_Y, y);
-	input_report_abs(pidev->input, ABS_Z, z);
-	input_sync(pidev->input);
+	input_report_abs(input, ABS_X, x);
+	input_report_abs(input, ABS_Y, y);
+	input_report_abs(input, ABS_Z, z);
+	input_sync(input);
 	mutex_unlock(&lis3->mutex);
 }
 
-static void lis3lv02d_joystick_open(struct input_polled_dev *pidev)
+static int lis3lv02d_joystick_open(struct input_dev *input)
 {
-	struct lis3lv02d *lis3 = pidev->private;
+	struct lis3lv02d *lis3 = input_get_drvdata(input);
 
 	if (lis3->pm_dev)
 		pm_runtime_get_sync(lis3->pm_dev);
@@ -461,12 +461,14 @@ static void lis3lv02d_joystick_open(struct input_polled_dev *pidev)
 	 * Update coordinates for the case where poll interval is 0 and
 	 * the chip in running purely under interrupt control
 	 */
-	lis3lv02d_joystick_poll(pidev);
+	lis3lv02d_joystick_poll(input);
+
+	return 0;
 }
 
-static void lis3lv02d_joystick_close(struct input_polled_dev *pidev)
+static void lis3lv02d_joystick_close(struct input_dev *input)
 {
-	struct lis3lv02d *lis3 = pidev->private;
+	struct lis3lv02d *lis3 = input_get_drvdata(input);
 
 	atomic_set(&lis3->wake_thread, 0);
 	if (lis3->pm_dev)
@@ -497,7 +499,7 @@ static irqreturn_t lis302dl_interrupt(int irq, void *data)
 
 static void lis302dl_interrupt_handle_click(struct lis3lv02d *lis3)
 {
-	struct input_dev *dev = lis3->idev->input;
+	struct input_dev *dev = lis3->idev;
 	u8 click_src;
 
 	mutex_lock(&lis3->mutex);
@@ -677,26 +679,19 @@ int lis3lv02d_joystick_enable(struct lis3lv02d *lis3)
 	if (lis3->idev)
 		return -EINVAL;
 
-	lis3->idev = input_allocate_polled_device();
-	if (!lis3->idev)
+	input_dev = input_allocate_device();
+	if (!input_dev)
 		return -ENOMEM;
 
-	lis3->idev->poll = lis3lv02d_joystick_poll;
-	lis3->idev->open = lis3lv02d_joystick_open;
-	lis3->idev->close = lis3lv02d_joystick_close;
-	lis3->idev->poll_interval = MDPS_POLL_INTERVAL;
-	lis3->idev->poll_interval_min = MDPS_POLL_MIN;
-	lis3->idev->poll_interval_max = MDPS_POLL_MAX;
-	lis3->idev->private = lis3;
-	input_dev = lis3->idev->input;
-
 	input_dev->name       = "ST LIS3LV02DL Accelerometer";
 	input_dev->phys       = DRIVER_NAME "/input0";
 	input_dev->id.bustype = BUS_HOST;
 	input_dev->id.vendor  = 0;
 	input_dev->dev.parent = &lis3->pdev->dev;
 
-	set_bit(EV_ABS, input_dev->evbit);
+	input_dev->open = lis3lv02d_joystick_open;
+	input_dev->close = lis3lv02d_joystick_close;
+
 	max_val = (lis3->mdps_max_val * lis3->scale) / LIS3_ACCURACY;
 	if (lis3->whoami == WAI_12B) {
 		fuzz = LIS3_DEFAULT_FUZZ_12B;
@@ -712,17 +707,32 @@ int lis3lv02d_joystick_enable(struct lis3lv02d *lis3)
 	input_set_abs_params(input_dev, ABS_Y, -max_val, max_val, fuzz, flat);
 	input_set_abs_params(input_dev, ABS_Z, -max_val, max_val, fuzz, flat);
 
+	input_set_drvdata(input_dev, lis3);
+	lis3->idev = input_dev;
+
+	err = input_setup_polling(input_dev, lis3lv02d_joystick_poll);
+	if (err)
+		goto err_free_input;
+
+	input_set_poll_interval(input_dev, MDPS_POLL_INTERVAL);
+	input_set_min_poll_interval(input_dev, MDPS_POLL_MIN);
+	input_set_max_poll_interval(input_dev, MDPS_POLL_MAX);
+
 	lis3->mapped_btns[0] = lis3lv02d_get_axis(abs(lis3->ac.x), btns);
 	lis3->mapped_btns[1] = lis3lv02d_get_axis(abs(lis3->ac.y), btns);
 	lis3->mapped_btns[2] = lis3lv02d_get_axis(abs(lis3->ac.z), btns);
 
-	err = input_register_polled_device(lis3->idev);
-	if (err) {
-		input_free_polled_device(lis3->idev);
-		lis3->idev = NULL;
-	}
+	err = input_register_device(lis3->idev);
+	if (err)
+		goto err_free_input;
 
+	return 0;
+
+err_free_input:
+	input_free_device(input_dev);
+	lis3->idev = NULL;
 	return err;
+
 }
 EXPORT_SYMBOL_GPL(lis3lv02d_joystick_enable);
 
@@ -738,8 +748,7 @@ void lis3lv02d_joystick_disable(struct lis3lv02d *lis3)
 
 	if (lis3->irq)
 		misc_deregister(&lis3->miscdev);
-	input_unregister_polled_device(lis3->idev);
-	input_free_polled_device(lis3->idev);
+	input_unregister_device(lis3->idev);
 	lis3->idev = NULL;
 }
 EXPORT_SYMBOL_GPL(lis3lv02d_joystick_disable);
@@ -895,10 +904,9 @@ static void lis3lv02d_8b_configure(struct lis3lv02d *lis3,
 			(p->click_thresh_y << 4));
 
 		if (lis3->idev) {
-			struct input_dev *input_dev = lis3->idev->input;
-			input_set_capability(input_dev, EV_KEY, BTN_X);
-			input_set_capability(input_dev, EV_KEY, BTN_Y);
-			input_set_capability(input_dev, EV_KEY, BTN_Z);
+			input_set_capability(lis3->idev, EV_KEY, BTN_X);
+			input_set_capability(lis3->idev, EV_KEY, BTN_Y);
+			input_set_capability(lis3->idev, EV_KEY, BTN_Z);
 		}
 	}
 
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.h b/drivers/misc/lis3lv02d/lis3lv02d.h
index 1b0c99883c57..c394c0b08519 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d.h
+++ b/drivers/misc/lis3lv02d/lis3lv02d.h
@@ -6,7 +6,7 @@
  *  Copyright (C) 2008-2009 Eric Piel
  */
 #include <linux/platform_device.h>
-#include <linux/input-polldev.h>
+#include <linux/input.h>
 #include <linux/regulator/consumer.h>
 #include <linux/miscdevice.h>
 
@@ -281,7 +281,7 @@ struct lis3lv02d {
 					* (1/1000th of earth gravity)
 					*/
 
-	struct input_polled_dev	*idev;     /* input device */
+	struct input_dev	*idev;     /* input device */
 	struct platform_device	*pdev;     /* platform device */
 	struct regulator_bulk_data regulators[2];
 	atomic_t		count;     /* interrupt count after last read */
-- 
2.23.0.444.g18eeb5a265-goog


-- 
Dmitry

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] lis3lv02d: switch to using input device polling mode
  2019-10-02 21:56 [PATCH] lis3lv02d: switch to using input device polling mode Dmitry Torokhov
@ 2019-10-02 23:02 ` kbuild test robot
  2019-10-02 23:30 ` kbuild test robot
  1 sibling, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2019-10-02 23:02 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: kbuild-all, Eric Piel, Arnd Bergmann, Greg Kroah-Hartman, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 4795 bytes --]

Hi Dmitry,

I love your patch! Yet something to improve:

[auto build test ERROR on char-misc/char-misc-testing]
[cannot apply to v5.4-rc1 next-20191002]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Dmitry-Torokhov/lis3lv02d-switch-to-using-input-device-polling-mode/20191003-062746
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=xtensa 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/misc/lis3lv02d/lis3lv02d.c: In function 'lis3lv02d_joystick_enable':
>> drivers/misc/lis3lv02d/lis3lv02d.c:713:8: error: implicit declaration of function 'input_setup_polling'; did you mean 'input_set_capability'? [-Werror=implicit-function-declaration]
     err = input_setup_polling(input_dev, lis3lv02d_joystick_poll);
           ^~~~~~~~~~~~~~~~~~~
           input_set_capability
>> drivers/misc/lis3lv02d/lis3lv02d.c:717:2: error: implicit declaration of function 'input_set_poll_interval'; did you mean 'input_set_abs_params'? [-Werror=implicit-function-declaration]
     input_set_poll_interval(input_dev, MDPS_POLL_INTERVAL);
     ^~~~~~~~~~~~~~~~~~~~~~~
     input_set_abs_params
>> drivers/misc/lis3lv02d/lis3lv02d.c:718:2: error: implicit declaration of function 'input_set_min_poll_interval' [-Werror=implicit-function-declaration]
     input_set_min_poll_interval(input_dev, MDPS_POLL_MIN);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/misc/lis3lv02d/lis3lv02d.c:719:2: error: implicit declaration of function 'input_set_max_poll_interval'; did you mean 'input_set_capability'? [-Werror=implicit-function-declaration]
     input_set_max_poll_interval(input_dev, MDPS_POLL_MAX);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
     input_set_capability
   cc1: some warnings being treated as errors

vim +713 drivers/misc/lis3lv02d/lis3lv02d.c

   671	
   672	int lis3lv02d_joystick_enable(struct lis3lv02d *lis3)
   673	{
   674		struct input_dev *input_dev;
   675		int err;
   676		int max_val, fuzz, flat;
   677		int btns[] = {BTN_X, BTN_Y, BTN_Z};
   678	
   679		if (lis3->idev)
   680			return -EINVAL;
   681	
   682		input_dev = input_allocate_device();
   683		if (!input_dev)
   684			return -ENOMEM;
   685	
   686		input_dev->name       = "ST LIS3LV02DL Accelerometer";
   687		input_dev->phys       = DRIVER_NAME "/input0";
   688		input_dev->id.bustype = BUS_HOST;
   689		input_dev->id.vendor  = 0;
   690		input_dev->dev.parent = &lis3->pdev->dev;
   691	
   692		input_dev->open = lis3lv02d_joystick_open;
   693		input_dev->close = lis3lv02d_joystick_close;
   694	
   695		max_val = (lis3->mdps_max_val * lis3->scale) / LIS3_ACCURACY;
   696		if (lis3->whoami == WAI_12B) {
   697			fuzz = LIS3_DEFAULT_FUZZ_12B;
   698			flat = LIS3_DEFAULT_FLAT_12B;
   699		} else {
   700			fuzz = LIS3_DEFAULT_FUZZ_8B;
   701			flat = LIS3_DEFAULT_FLAT_8B;
   702		}
   703		fuzz = (fuzz * lis3->scale) / LIS3_ACCURACY;
   704		flat = (flat * lis3->scale) / LIS3_ACCURACY;
   705	
   706		input_set_abs_params(input_dev, ABS_X, -max_val, max_val, fuzz, flat);
   707		input_set_abs_params(input_dev, ABS_Y, -max_val, max_val, fuzz, flat);
   708		input_set_abs_params(input_dev, ABS_Z, -max_val, max_val, fuzz, flat);
   709	
   710		input_set_drvdata(input_dev, lis3);
   711		lis3->idev = input_dev;
   712	
 > 713		err = input_setup_polling(input_dev, lis3lv02d_joystick_poll);
   714		if (err)
   715			goto err_free_input;
   716	
 > 717		input_set_poll_interval(input_dev, MDPS_POLL_INTERVAL);
 > 718		input_set_min_poll_interval(input_dev, MDPS_POLL_MIN);
 > 719		input_set_max_poll_interval(input_dev, MDPS_POLL_MAX);
   720	
   721		lis3->mapped_btns[0] = lis3lv02d_get_axis(abs(lis3->ac.x), btns);
   722		lis3->mapped_btns[1] = lis3lv02d_get_axis(abs(lis3->ac.y), btns);
   723		lis3->mapped_btns[2] = lis3lv02d_get_axis(abs(lis3->ac.z), btns);
   724	
   725		err = input_register_device(lis3->idev);
   726		if (err)
   727			goto err_free_input;
   728	
   729		return 0;
   730	
   731	err_free_input:
   732		input_free_device(input_dev);
   733		lis3->idev = NULL;
   734		return err;
   735	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 59292 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] lis3lv02d: switch to using input device polling mode
  2019-10-02 21:56 [PATCH] lis3lv02d: switch to using input device polling mode Dmitry Torokhov
  2019-10-02 23:02 ` kbuild test robot
@ 2019-10-02 23:30 ` kbuild test robot
  2019-10-02 23:59   ` Dmitry Torokhov
  1 sibling, 1 reply; 6+ messages in thread
From: kbuild test robot @ 2019-10-02 23:30 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: kbuild-all, Eric Piel, Arnd Bergmann, Greg Kroah-Hartman, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 4791 bytes --]

Hi Dmitry,

I love your patch! Yet something to improve:

[auto build test ERROR on char-misc/char-misc-testing]
[cannot apply to v5.4-rc1 next-20191002]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Dmitry-Torokhov/lis3lv02d-switch-to-using-input-device-polling-mode/20191003-062746
config: parisc-allyesconfig (attached as .config)
compiler: hppa-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=parisc 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/misc/lis3lv02d/lis3lv02d.c: In function 'lis3lv02d_joystick_enable':
   drivers/misc/lis3lv02d/lis3lv02d.c:713:8: error: implicit declaration of function 'input_setup_polling'; did you mean 'input_set_capability'? [-Werror=implicit-function-declaration]
     err = input_setup_polling(input_dev, lis3lv02d_joystick_poll);
           ^~~~~~~~~~~~~~~~~~~
           input_set_capability
>> drivers/misc/lis3lv02d/lis3lv02d.c:717:2: error: implicit declaration of function 'input_set_poll_interval'; did you mean '__put_user_internal'? [-Werror=implicit-function-declaration]
     input_set_poll_interval(input_dev, MDPS_POLL_INTERVAL);
     ^~~~~~~~~~~~~~~~~~~~~~~
     __put_user_internal
   drivers/misc/lis3lv02d/lis3lv02d.c:718:2: error: implicit declaration of function 'input_set_min_poll_interval' [-Werror=implicit-function-declaration]
     input_set_min_poll_interval(input_dev, MDPS_POLL_MIN);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/lis3lv02d/lis3lv02d.c:719:2: error: implicit declaration of function 'input_set_max_poll_interval'; did you mean 'input_set_capability'? [-Werror=implicit-function-declaration]
     input_set_max_poll_interval(input_dev, MDPS_POLL_MAX);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
     input_set_capability
   cc1: some warnings being treated as errors

vim +717 drivers/misc/lis3lv02d/lis3lv02d.c

   671	
   672	int lis3lv02d_joystick_enable(struct lis3lv02d *lis3)
   673	{
   674		struct input_dev *input_dev;
   675		int err;
   676		int max_val, fuzz, flat;
   677		int btns[] = {BTN_X, BTN_Y, BTN_Z};
   678	
   679		if (lis3->idev)
   680			return -EINVAL;
   681	
   682		input_dev = input_allocate_device();
   683		if (!input_dev)
   684			return -ENOMEM;
   685	
   686		input_dev->name       = "ST LIS3LV02DL Accelerometer";
   687		input_dev->phys       = DRIVER_NAME "/input0";
   688		input_dev->id.bustype = BUS_HOST;
   689		input_dev->id.vendor  = 0;
   690		input_dev->dev.parent = &lis3->pdev->dev;
   691	
   692		input_dev->open = lis3lv02d_joystick_open;
   693		input_dev->close = lis3lv02d_joystick_close;
   694	
   695		max_val = (lis3->mdps_max_val * lis3->scale) / LIS3_ACCURACY;
   696		if (lis3->whoami == WAI_12B) {
   697			fuzz = LIS3_DEFAULT_FUZZ_12B;
   698			flat = LIS3_DEFAULT_FLAT_12B;
   699		} else {
   700			fuzz = LIS3_DEFAULT_FUZZ_8B;
   701			flat = LIS3_DEFAULT_FLAT_8B;
   702		}
   703		fuzz = (fuzz * lis3->scale) / LIS3_ACCURACY;
   704		flat = (flat * lis3->scale) / LIS3_ACCURACY;
   705	
   706		input_set_abs_params(input_dev, ABS_X, -max_val, max_val, fuzz, flat);
   707		input_set_abs_params(input_dev, ABS_Y, -max_val, max_val, fuzz, flat);
   708		input_set_abs_params(input_dev, ABS_Z, -max_val, max_val, fuzz, flat);
   709	
   710		input_set_drvdata(input_dev, lis3);
   711		lis3->idev = input_dev;
   712	
 > 713		err = input_setup_polling(input_dev, lis3lv02d_joystick_poll);
   714		if (err)
   715			goto err_free_input;
   716	
 > 717		input_set_poll_interval(input_dev, MDPS_POLL_INTERVAL);
   718		input_set_min_poll_interval(input_dev, MDPS_POLL_MIN);
   719		input_set_max_poll_interval(input_dev, MDPS_POLL_MAX);
   720	
   721		lis3->mapped_btns[0] = lis3lv02d_get_axis(abs(lis3->ac.x), btns);
   722		lis3->mapped_btns[1] = lis3lv02d_get_axis(abs(lis3->ac.y), btns);
   723		lis3->mapped_btns[2] = lis3lv02d_get_axis(abs(lis3->ac.z), btns);
   724	
   725		err = input_register_device(lis3->idev);
   726		if (err)
   727			goto err_free_input;
   728	
   729		return 0;
   730	
   731	err_free_input:
   732		input_free_device(input_dev);
   733		lis3->idev = NULL;
   734		return err;
   735	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 58382 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] lis3lv02d: switch to using input device polling mode
  2019-10-02 23:30 ` kbuild test robot
@ 2019-10-02 23:59   ` Dmitry Torokhov
  2019-10-03  0:03     ` Dmitry Torokhov
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Torokhov @ 2019-10-02 23:59 UTC (permalink / raw)
  To: kbuild test robot
  Cc: kbuild-all, Eric Piel, Arnd Bergmann, Greg Kroah-Hartman, linux-kernel

On Thu, Oct 03, 2019 at 07:30:23AM +0800, kbuild test robot wrote:
> Hi Dmitry,
> 
> I love your patch! Yet something to improve:
> 
> [auto build test ERROR on char-misc/char-misc-testing]
> [cannot apply to v5.4-rc1 next-20191002]

This is weird, I just tried applying it to both next-20191002 and Greg's
char-misc/char-misc-testing and it applied cleanly and compiled (on x86).

> [if your patch is applied to the wrong git tree, please drop us a note to help
> improve the system. BTW, we also suggest to use '--base' option to specify the
> base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
> 
> url:    https://github.com/0day-ci/linux/commits/Dmitry-Torokhov/lis3lv02d-switch-to-using-input-device-polling-mode/20191003-062746
> config: parisc-allyesconfig (attached as .config)
> compiler: hppa-linux-gcc (GCC) 7.4.0
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         GCC_VERSION=7.4.0 make.cross ARCH=parisc 
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>    drivers/misc/lis3lv02d/lis3lv02d.c: In function 'lis3lv02d_joystick_enable':
>    drivers/misc/lis3lv02d/lis3lv02d.c:713:8: error: implicit declaration of function 'input_setup_polling'; did you mean 'input_set_capability'? [-Werror=implicit-function-declaration]
>      err = input_setup_polling(input_dev, lis3lv02d_joystick_poll);
>            ^~~~~~~~~~~~~~~~~~~
>            input_set_capability
> >> drivers/misc/lis3lv02d/lis3lv02d.c:717:2: error: implicit declaration of function 'input_set_poll_interval'; did you mean '__put_user_internal'? [-Werror=implicit-function-declaration]
>      input_set_poll_interval(input_dev, MDPS_POLL_INTERVAL);
>      ^~~~~~~~~~~~~~~~~~~~~~~
>      __put_user_internal
>    drivers/misc/lis3lv02d/lis3lv02d.c:718:2: error: implicit declaration of function 'input_set_min_poll_interval' [-Werror=implicit-function-declaration]
>      input_set_min_poll_interval(input_dev, MDPS_POLL_MIN);
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/misc/lis3lv02d/lis3lv02d.c:719:2: error: implicit declaration of function 'input_set_max_poll_interval'; did you mean 'input_set_capability'? [-Werror=implicit-function-declaration]
>      input_set_max_poll_interval(input_dev, MDPS_POLL_MAX);
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>      input_set_capability
>    cc1: some warnings being treated as errors
> 
> vim +717 drivers/misc/lis3lv02d/lis3lv02d.c
> 
>    671	
>    672	int lis3lv02d_joystick_enable(struct lis3lv02d *lis3)
>    673	{
>    674		struct input_dev *input_dev;
>    675		int err;
>    676		int max_val, fuzz, flat;
>    677		int btns[] = {BTN_X, BTN_Y, BTN_Z};
>    678	
>    679		if (lis3->idev)
>    680			return -EINVAL;
>    681	
>    682		input_dev = input_allocate_device();
>    683		if (!input_dev)
>    684			return -ENOMEM;
>    685	
>    686		input_dev->name       = "ST LIS3LV02DL Accelerometer";
>    687		input_dev->phys       = DRIVER_NAME "/input0";
>    688		input_dev->id.bustype = BUS_HOST;
>    689		input_dev->id.vendor  = 0;
>    690		input_dev->dev.parent = &lis3->pdev->dev;
>    691	
>    692		input_dev->open = lis3lv02d_joystick_open;
>    693		input_dev->close = lis3lv02d_joystick_close;
>    694	
>    695		max_val = (lis3->mdps_max_val * lis3->scale) / LIS3_ACCURACY;
>    696		if (lis3->whoami == WAI_12B) {
>    697			fuzz = LIS3_DEFAULT_FUZZ_12B;
>    698			flat = LIS3_DEFAULT_FLAT_12B;
>    699		} else {
>    700			fuzz = LIS3_DEFAULT_FUZZ_8B;
>    701			flat = LIS3_DEFAULT_FLAT_8B;
>    702		}
>    703		fuzz = (fuzz * lis3->scale) / LIS3_ACCURACY;
>    704		flat = (flat * lis3->scale) / LIS3_ACCURACY;
>    705	
>    706		input_set_abs_params(input_dev, ABS_X, -max_val, max_val, fuzz, flat);
>    707		input_set_abs_params(input_dev, ABS_Y, -max_val, max_val, fuzz, flat);
>    708		input_set_abs_params(input_dev, ABS_Z, -max_val, max_val, fuzz, flat);
>    709	
>    710		input_set_drvdata(input_dev, lis3);
>    711		lis3->idev = input_dev;
>    712	
>  > 713		err = input_setup_polling(input_dev, lis3lv02d_joystick_poll);
>    714		if (err)
>    715			goto err_free_input;
>    716	
>  > 717		input_set_poll_interval(input_dev, MDPS_POLL_INTERVAL);
>    718		input_set_min_poll_interval(input_dev, MDPS_POLL_MIN);
>    719		input_set_max_poll_interval(input_dev, MDPS_POLL_MAX);
>    720	
>    721		lis3->mapped_btns[0] = lis3lv02d_get_axis(abs(lis3->ac.x), btns);
>    722		lis3->mapped_btns[1] = lis3lv02d_get_axis(abs(lis3->ac.y), btns);
>    723		lis3->mapped_btns[2] = lis3lv02d_get_axis(abs(lis3->ac.z), btns);
>    724	
>    725		err = input_register_device(lis3->idev);
>    726		if (err)
>    727			goto err_free_input;
>    728	
>    729		return 0;
>    730	
>    731	err_free_input:
>    732		input_free_device(input_dev);
>    733		lis3->idev = NULL;
>    734		return err;
>    735	
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] lis3lv02d: switch to using input device polling mode
  2019-10-02 23:59   ` Dmitry Torokhov
@ 2019-10-03  0:03     ` Dmitry Torokhov
  2019-10-09  5:32       ` [kbuild-all] " Rong Chen
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Torokhov @ 2019-10-03  0:03 UTC (permalink / raw)
  To: kbuild test robot
  Cc: kbuild-all, Eric Piel, Arnd Bergmann, Greg Kroah-Hartman, linux-kernel

On Wed, Oct 02, 2019 at 04:59:43PM -0700, Dmitry Torokhov wrote:
> On Thu, Oct 03, 2019 at 07:30:23AM +0800, kbuild test robot wrote:
> > Hi Dmitry,
> > 
> > I love your patch! Yet something to improve:
> > 
> > [auto build test ERROR on char-misc/char-misc-testing]
> > [cannot apply to v5.4-rc1 next-20191002]
> 
> This is weird, I just tried applying it to both next-20191002 and Greg's
> char-misc/char-misc-testing and it applied cleanly and compiled (on x86).

You seem to have tried applying it to this commit:

Merge tag 'char-misc-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc driver updates from Greg KH:
 "Here is the big char/misc driver pull request for 5.4-rc1...

so of it failed because at that time Linus' tree did not have the
necessary input changes. I am not sure why you decided to apply the
patch to this particular commit.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [kbuild-all] Re: [PATCH] lis3lv02d: switch to using input device polling mode
  2019-10-03  0:03     ` Dmitry Torokhov
@ 2019-10-09  5:32       ` Rong Chen
  0 siblings, 0 replies; 6+ messages in thread
From: Rong Chen @ 2019-10-09  5:32 UTC (permalink / raw)
  To: Dmitry Torokhov, kbuild test robot
  Cc: kbuild-all, Eric Piel, Arnd Bergmann, Greg Kroah-Hartman, linux-kernel

Hi,

On 10/3/19 8:03 AM, Dmitry Torokhov wrote:
> On Wed, Oct 02, 2019 at 04:59:43PM -0700, Dmitry Torokhov wrote:
>> On Thu, Oct 03, 2019 at 07:30:23AM +0800, kbuild test robot wrote:
>>> Hi Dmitry,
>>>
>>> I love your patch! Yet something to improve:
>>>
>>> [auto build test ERROR on char-misc/char-misc-testing]
>>> [cannot apply to v5.4-rc1 next-20191002]
>> This is weird, I just tried applying it to both next-20191002 and Greg's
>> char-misc/char-misc-testing and it applied cleanly and compiled (on x86).
> You seem to have tried applying it to this commit:
>
> Merge tag 'char-misc-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
>
> Pull char/misc driver updates from Greg KH:
>   "Here is the big char/misc driver pull request for 5.4-rc1...
>
> so of it failed because at that time Linus' tree did not have the
> necessary input changes. I am not sure why you decided to apply the
> patch to this particular commit.
>
> Thanks.

Thanks for your comment, robot applied the patch to the head of 
char-misc/char-misc-testing,
It seems the branch was still old at that moment. We'll fix it asap.

Best Regards,
Rong Chen

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-09  5:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-02 21:56 [PATCH] lis3lv02d: switch to using input device polling mode Dmitry Torokhov
2019-10-02 23:02 ` kbuild test robot
2019-10-02 23:30 ` kbuild test robot
2019-10-02 23:59   ` Dmitry Torokhov
2019-10-03  0:03     ` Dmitry Torokhov
2019-10-09  5:32       ` [kbuild-all] " Rong Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).