Skip to content

Remove activate state argument

Benjamin Berg requested to merge benzea/remove-activate-state-argument into master

The state was always AWAIT_FINGER and it was never used by any driver (except for error checking). So remove it, in particular as a correct state change will be done after activation anyway.

The only driver with code that actually did anything based on this was the URU4000 driver. However, all it did was an explicit state change execution. This is not necessary, as the state_change handler is called anyway (i.e. we now only write the AWAIT_FINGER register once rather than twice).

Manual changes plus:

@ init @
identifier driver_name;
identifier activate_func;
@@
struct fp_img_driver driver_name = {
    ...,
    .activate = activate_func,
    ...,
};
@ remove_arg @
identifier dev;
identifier state;
identifier init.activate_func;
@@
activate_func (
	struct fp_img_dev *dev
-	, enum fp_imgdev_state state
	)
{
	<...
-	if (state != IMGDEV_STATE_AWAIT_FINGER_ON) { ... }
	...>
}
Edited by Benjamin Berg

Merge request reports