soc: renesas: Consolidate product register handling
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 10 Nov 2021 19:00:52 +0000 (20:00 +0100)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 30 Nov 2021 08:42:00 +0000 (09:42 +0100)
commit05b22caa7490e4f4c94bbde33c61cf72d187b8f7
tree7d5a90067fb0ab4d3ba101ae75a87ff5fe4061bf
parent4c7924fb905b02323ff6d9d20f370892615dccfa
soc: renesas: Consolidate product register handling

Currently renesas_soc_init() scans the whole device tree up to three
times, to find a device node describing a product register.
Furthermore, the product register handling for the different variants is
very similar, with the major difference being the location of the
product bitfield inside the product register.

Reduce scanning to a single pass using of_find_matching_node_and_match()
instead.  Switch to a common handling of product registers, by storing
the intrinsics of each product register type in the data field of the
corresponding match entry.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/057721f46c7499de4133135488f0f3da7fb39265.1636570669.git.geert+renesas@glider.be
drivers/soc/renesas/renesas-soc.c