diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 18:50:12 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 18:50:12 +0000 |
commit | 8665bd53f2f2e27e5511d90428cb3f60e6d0ce15 (patch) | |
tree | 8d58900dc0ebd4a3011f92c128d2fe45bc7c4bf2 /drivers/net/mdio/mdio-mux-bcm-iproc.c | |
parent | Adding debian version 6.7.12-1. (diff) | |
download | linux-8665bd53f2f2e27e5511d90428cb3f60e6d0ce15.tar.xz linux-8665bd53f2f2e27e5511d90428cb3f60e6d0ce15.zip |
Merging upstream version 6.8.9.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/net/mdio/mdio-mux-bcm-iproc.c')
-rw-r--r-- | drivers/net/mdio/mdio-mux-bcm-iproc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/mdio/mdio-mux-bcm-iproc.c b/drivers/net/mdio/mdio-mux-bcm-iproc.c index a750bd4c77..1ce7d67ba7 100644 --- a/drivers/net/mdio/mdio-mux-bcm-iproc.c +++ b/drivers/net/mdio/mdio-mux-bcm-iproc.c @@ -2,6 +2,7 @@ /* * Copyright 2016 Broadcom */ +#include <linux/align.h> #include <linux/clk.h> #include <linux/delay.h> #include <linux/device.h> @@ -11,6 +12,7 @@ #include <linux/of_mdio.h> #include <linux/phy.h> #include <linux/platform_device.h> +#include <linux/sizes.h> #define MDIO_RATE_ADJ_EXT_OFFSET 0x000 #define MDIO_RATE_ADJ_INT_OFFSET 0x004 @@ -220,12 +222,12 @@ static int mdio_mux_iproc_probe(struct platform_device *pdev) md->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(md->base)) return PTR_ERR(md->base); - if (res->start & 0xfff) { + if (!IS_ALIGNED(res->start, SZ_4K)) { /* For backward compatibility in case the * base address is specified with an offset. */ dev_info(&pdev->dev, "fix base address in dt-blob\n"); - res->start &= ~0xfff; + res->start = ALIGN_DOWN(res->start, SZ_4K); res->end = res->start + MDIO_REG_ADDR_SPACE_SIZE - 1; } |