]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: dsa: felix: remove felix_info :: imdio_res
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 27 Sep 2022 19:15:16 +0000 (22:15 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 29 Sep 2022 02:14:55 +0000 (19:14 -0700)
The imdio_res is used only by vsc9959, which references its own
vsc9959_imdio_res through the common felix_info->imdio_res pointer.
Since the common code doesn't care about this resource (and it can't be
part of the common array of resources, either, because it belongs in a
different PCI BAR), just reference it directly.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/ocelot/felix.h
drivers/net/dsa/ocelot/felix_vsc9959.c

index e4fd5eef57a05a46107aee279048a53a685b2762..535a615f2b704784eaa086e568ca0d076c95d799 100644 (file)
@@ -18,7 +18,6 @@
 struct felix_info {
        const struct resource           *target_io_res;
        const struct resource           *port_io_res;
-       const struct resource           *imdio_res;
        const struct reg_field          *regfields;
        const u32 *const                *map;
        const struct ocelot_ops         *ops;
index 2ec49e42b3f42886619b880558c62ba75644a265..2234b4eccc1e7843728ce7d5d4a8b8f41b4cb1c3 100644 (file)
@@ -1021,7 +1021,7 @@ static int vsc9959_mdio_bus_alloc(struct ocelot *ocelot)
                return -ENOMEM;
        }
 
-       memcpy(&res, felix->info->imdio_res, sizeof(res));
+       memcpy(&res, &vsc9959_imdio_res, sizeof(res));
        res.flags = IORESOURCE_MEM;
        res.start += felix->imdio_base;
        res.end += felix->imdio_base;
@@ -2592,7 +2592,6 @@ static const struct ocelot_ops vsc9959_ops = {
 static const struct felix_info felix_info_vsc9959 = {
        .target_io_res          = vsc9959_target_io_res,
        .port_io_res            = vsc9959_port_io_res,
-       .imdio_res              = &vsc9959_imdio_res,
        .regfields              = vsc9959_regfields,
        .map                    = vsc9959_regmap,
        .ops                    = &vsc9959_ops,