From 262f2b782e255b7959b6b8fdfd9347558a7003a2 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Fri, 2 Sep 2022 17:57:27 -0400 Subject: net: fman: Map the base address once We don't need to remap the base address from the resource twice (once in mac_probe() and again in set_fman_mac_params()). We still need the resource to get the end address, but we can use a single function call to get both at once. While we're at it, use platform_get_mem_or_io and devm_request_resource to map the resource. I think this is the more "correct" way to do things here, since we use the pdev resource, instead of creating a new one. It's still a bit tricky, since we need to ensure that the resource is a child of the fman region when it gets requested. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Signed-off-by: David S. Miller --- drivers/net/ethernet/freescale/fman/mac.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/net/ethernet/freescale/fman/mac.h') diff --git a/drivers/net/ethernet/freescale/fman/mac.h b/drivers/net/ethernet/freescale/fman/mac.h index da410a7d00c9..7aa71b05bd3e 100644 --- a/drivers/net/ethernet/freescale/fman/mac.h +++ b/drivers/net/ethernet/freescale/fman/mac.h @@ -19,8 +19,9 @@ struct fman_mac; struct mac_priv_s; struct mac_device { + void __iomem *vaddr; + void __iomem *vaddr_end; struct device *dev; - struct resource *res; u8 addr[ETH_ALEN]; struct fman_port *port[2]; u32 if_support; -- cgit v1.2.3