]> git.baikalelectronics.ru Git - kernel.git/commit
pinctrl: sh-pfc: Print actual field width for variable-width fields
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 13 Dec 2018 14:20:13 +0000 (15:20 +0100)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 18 Dec 2018 10:25:56 +0000 (11:25 +0100)
commitcf87f318b5b471989ea36d1ec7fa19c8a5fb4787
tree7fc31fd433c5b04e0d3d33d697b49b4c509b3103
parent68bc98b50a23d2bcabd12c658466348d87ad0a96
pinctrl: sh-pfc: Print actual field width for variable-width fields

The debug code in sh_pfc_write_config_reg() prints the width of the
field being modified.

However, registers with a variable-width field layout are identified by
pinmux_cfg_reg.field_width being zero, hence zeroes are printed instead
of the actual field widths.

Fix this by printing the Hamming weight of the field mask instead, which
is correct for both fixed-width and variable-width fields.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
drivers/pinctrl/sh-pfc/core.c