spa: alsa,v4l2: use proper enum for action

An enum provides better debugging experience
and makes the source code easier to grasp.
This commit is contained in:
Barnabás Pőcze 2024-01-09 15:24:49 +01:00
parent 04b8a0c215
commit 5fa34988fa
2 changed files with 12 additions and 8 deletions

View file

@ -31,9 +31,11 @@
#define MAX_CARDS 64
#define ACTION_ADD 0
#define ACTION_REMOVE 1
#define ACTION_DISABLE 2
enum action {
ACTION_ADD,
ACTION_REMOVE,
ACTION_DISABLE,
};
/* Used for unavailable devices in the card structure. */
#define ID_DEVICE_NOT_SUPPORTED 0
@ -715,7 +717,7 @@ static bool check_access(struct impl *this, struct card *card)
return card->accessible;
}
static void process_card(struct impl *this, uint32_t action, struct udev_device *udev_device)
static void process_card(struct impl *this, enum action action, struct udev_device *udev_device)
{
unsigned int card_nr;
struct card *card;

View file

@ -28,9 +28,11 @@
#define MAX_DEVICES 64
#define ACTION_ADD 0
#define ACTION_REMOVE 1
#define ACTION_DISABLE 2
enum action {
ACTION_ADD,
ACTION_REMOVE,
ACTION_DISABLE,
};
struct device {
uint32_t id;
@ -357,7 +359,7 @@ static bool check_access(struct impl *this, struct device *device)
return device->accessible;
}
static void process_device(struct impl *this, uint32_t action, struct udev_device *dev)
static void process_device(struct impl *this, enum action action, struct udev_device *dev)
{
uint32_t id;
struct device *device;