]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
resource: replace open coded variants of DEFINE_RES_*_NAMED()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 17 Mar 2025 18:11:12 +0000 (20:11 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 22 Mar 2025 05:10:05 +0000 (22:10 -0700)
Replace open coded variants of DEFINE_RES_*_NAMED().

Link: https://lkml.kernel.org/r/20250317181412.1560630-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/resource.c

index 3464d6a38424099d2940ebcd6b2f018c38019344..8f3652a41ea4b0408b00f9c54c57d436804358cd 100644 (file)
@@ -1714,18 +1714,13 @@ static int __init reserve_setup(char *str)
                         * I/O port space; otherwise assume it's memory.
                         */
                        if (io_start < 0x10000) {
-                               res->flags = IORESOURCE_IO;
+                               *res = DEFINE_RES_IO_NAMED(io_start, io_num, "reserved");
                                parent = &ioport_resource;
                        } else {
-                               res->flags = IORESOURCE_MEM;
+                               *res = DEFINE_RES_MEM_NAMED(io_start, io_num, "reserved");
                                parent = &iomem_resource;
                        }
-                       res->name = "reserved";
-                       res->start = io_start;
-                       res->end = io_start + io_num - 1;
                        res->flags |= IORESOURCE_BUSY;
-                       res->desc = IORES_DESC_NONE;
-                       res->child = NULL;
                        if (request_resource(parent, res) == 0)
                                reserved = x+1;
                }