mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
Store the input_id in ratbag directly
This should be cleaned up eventually when we will be actually using libevdev. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
@@ -45,6 +45,7 @@ struct ratbag {
|
||||
struct udev_device *udev_hidraw;
|
||||
int evdev_fd;
|
||||
int refcount;
|
||||
struct input_id ids;
|
||||
struct ratbag_driver *driver;
|
||||
struct libratbag *libratbag;
|
||||
};
|
||||
|
||||
@@ -240,7 +240,6 @@ LIBRATBAG_EXPORT struct ratbag*
|
||||
ratbag_new_from_fd(struct libratbag *libratbag, int fd)
|
||||
{
|
||||
int rc;
|
||||
struct input_id ids;
|
||||
struct ratbag *ratbag = NULL;
|
||||
struct ratbag_driver *driver;
|
||||
char buf[256];
|
||||
@@ -256,7 +255,7 @@ ratbag_new_from_fd(struct libratbag *libratbag, int fd)
|
||||
|
||||
ratbag->libratbag = libratbag_ref(libratbag);
|
||||
|
||||
rc = ioctl(fd, EVIOCGID, &ids);
|
||||
rc = ioctl(fd, EVIOCGID, &ratbag->ids);
|
||||
if (rc < 0)
|
||||
goto out_err;
|
||||
|
||||
@@ -277,7 +276,7 @@ ratbag_new_from_fd(struct libratbag *libratbag, int fd)
|
||||
if (rc)
|
||||
goto out_err;
|
||||
|
||||
driver = ratbag_find_driver(libratbag, ratbag, &ids);
|
||||
driver = ratbag_find_driver(libratbag, ratbag, &ratbag->ids);
|
||||
if (!driver) {
|
||||
errno = ENOTSUP;
|
||||
goto err_udev;
|
||||
|
||||
Reference in New Issue
Block a user