external/opal-prd: Move client socket common code to a function
external/opal-prd: Move client socket common code to a function

This patch moves out the common code to a function send_prd_control()
which can be invoked for sending the control message to the opal-prd
daemon. It avoids the duplication of the code into the individual
functions corresponding to variety of control messages.

Signed-off-by: Neelesh Gupta <0c847490c0192d1430997c36c35afbb478c33ca8@linux.vnet.ibm.com>
Acked-by: Jeremy Kerr <68a658b44bbaefab3ef5cd231967195fc0ff9d69@ozlabs.org>
Reviewed-by: Patrick Williams <c87e37b1a4035affd737b461af89fb722d635f4d@us.ibm.com>
Signed-off-by: Stewart Smith <ec31ab75ddf977353c8f660f92ea8b23f64aef25@linux.vnet.ibm.com>

open-power/skiboot,open-power/skiboot,csmart/skiboot,csmart/skiboot,qemu/skiboot,stewart-ibm/skiboot,qemu/skiboot,qemu/skiboot,mikey/skiboot,shenki/skiboot,apopple/skiboot,legoater/skiboot,qemu/skiboot,csmart/skiboot,open-power/skiboot,shenki/skiboot,stewart-ibm/skiboot,stewart-ibm/skiboot,shenki/skiboot,shenki/skiboot,apopple/skiboot,mikey/skiboot,open-power/skiboot,open-power/skiboot,legoater/skiboot,qemu/skiboot,mikey/skiboot,legoater/skiboot,apopple/skiboot,shenki/skiboot,legoater/skiboot,legoater/skiboot