power-profiles-daemon: Add a single restart drivers function

It's easy enough, but let's use the same code everywhere
This commit is contained in:
Marco Trevisan (Treviño) 2024-04-02 18:02:42 +02:00
parent 42866c5ce3
commit 932d3888b3
2 changed files with 12 additions and 7 deletions

View file

@ -1106,14 +1106,20 @@ has_required_drivers (PpdApp *data)
return TRUE;
}
static void
restart_profile_drivers (PpdApp *data)
{
stop_profile_drivers (data);
start_profile_drivers (data);
}
static void
driver_probe_request_cb (PpdDriver *driver,
gpointer user_data)
{
PpdApp *data = user_data;
stop_profile_drivers (data);
start_profile_drivers (data);
restart_profile_drivers (data);
}
static void
@ -1282,10 +1288,9 @@ bail:
}
void
restart_profile_drivers (void)
restart_profile_drivers_for_default_app (void)
{
stop_profile_drivers (ppd_app);
start_profile_drivers (ppd_app);
restart_profile_drivers (ppd_app);
}

View file

@ -14,7 +14,7 @@
#include <termios.h>
extern void main_loop_quit (void);
void restart_profile_drivers (void);
void restart_profile_drivers_for_default_app (void);
struct _PpdDriverFake
{
@ -88,7 +88,7 @@ check_keyboard (GIOChannel *source,
break;
case 'r':
g_print ("Restarting profile drivers\n");
restart_profile_drivers ();
restart_profile_drivers_for_default_app ();
break;
case 'q':
case 'x':