lib: utils/regmap: Use FDT node offset as regmap ID

Since the FDT is not modified during driver initialization, node offsets
are just as suitable as phandles for use as identifiers: they are stable
and unique. With this change, it is no longer necessary to pass the
phandle to the driver init functions, so these init functions now use
the same prototype as other kinds of drivers.

This matches what is already done for I2C adapters.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Samuel Holland
2024-09-03 19:09:39 -07:00
committed by Anup Patel
parent d71150ee70
commit 9782b8847d
3 changed files with 10 additions and 10 deletions

View File

@@ -159,7 +159,7 @@ static int regmap_syscon_write_be32(struct regmap *rmap, unsigned int reg,
return 0;
}
static int regmap_syscon_init(const void *fdt, int nodeoff, u32 phandle,
static int regmap_syscon_init(const void *fdt, int nodeoff,
const struct fdt_match *match)
{
struct syscon_regmap *srm;
@@ -188,7 +188,7 @@ static int regmap_syscon_init(const void *fdt, int nodeoff, u32 phandle,
goto fail_free_syscon;
srm->addr = addr;
srm->rmap.id = phandle;
srm->rmap.id = nodeoff;
srm->rmap.reg_shift = 0;
srm->rmap.reg_stride = srm->reg_io_width * 8;
srm->rmap.reg_base = 0;