mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
ihs_mdio: Use new regmap interface
For the DM case, use the proper parameter for the regmap_init_mem call (which is the ofnode, not the udevice). Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
935a89241c
commit
e29dfce06c
1 changed files with 3 additions and 2 deletions
|
@ -11,6 +11,7 @@
|
|||
#include <gdsys_fpga.h>
|
||||
#else
|
||||
#include <fdtdec.h>
|
||||
#include <dm.h>
|
||||
#include <regmap.h>
|
||||
#endif
|
||||
|
||||
|
@ -28,7 +29,7 @@ static inline u16 read_reg(struct udevice *fpga, uint base, uint addr)
|
|||
struct regmap *map;
|
||||
u8 *ptr;
|
||||
|
||||
regmap_init_mem(fpga, &map);
|
||||
regmap_init_mem(dev_ofnode(fpga), &map);
|
||||
ptr = regmap_get_range(map, 0);
|
||||
|
||||
return in_le16((u16 *)(ptr + base + addr));
|
||||
|
@ -40,7 +41,7 @@ static inline void write_reg(struct udevice *fpga, uint base, uint addr,
|
|||
struct regmap *map;
|
||||
u8 *ptr;
|
||||
|
||||
regmap_init_mem(fpga, &map);
|
||||
regmap_init_mem(dev_ofnode(fpga), &map);
|
||||
ptr = regmap_get_range(map, 0);
|
||||
|
||||
out_le16((u16 *)(ptr + base + addr), val);
|
||||
|
|
Loading…
Reference in a new issue