Re: [PATCH v3] ARM: dts: motorola-mapphone-common: Add dts configureation for the android buttons beneath the screen

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Carl,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on input/next]
[also build test WARNING on omap/for-next balbi-usb/testing/next v5.10-rc2 next-20201103]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Carl-Philipp-Klemm/ARM-dts-motorola-mapphone-common-Add-dts-configureation-for-the-android-buttons-beneath-the-screen/20201030-170644
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
config: riscv-randconfig-r013-20201030 (attached as .config)
compiler: riscv32-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/7a00d245fade30bef33d962c11b7bc121c007910
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Carl-Philipp-Klemm/ARM-dts-motorola-mapphone-common-Add-dts-configureation-for-the-android-buttons-beneath-the-screen/20201030-170644
        git checkout 7a00d245fade30bef33d962c11b7bc121c007910
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   drivers/input/misc/touchscreen-buttons.c: In function 'touchscreen_buttons_input_event':
   drivers/input/misc/touchscreen-buttons.c:187:34: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     187 |      && buttons->queue.lastindex >= 0) {
         |                                  ^~
   drivers/input/misc/touchscreen-buttons.c: At top level:
>> drivers/input/misc/touchscreen-buttons.c:240:6: warning: no previous prototype for 'merge_task_handler' [-Wmissing-prototypes]
     240 | void merge_task_handler(struct work_struct *work)
         |      ^~~~~~~~~~~~~~~~~~
>> drivers/input/misc/touchscreen-buttons.c:252:6: warning: no previous prototype for 'close_task_handler' [-Wmissing-prototypes]
     252 | void close_task_handler(struct work_struct *work)
         |      ^~~~~~~~~~~~~~~~~~
>> drivers/input/misc/touchscreen-buttons.c:263:6: warning: no previous prototype for 'open_task_handler' [-Wmissing-prototypes]
     263 | void open_task_handler(struct work_struct *work)
         |      ^~~~~~~~~~~~~~~~~
>> drivers/input/misc/touchscreen-buttons.c:411:5: warning: no previous prototype for 'touchscreen_buttons_idev_opened' [-Wmissing-prototypes]
     411 | int touchscreen_buttons_idev_opened(struct input_dev *idev)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/input/misc/touchscreen-buttons.c:434:6: warning: no previous prototype for 'touchscreen_buttons_idev_closed' [-Wmissing-prototypes]
     434 | void touchscreen_buttons_idev_closed(struct input_dev *idev)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/merge_task_handler +240 drivers/input/misc/touchscreen-buttons.c

   239	
 > 240	void merge_task_handler(struct work_struct *work)
   241	{
   242		struct touchscreen_buttons *buttons =
   243		    container_of(work, struct touchscreen_buttons, merge_task);
   244	
   245		mutex_lock(&buttons->mutex);
   246		if (buttons->ts_handle && buttons->ts_handle->dev)
   247			touchscreen_buttons_merge_capabilitys(buttons->filtered_ts_idev,
   248							      buttons->ts_handle->dev);
   249		mutex_unlock(&buttons->mutex);
   250	}
   251	
 > 252	void close_task_handler(struct work_struct *work)
   253	{
   254		struct touchscreen_buttons *buttons =
   255		    container_of(work, struct touchscreen_buttons, close_task);
   256	
   257		mutex_lock(&buttons->mutex);
   258		if (buttons && buttons->ts_handle && buttons->ts_handle->open != 0)
   259			input_close_device(buttons->ts_handle);
   260		mutex_unlock(&buttons->mutex);
   261	}
   262	
 > 263	void open_task_handler(struct work_struct *work)
   264	{
   265		struct touchscreen_buttons *buttons =
   266		    container_of(work, struct touchscreen_buttons, open_task);
   267		int error;
   268	
   269		mutex_lock(&buttons->mutex);
   270		if (buttons && buttons->ts_handle) {
   271			error = input_open_device(buttons->ts_handle);
   272			if (error) {
   273				dev_err(buttons->dev,
   274					"Failed to open input device, error %d\n",
   275					error);
   276				input_unregister_handle(buttons->ts_handle);
   277				kfree(buttons->ts_handle);
   278				buttons->ts_handle = NULL;
   279			}
   280		}
   281		mutex_unlock(&buttons->mutex);
   282	}
   283	
   284	static int touchscreen_buttons_input_connect(struct input_handler *handler,
   285						     struct input_dev *dev,
   286						     const struct input_device_id *id)
   287	{
   288		struct touchscreen_buttons *buttons;
   289	
   290		buttons = handler->private;
   291	
   292		mutex_lock(&buttons->mutex);
   293	
   294		if ((!buttons->ts_handle
   295		     && device_match_of_node(&dev->dev, buttons->map->ts_node))
   296		    || (dev->dev.parent
   297			&& device_match_of_node(dev->dev.parent,
   298						buttons->map->ts_node))) {
   299			int error;
   300	
   301			dev_info(buttons->dev, "Binding to device: %s\n",
   302				 dev_name(&dev->dev));
   303	
   304			buttons->ts_handle =
   305			    kzalloc(sizeof(*buttons->ts_handle), GFP_KERNEL);
   306			if (!buttons->ts_handle) {
   307				mutex_unlock(&buttons->mutex);
   308				return -ENOMEM;
   309			}
   310	
   311			buttons->ts_handle->dev = dev;
   312			buttons->ts_handle->handler = handler;
   313			buttons->ts_handle->name = "touchscreen-buttons";
   314			buttons->ts_handle->private = handler->private;
   315			buttons->queue.lastindex = 0;
   316	
   317			error = input_register_handle(buttons->ts_handle);
   318			if (error) {
   319				dev_err(buttons->dev,
   320					"Failed to register input handler, error %d\n",
   321					error);
   322				kfree(buttons->ts_handle);
   323				buttons->ts_handle = NULL;
   324				mutex_unlock(&buttons->mutex);
   325				return error;
   326			}
   327	
   328			queue_work(buttons->workqueue, &buttons->merge_task);
   329	
   330			if (buttons->filtered_ts_idev->users > 0
   331			    && buttons->ts_handle->open == 0)
   332				queue_work(buttons->workqueue, &buttons->open_task);
   333		}
   334	
   335		mutex_unlock(&buttons->mutex);
   336		return 0;
   337	}
   338	
   339	static void touchscreen_buttons_input_disconnect(struct input_handle *handle)
   340	{
   341		struct touchscreen_buttons *buttons;
   342	
   343		buttons = handle->private;
   344	
   345		mutex_lock(&buttons->mutex);
   346		if (handle == buttons->ts_handle) {
   347			input_close_device(handle);
   348			input_unregister_handle(handle);
   349			kfree(handle);
   350			buttons->ts_handle = NULL;
   351			dev_info(buttons->dev,
   352				 "Touchscreen device disconnected buttons disabled\n");
   353		} else {
   354			dev_err(buttons->dev,
   355				"Unknown device disconnected, %p should be %p", handle,
   356				buttons->ts_handle);
   357		}
   358		mutex_unlock(&buttons->mutex);
   359	}
   360	
   361	static struct touchscreen_button_map
   362	*touchscreen_buttons_get_devtree_pdata(struct device *dev)
   363	{
   364		struct touchscreen_button_map *map;
   365		struct fwnode_handle *child_node;
   366		struct device_node *node;
   367		int i;
   368	
   369		map = kzalloc(sizeof(*map), GFP_KERNEL);
   370		if (!map)
   371			return ERR_PTR(-ENOMEM);
   372	
   373		map->count = device_get_child_node_count(dev);
   374		if (map->count == 0)
   375			return ERR_PTR(-ENODEV);
   376	
   377		map->buttons = kcalloc(map->count, sizeof(*map->buttons), GFP_KERNEL);
   378		if (!map->buttons)
   379			return ERR_PTR(-ENOMEM);
   380	
   381		node = dev->of_node;
   382		map->ts_node = of_parse_phandle(node, "touchscreen_phandle", 0);
   383		if (!map->ts_node) {
   384			dev_err(dev, "touchscreen_phandle node missing\n");
   385			return ERR_PTR(-ENODEV);
   386		}
   387	
   388		dev_info(dev, "Device_node name: %s\n", map->ts_node->name);
   389	
   390		i = 0;
   391		device_for_each_child_node(dev, child_node) {
   392			struct touchscreen_button *button;
   393	
   394			button = &map->buttons[i];
   395	
   396			fwnode_property_read_u32(child_node, "x-position", &button->x);
   397			fwnode_property_read_u32(child_node, "y-position", &button->y);
   398			fwnode_property_read_u32(child_node, "x-size", &button->width);
   399			fwnode_property_read_u32(child_node, "y-size", &button->height);
   400			fwnode_property_read_u32(child_node, "keycode",
   401						 &button->keycode);
   402			dev_info(dev,
   403				 "Adding button at x=%u y=%u size %u x %u keycode=%u\n",
   404				 button->x, button->y, button->width, button->height,
   405				 button->keycode);
   406			++i;
   407		}
   408		return map;
   409	}
   410	
 > 411	int touchscreen_buttons_idev_opened(struct input_dev *idev)
   412	{
   413		struct touchscreen_buttons *buttons;
   414	
   415		buttons = dev_get_drvdata(idev->dev.parent);
   416	
   417		mutex_lock(&buttons->mutex);
   418		if (buttons && buttons->ts_handle) {
   419			if (buttons->ts_handle->open == 0) {
   420				queue_work(buttons->workqueue, &buttons->open_task);
   421				dev_dbg(idev->dev.parent, "idev opened\n");
   422			} else {
   423				dev_info(idev->dev.parent, "idev allready opened\n");
   424			}
   425		} else {
   426			dev_warn(idev->dev.parent,
   427				 "Input device opend but touchscreen not opened. %p %p\n",
   428				 buttons, buttons->ts_handle);
   429		}
   430		mutex_unlock(&buttons->mutex);
   431		return 0;
   432	}
   433	
 > 434	void touchscreen_buttons_idev_closed(struct input_dev *idev)
   435	{
   436		struct touchscreen_buttons *buttons;
   437	
   438		buttons = dev_get_drvdata(idev->dev.parent);
   439	
   440		mutex_lock(&buttons->mutex);
   441		if (buttons && buttons->ts_handle && buttons->ts_handle->open != 0) {
   442			queue_work(buttons->workqueue, &buttons->close_task);
   443			dev_dbg(idev->dev.parent, "idev closed\n");
   444		}
   445		mutex_unlock(&buttons->mutex);
   446	}
   447	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux