Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Jul 2014 17:25:28 +0000 (UTC)
From:      Jakub Wojciech Klama <jceel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r268166 - user/jceel/soc2014_evdev/head/sys/dev/evdev
Message-ID:  <201407021725.s62HPSVV082918@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jceel
Date: Wed Jul  2 17:25:28 2014
New Revision: 268166
URL: http://svnweb.freebsd.org/changeset/base/268166

Log:
  Remove unused stuff from uinput driver.

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

Modified: user/jceel/soc2014_evdev/head/sys/dev/evdev/uinput.c
==============================================================================
--- user/jceel/soc2014_evdev/head/sys/dev/evdev/uinput.c	Wed Jul  2 16:17:48 2014	(r268165)
+++ user/jceel/soc2014_evdev/head/sys/dev/evdev/uinput.c	Wed Jul  2 17:25:28 2014	(r268166)
@@ -75,22 +75,13 @@ static struct cdevsw uinput_cdevsw = {
 	.d_write = uinput_write,
 	.d_ioctl = uinput_ioctl,
 	.d_poll = uinput_poll,
-	.d_kqfilter = uinput_kqfilter,
 	.d_name = "uinput",
 	.d_flags = D_TRACKCLOSE,
 };
 
-static struct filterops uinput_cdev_filterops = {
-	.f_isfd = 1,
-	.f_attach = NULL,
-	.f_detach = uinput_kqdetach,
-	.f_event = uinput_kqread,
-};
-
 static struct evdev_methods uinput_ev_methods = {
-	.ev_open = uinput_ev_open,
-	.ev_close = uinput_ev_close,
-	.ev_event = uinput_ev_event,
+	.ev_open = NULL,
+	.ev_close = NULL,
 };
 
 struct uinput_cdev_softc
@@ -106,8 +97,6 @@ struct uinput_cdev_state
 	struct evdev_dev *	ucs_evdev;
 	struct evdev_dev	ucs_state;
 	struct mtx		ucs_mtx;
-	struct selinfo		ucs_selp;
-	struct sigio *		ucs_sigio;
 };
 
 static int
@@ -118,8 +107,6 @@ uinput_open(struct cdev *dev, int oflags
 	state = malloc(sizeof(struct uinput_cdev_state), M_EVDEV, M_WAITOK | M_ZERO);
 	state->ucs_evdev = evdev_alloc();
 
-	knlist_init_mtx(&state->ucs_selp.si_note, NULL);
-
 	devfs_set_cdevpriv(state, uinput_dtor);
 	return (0);
 }
@@ -141,7 +128,6 @@ uinput_dtor(void *data)
 	evdev_unregister(NULL, state->ucs_evdev);
 	evdev_free(state->ucs_evdev);
 
-	seldrain(&state->ucs_selp);
 	free(data, M_EVDEV);
 }
 
@@ -238,55 +224,16 @@ uinput_setup_provider(struct evdev_dev *
 static int
 uinput_poll(struct cdev *dev, int events, struct thread *td)
 {
-	struct uinput_cdev_state *state;
-	int ret;
 	int revents = 0;
 
-	debugf("cdev: poll by thread %d", td->td_tid);
-
-	ret = devfs_get_cdevpriv((void **)&state);
-	if (ret != 0)
-		return (ret);
+	/* Always allow write */
+	if (events & (POLLOUT | POLLWRNORM))
+		revents |= (events & (POLLOUT | POLLWRNORM));
 
 	return (revents);
 }
 
 static int
-uinput_kqfilter(struct cdev *dev, struct knote *kn)
-{
-	struct uinput_cdev_state *state;
-	int ret;
-
-	ret = devfs_get_cdevpriv((void **)&state);
-	if (ret != 0)
-		return (ret);
-
-	kn->kn_hook = (caddr_t)state;
-	kn->kn_fop = &uinput_cdev_filterops;
-
-	knlist_add(&state->ucs_selp.si_note, kn, 0);
-	return (0);
-}
-
-static int
-uinput_kqread(struct knote *kn, long hint)
-{
-	struct uinput_cdev_state *state;
-
-	state = (struct uinput_cdev_state *)kn->kn_hook;
-	return (0);
-}
-
-static void
-uinput_kqdetach(struct knote *kn)
-{
-	struct uinput_cdev_state *state;
-
-	state = (struct uinput_cdev_state *)kn->kn_hook;
-	knlist_remove(&state->ucs_selp.si_note, kn, 0);
-}
-
-static int
 uinput_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
     struct thread *td)
 {
@@ -297,7 +244,6 @@ uinput_ioctl(struct cdev *dev, u_long cm
 
 	debugf("uinput: ioctl called: cmd=0x%08lx, data=%p", cmd, data);
 
-
 	ret = devfs_get_cdevpriv((void **)&state);
 	if (ret != 0)
 		return (ret);
@@ -362,32 +308,6 @@ uinput_ioctl(struct cdev *dev, u_long cm
 	return (0);
 }
 
-static void
-uinput_notify_event(struct evdev_client *client, void *data)
-{
-	struct uinput_cdev_state *state = (struct uinput_cdev_state *)data;
-
-	selwakeup(&state->ucs_selp);
-}
-
-static int uinput_ev_open(struct evdev_dev *dev, void *softc)
-{
-
-	return (0);
-}
-
-
-static void uinput_ev_close(struct evdev_dev *dev, void *softc)
-{
-
-}
-
-static void uinput_ev_event(struct evdev_dev *dev, void *softc, uint16_t type,
-    uint16_t code, int32_t value)
-{
-
-}
-
 static int
 uinput_cdev_create(void)
 {



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