From 8c1de5e08b845eb71c9a247d16bc81ebdab0598d Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 19 Apr 2018 12:14:01 +0900 Subject: regmap: clean up regmap allocation Putting zero length array at the end of struct is a common technique to embed arbitrary length of members. There is no good reason to let regmap_alloc_count() branch by "if (count <= 1)". As far as I understood the code, regmap->base is an alias of regmap->ranges[0].start, but it is not helpful but make the code just ugly. Rename regmap_alloc_count() to regmap_alloc() because the _count suffix seems pointless. Signed-off-by: Masahiro Yamada Reviewed-by: Simon Glass [trini: fixup cpu_info-rcar.c] Signed-off-by: Tom Rini --- drivers/phy/sti_usb_phy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/phy/sti_usb_phy.c') diff --git a/drivers/phy/sti_usb_phy.c b/drivers/phy/sti_usb_phy.c index c63967c2a1..ec597da84e 100644 --- a/drivers/phy/sti_usb_phy.c +++ b/drivers/phy/sti_usb_phy.c @@ -64,12 +64,12 @@ static int sti_usb_phy_init(struct phy *usb_phy) void __iomem *reg; /* set ctrl picophy value */ - reg = (void __iomem *)phy->regmap->base + phy->ctrl; + reg = (void __iomem *)phy->regmap->ranges[0].start + phy->ctrl; /* CTRL_PORT mask is 0x1f */ clrsetbits_le32(reg, 0x1f, STIH407_USB_PICOPHY_CTRL_PORT_CONF); /* set ports parameters overriding */ - reg = (void __iomem *)phy->regmap->base + phy->param; + reg = (void __iomem *)phy->regmap->ranges[0].start + phy->param; /* PARAM_DEF mask is 0xffffffff */ clrsetbits_le32(reg, 0xffffffff, STIH407_USB_PICOPHY_PARAM_DEF); -- cgit v1.2.3