libpdbg: Refactor code to get chip id
libpdbg: Refactor code to get chip id

Signed-off-by: Amitay Isaacs <a505e7c038746dbeb3edcd8d146dbd515432801f@ozlabs.org>

open-power/pdbg,open-power/pdbg,open-power/pdbg