bus: mhi: core: Pass module owner during client driver registration
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Tue, 24 Mar 2020 06:10:44 +0000 (11:40 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Mar 2020 12:45:24 +0000 (13:45 +0100)
commit821747386cb6cd75593a8854208b8af188b4caed
treeefd8c7a53efee176890bfe54e28e924568a54104
parent8622dfefb6ac333c58d354331d1bf78a2927ce51
bus: mhi: core: Pass module owner during client driver registration

The module owner field can be used to prevent the removal of kernel
modules when there are any device files associated with it opened in
userspace. Hence, modify the API to pass module owner field. For
convenience, module_mhi_driver() macro is used which takes care of
passing the module owner through THIS_MODULE of the module of the
driver and also avoiding the use of specifying the default MHI client
driver register/unregister routines.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20200324061050.14845-2-manivannan.sadhasivam@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/bus/mhi/core/init.c
include/linux/mhi.h