Files
libfprint/libfprint/fprint-list-udev-rules.c
Bastien Nocera 5c0bc90677 lib: Add new bus types for drivers
Add a way for drivers to declare they support a bus type other than USB.
We have declarations for SPI and virtual drivers, though there's no
device discovery implemented yet.

https://bugs.freedesktop.org/show_bug.cgi?id=106279

Patch modified from the original by Benjamin Berg <bberg@redhat.com>.
The drivers updates were mainly done using the following spatch:

@drv1@
identifier driver_name;
identifier id_table_var;
@@
struct fp_driver driver_name = {
	...,
-	.id_table = id_table_var,
+	.bus = BUS_TYPE_USB,
+	.id_table.usb = id_table_var,
	...
};
@imgdrv1@
identifier driver_name;
identifier id_table_var;
@@
struct fp_img_driver driver_name = {
	...,
	.driver = {
		...,
-		.id_table = id_table_var,
+		.bus = BUS_TYPE_USB,
+		.id_table.usb = id_table_var,
		...
	},
	...,
};
@imgdrv2@
identifier driver_name;
identifier discover_func;
@@
struct fp_img_driver driver_name = {
	...,
	.driver = {
		...,
-		.discover = discover_func,
+		.usb_discover = discover_func,
		...
	},
	...
};
@idtable1@
identifier drv;
expression x;
@@
	struct fp_driver *drv;
	<...
-	drv->id_table[x]
+	drv->id_table.usb[x]
	...>
@idtable2@
identifier drv;
identifier func;
expression x;
@@
func (..., struct fp_driver *drv, ...)
{
	<...
-	drv->id_table[x]
+	drv->id_table.usb[x]
	...>
}
2019-06-12 17:48:39 +02:00

3.4 KiB