From d2f8499153aa78b21881b3ca1fcdc026c3a79079 Mon Sep 17 00:00:00 2001 From: "J. German Rivera" Date: Sat, 17 Oct 2015 11:18:15 -0500 Subject: staging: fsl-mc: dpmcp opening/closing refactoring Before, we were opening and closing a mc_io's dpmcp object in fsl_mc_portal_reset(), since that was the only function that was calling dpmcp MC operations. However, it is better for maintainability to open the dpmcp object when it gets associated with an mc_io object, and close it when this association is terminated. This way, we are free to call dpmcp operations on a mc_io's dpmcp object at any time, without having to check if the dpmcp object is opened or not. Consequently, the creation/teardown of the association between an mc_io object and a dpmcp is now encapsulated in two functions: fsl_mc_io_set_dpmcp()/fsl_mc_io_unset_dpmcp(). Besides, setting the corresponding pointers for the association, these functions open and close the dpmcp object respectively. Signed-off-by: J. German Rivera Signed-off-by: Greg Kroah-Hartman --- drivers/staging/fsl-mc/include/mc-sys.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/staging/fsl-mc/include') diff --git a/drivers/staging/fsl-mc/include/mc-sys.h b/drivers/staging/fsl-mc/include/mc-sys.h index bfbecafe75d9..d4fb60289df7 100644 --- a/drivers/staging/fsl-mc/include/mc-sys.h +++ b/drivers/staging/fsl-mc/include/mc-sys.h @@ -69,6 +69,11 @@ int __must_check fsl_create_mc_io(struct device *dev, void fsl_destroy_mc_io(struct fsl_mc_io *mc_io); +int fsl_mc_io_set_dpmcp(struct fsl_mc_io *mc_io, + struct fsl_mc_device *dpmcp_dev); + +void fsl_mc_io_unset_dpmcp(struct fsl_mc_io *mc_io); + int mc_send_command(struct fsl_mc_io *mc_io, struct mc_command *cmd); #endif /* _FSL_MC_SYS_H */ -- cgit v1.2.3