diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-04-19 12:14:01 +0900 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-05-07 15:15:27 -0400 |
commit | 8c1de5e08b845eb71c9a247d16bc81ebdab0598d (patch) | |
tree | 3cfa1a137c58f01b0a658bc53d0efec5c1734aca /drivers/usb | |
parent | 9ce751a6f5d6683b0fabd3cfc62da7e9f30bc57f (diff) |
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 <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: fixup cpu_info-rcar.c]
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/dwc3-sti-glue.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/host/dwc3-sti-glue.c b/drivers/usb/host/dwc3-sti-glue.c index 3211c8ee28d..ad7cf6e6b53 100644 --- a/drivers/usb/host/dwc3-sti-glue.c +++ b/drivers/usb/host/dwc3-sti-glue.c @@ -133,7 +133,7 @@ static int sti_dwc3_glue_ofdata_to_platdata(struct udevice *dev) pr_err("unable to find regmap\n"); return -ENODEV; } - plat->syscfg_base = regmap->base; + plat->syscfg_base = regmap->ranges[0].start; /* get powerdown reset */ ret = reset_get_by_name(dev, "powerdown", &plat->powerdown_ctl); |