Skip to content

Commit 58ee62c

Browse files
committed
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/20240812235210.28458-4-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
1 parent ced2da3 commit 58ee62c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

drivers/firewire/core-cdev.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ static struct iso_resource *to_iso_resource(struct client_resource *resource)
161161

162162
static void release_iso_resource(struct client *, struct client_resource *);
163163

164+
static int is_iso_resource(const struct client_resource *resource)
165+
{
166+
return resource->release == release_iso_resource;
167+
}
168+
164169
static void schedule_iso_resource(struct iso_resource *r, unsigned long delay)
165170
{
166171
client_get(r->client);
@@ -170,7 +175,7 @@ static void schedule_iso_resource(struct iso_resource *r, unsigned long delay)
170175

171176
static void schedule_if_iso_resource(struct client_resource *resource)
172177
{
173-
if (resource->release == release_iso_resource)
178+
if (is_iso_resource(resource))
174179
schedule_iso_resource(to_iso_resource(resource), 0);
175180
}
176181

0 commit comments

Comments
 (0)