From owner-svn-src-all@freebsd.org Mon Sep 12 01:18:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1327DBD4FFC; Mon, 12 Sep 2016 01:18:27 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA407750; Mon, 12 Sep 2016 01:18:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C1IQbW068894; Mon, 12 Sep 2016 01:18:26 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C1IQJD068893; Mon, 12 Sep 2016 01:18:26 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201609120118.u8C1IQJD068893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 12 Sep 2016 01:18:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305719 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 01:18:27 -0000 Author: gonzo Date: Mon Sep 12 01:18:25 2016 New Revision: 305719 URL: https://svnweb.freebsd.org/changeset/base/305719 Log: Cleanup evdev support for TI ADC/TS - evdev_set_methods call is not required if actual methods are no-ops - evdev_set_serial is also optional if there is no meaningful input device identifier - evdev_set_id on the other hand is mandatory, so set virtual bus with dummy vendor/product/version Suggested by: Vladimir Kondratiev Modified: head/sys/arm/ti/ti_adc.c Modified: head/sys/arm/ti/ti_adc.c ============================================================================== --- head/sys/arm/ti/ti_adc.c Mon Sep 12 00:24:56 2016 (r305718) +++ head/sys/arm/ti/ti_adc.c Mon Sep 12 01:18:25 2016 (r305719) @@ -90,27 +90,6 @@ static int ti_adc_samples[5] = { 0, 2, 4 static int ti_adc_detach(device_t dev); #ifdef EVDEV -static evdev_open_t ti_adc_ev_open; -static evdev_close_t ti_adc_ev_close; - -static struct evdev_methods ti_adc_evdev_methods = { - .ev_open = &ti_adc_ev_open, - .ev_close = &ti_adc_ev_close, -}; - -static void -ti_adc_ev_close(struct evdev_dev *evdev, void *ev_softc) -{ - /* Nothing to do here */ -} - -static int -ti_adc_ev_open(struct evdev_dev *evdev, void *ev_softc) -{ - /* Nothing to do here */ - return (0); -} - static void ti_adc_ev_report(struct ti_adc_softc *sc) { @@ -900,8 +879,7 @@ ti_adc_attach(device_t dev) sc->sc_evdev = evdev_alloc(); evdev_set_name(sc->sc_evdev, device_get_desc(dev)); evdev_set_phys(sc->sc_evdev, device_get_nameunit(dev)); - evdev_set_serial(sc->sc_evdev, "0"); - evdev_set_methods(sc->sc_evdev, sc, &ti_adc_evdev_methods); + evdev_set_id(sc->sc_evdev, BUS_VIRTUAL, 0, 0, 0); evdev_support_prop(sc->sc_evdev, INPUT_PROP_DIRECT); evdev_support_event(sc->sc_evdev, EV_SYN); evdev_support_event(sc->sc_evdev, EV_ABS);