Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <andriy.shevchenko@linux.intel.com>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/20230831121623.36293-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

authored by

Andy Shevchenko and committed by
Geert Uytterhoeven
d39d1677 70d830e3

+4 -10
+4 -10
drivers/zorro/zorro.c
··· 117 117 int i; 118 118 119 119 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]; 125 122 } 123 + 126 124 return &iomem_resource; 127 125 } 128 - 129 - 130 126 131 127 static int __init amiga_zorro_probe(struct platform_device *pdev) 132 128 { ··· 172 176 z->slotsize = zi->slotsize; 173 177 sprintf(z->name, "Zorro device %08x", z->id); 174 178 zorro_name_device(z); 175 - z->resource.start = zi->boardaddr; 176 - z->resource.end = zi->boardaddr + zi->boardsize - 1; 177 - z->resource.name = z->name; 179 + z->resource = DEFINE_RES_MEM_NAMED(zi->boardaddr, zi->boardsize, z->name); 178 180 r = zorro_find_parent_resource(pdev, z); 179 181 error = request_resource(r, &z->resource); 180 182 if (error && !(z->rom.er_Type & ERTF_MEMLIST))