Skip to content

Commit d39d167

Browse files
andy-shevgeertu
authored andcommitted
zorro: Use helpers from ioport.h
We can use the DEFINE_RES_MEM_NAMED() macro and resource_contains() helper instead of reimplementing them in the code. No functional change intended. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent 70d830e commit d39d167

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

drivers/zorro/zorro.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,13 @@ static struct resource __init *zorro_find_parent_resource(
117117
int i;
118118

119119
for (i = 0; i < bridge->num_resources; i++) {
120-
struct resource *r = &bridge->resource[i];
121-
122-
if (zorro_resource_start(z) >= r->start &&
123-
zorro_resource_end(z) <= r->end)
124-
return r;
120+
if (resource_contains(&bridge->resource[i], &z->resource))
121+
return &bridge->resource[i];
125122
}
123+
126124
return &iomem_resource;
127125
}
128126

129-
130-
131127
static int __init amiga_zorro_probe(struct platform_device *pdev)
132128
{
133129
struct zorro_bus *bus;
@@ -176,9 +172,7 @@ static int __init amiga_zorro_probe(struct platform_device *pdev)
176172
z->slotsize = zi->slotsize;
177173
sprintf(z->name, "Zorro device %08x", z->id);
178174
zorro_name_device(z);
179-
z->resource.start = zi->boardaddr;
180-
z->resource.end = zi->boardaddr + zi->boardsize - 1;
181-
z->resource.name = z->name;
175+
z->resource = DEFINE_RES_MEM_NAMED(zi->boardaddr, zi->boardsize, z->name);
182176
r = zorro_find_parent_resource(pdev, z);
183177
error = request_resource(r, &z->resource);
184178
if (error && !(z->rom.er_Type & ERTF_MEMLIST))

0 commit comments

Comments
 (0)