mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 15:14:38 +01:00
Previously, probe() would call ratbag_init_profiles() which in turn would call the various function pointers in the driver to fill in profiles, buttons and leds (the latter while filling in profiles). This made the probe() function harder to understand than necessary and unreliable because it wasn't always clear which bits were already set up while some driver function was called and which ones weren't yet. This patch switches to a flat probe(). The driver still needs to call ratbag_init_profiles(), libratbag sets up everything (to default values). Then the driver can fill in the rest as it wants. This patch still makes use of the current infrastructure, the drivers just call the read_profile and read_button functions manually now. Fixes #370 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>