Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Apr 2015 14:55:23 +0000 (UTC)
From:      Jakub Wojciech Klama <jceel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r281744 - user/jceel/soc2014_evdev/head/sys/dev/evdev
Message-ID:  <201504191455.t3JEtNLj054098@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jceel
Date: Sun Apr 19 14:55:22 2015
New Revision: 281744
URL: https://svnweb.freebsd.org/changeset/base/281744

Log:
  To conform with Linux implementation, return ENOENT from EVIOCGPHYS
  and EVIOCGUNIQ ioctl if device is backed by uinput.

Modified:
  user/jceel/soc2014_evdev/head/sys/dev/evdev/cdev.c

Modified: user/jceel/soc2014_evdev/head/sys/dev/evdev/cdev.c
==============================================================================
--- user/jceel/soc2014_evdev/head/sys/dev/evdev/cdev.c	Sun Apr 19 13:51:25 2015	(r281743)
+++ user/jceel/soc2014_evdev/head/sys/dev/evdev/cdev.c	Sun Apr 19 14:55:22 2015	(r281744)
@@ -367,7 +367,7 @@ evdev_ioctl(struct cdev *dev, u_long cmd
 
 	case IOCBASECMD(EVIOCGREP):
 		if (evdev->ev_repeat_mode == NO_REPEAT)
-			return ENOTSUP;
+			return (ENOTSUP);
 
 		rep_params[0] = evdev->ev_rep[REP_DELAY];
 		rep_params[1] = evdev->ev_rep[REP_PERIOD];
@@ -376,7 +376,7 @@ evdev_ioctl(struct cdev *dev, u_long cmd
 
 	case IOCBASECMD(EVIOCSREP):
 		if (evdev->ev_repeat_mode == NO_REPEAT)
-			return ENOTSUP;
+			return (ENOTSUP);
 
 		memcpy(rep_params, data, sizeof(rep_params));
 		evdev->ev_rep[REP_DELAY] = rep_params[0];
@@ -391,7 +391,7 @@ evdev_ioctl(struct cdev *dev, u_long cmd
 
 	case IOCBASECMD(EVIOCGKEYCODE_V2):
 		if (evdev->ev_methods->ev_get_keycode == NULL)
-			return ENOTSUP;
+			return (ENOTSUP);
 
 		ke = (struct input_keymap_entry *)data;
 		evdev->ev_methods->ev_get_keycode(evdev, evdev->ev_softc, ke);
@@ -399,7 +399,7 @@ evdev_ioctl(struct cdev *dev, u_long cmd
 
 	case IOCBASECMD(EVIOCSKEYCODE_V2):
 		if (evdev->ev_methods->ev_set_keycode == NULL)
-			return ENOTSUP;
+			return (ENOTSUP);
 
 		ke = (struct input_keymap_entry *)data;
 		evdev->ev_methods->ev_set_keycode(evdev, evdev->ev_softc, ke);
@@ -410,10 +410,16 @@ evdev_ioctl(struct cdev *dev, u_long cmd
 		break;
 
 	case EVIOCGPHYS(0):
+		if (evdev->ev_dev == NULL)
+			return (ENOENT);
+
 		strlcpy(data, evdev->ev_shortname, len);
 		break;
 
 	case EVIOCGUNIQ(0):
+		if (evdev->ev_dev == NULL)
+			return (ENOENT);
+
 		strlcpy(data, evdev->ev_serial, len);
 		break;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504191455.t3JEtNLj054098>