[systemd-devel] [PATCH v2 5/6] udev: builtin-keyboard: add support for EV_ABS_OVERRIDE

Martin Pitt martin.pitt at ubuntu.com
Fri Mar 27 04:54:50 PDT 2015


Hey Peter,

thanks for these! Patches 1 to 4 look good to me, but I have some
questions/comments on this one.

Peter Hutterer [2015-03-23 11:30 +1000]:
> --- /dev/null
> +++ b/rules/60-evdev.rules
> @@ -0,0 +1,14 @@
> +# do not edit this file, it will be overwritten on update
> +
> +ACTION=="remove", GOTO="evdev_end"
> +KERNEL!="event*", GOTO="evdev_end"
> +
> +# skip later rules when we find something for this input device
> +IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=evdev:", \
> +  RUN{builtin}+="keyboard", GOTO="evdev_end"
> +
> +# device matching the input device name and the machine's DMI data
> +KERNELS=="input*", IMPORT{builtin}="hwdb 'evdev:name:$attr{name}:$attr{[dmi/id]modalias}'", \
> +  RUN{builtin}+="keyboard", GOTO="evdev_end"

With this we would then call the hwdb builtin here, and another time
in 60-keyboard.rules, except that that one uses a "keyboard:" prefix.
I wonder if we could use the generalized "evdev:" for all of them?

> +static int open_device(const char *devnode) {
> +        int fd = open(devnode, O_RDWR|O_CLOEXEC|O_NONBLOCK|O_NOCTTY);

I think calling functions in variable declarations is frowned upon in
the systemd code.

The rest LGTM, thanks!

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)


More information about the systemd-devel mailing list