提交 e0c5c5fa 编写于 作者: P Phillip Potter 提交者: Yang Yingliang

dmaengine: qcom_hidma: comment platform_driver_register call

[ Upstream commit 4df2a8b0 ]

Place a comment in hidma_mgmt_init explaining why success must
currently be assumed, due to the cleanup issue that would need to
be considered were this module ever to be unloadable or were this
platform_driver_register call ever to fail.
Acked-By: NVinod Koul <vkoul@kernel.org>
Acked-By: NSinan Kaya <okaya@kernel.org>
Signed-off-by: NPhillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210503115736.2104747-52-gregkh@linuxfoundation.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 7da59a1e
...@@ -423,6 +423,20 @@ static int __init hidma_mgmt_init(void) ...@@ -423,6 +423,20 @@ static int __init hidma_mgmt_init(void)
hidma_mgmt_of_populate_channels(child); hidma_mgmt_of_populate_channels(child);
} }
#endif #endif
/*
* We do not check for return value here, as it is assumed that
* platform_driver_register must not fail. The reason for this is that
* the (potential) hidma_mgmt_of_populate_channels calls above are not
* cleaned up if it does fail, and to do this work is quite
* complicated. In particular, various calls of of_address_to_resource,
* of_irq_to_resource, platform_device_register_full, of_dma_configure,
* and of_msi_configure which then call other functions and so on, must
* be cleaned up - this is not a trivial exercise.
*
* Currently, this module is not intended to be unloaded, and there is
* no module_exit function defined which does the needed cleanup. For
* this reason, we have to assume success here.
*/
platform_driver_register(&hidma_mgmt_driver); platform_driver_register(&hidma_mgmt_driver);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册