diff options
| author | Takashi Sakamoto <[email protected]> | 2024-08-12 23:52:08 +0000 |
|---|---|---|
| committer | Takashi Sakamoto <[email protected]> | 2024-08-12 23:52:08 +0000 |
| commit | 58ee62c2907f4a582edc98c811f23011c5607686 (patch) | |
| tree | 4de673b13a9bddb10c075c9b14d04f8466cc58f1 | |
| parent | firewire: core: add helper functions to convert to parent resource structure (diff) | |
| download | kernel-58ee62c2907f4a582edc98c811f23011c5607686.tar.gz kernel-58ee62c2907f4a582edc98c811f23011c5607686.zip | |
firewire: core: add helper function to detect data of iso resource structure
It depends on the function assigned to release member to identify
resource structure.
This commit adds a helper function to identify iso_resource structure.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Sakamoto <[email protected]>
| -rw-r--r-- | drivers/firewire/core-cdev.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index e72f91cc3711..6fe2a2ea9869 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c @@ -161,6 +161,11 @@ static struct iso_resource *to_iso_resource(struct client_resource *resource) static void release_iso_resource(struct client *, struct client_resource *); +static int is_iso_resource(const struct client_resource *resource) +{ + return resource->release == release_iso_resource; +} + static void schedule_iso_resource(struct iso_resource *r, unsigned long delay) { client_get(r->client); @@ -170,7 +175,7 @@ static void schedule_iso_resource(struct iso_resource *r, unsigned long delay) static void schedule_if_iso_resource(struct client_resource *resource) { - if (resource->release == release_iso_resource) + if (is_iso_resource(resource)) schedule_iso_resource(to_iso_resource(resource), 0); } |
