forked from Minki/linux
Merge branch 'icc-ignore-return-val' into icc-next
Today remove callbacks of platform devices return an int. This is unfortunate because the device core ignores the return value and so the platform code only emits a warning (and still removes the device). The longterm quest is to make these remove callbacks return void instead. This series is a preparation for that, with the goal to make the remove callbacks obviously always return 0. This way when the prototype of these functions is changed to return void, the change is straight forward and easy to review. Link: https://lore.kernel.org/r/20220718121409.171773-1-u.kleine-koenig@pengutronix.de Signed-off-by: Georgi Djakov <djakov@kernel.org>
This commit is contained in:
commit
7360d55ba1
@ -1057,29 +1057,25 @@ EXPORT_SYMBOL_GPL(icc_provider_add);
|
||||
/**
|
||||
* icc_provider_del() - delete previously added interconnect provider
|
||||
* @provider: the interconnect provider that will be removed from topology
|
||||
*
|
||||
* Return: 0 on success, or an error code otherwise
|
||||
*/
|
||||
int icc_provider_del(struct icc_provider *provider)
|
||||
void icc_provider_del(struct icc_provider *provider)
|
||||
{
|
||||
mutex_lock(&icc_lock);
|
||||
if (provider->users) {
|
||||
pr_warn("interconnect provider still has %d users\n",
|
||||
provider->users);
|
||||
mutex_unlock(&icc_lock);
|
||||
return -EBUSY;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!list_empty(&provider->nodes)) {
|
||||
pr_warn("interconnect provider still has nodes\n");
|
||||
mutex_unlock(&icc_lock);
|
||||
return -EBUSY;
|
||||
return;
|
||||
}
|
||||
|
||||
list_del(&provider->provider_list);
|
||||
mutex_unlock(&icc_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(icc_provider_del);
|
||||
|
||||
|
@ -324,13 +324,13 @@ provider_del:
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(imx_icc_register);
|
||||
|
||||
int imx_icc_unregister(struct platform_device *pdev)
|
||||
void imx_icc_unregister(struct platform_device *pdev)
|
||||
{
|
||||
struct imx_icc_provider *imx_provider = platform_get_drvdata(pdev);
|
||||
|
||||
imx_icc_unregister_nodes(&imx_provider->provider);
|
||||
|
||||
return icc_provider_del(&imx_provider->provider);
|
||||
icc_provider_del(&imx_provider->provider);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(imx_icc_unregister);
|
||||
|
||||
|
@ -103,6 +103,6 @@ int imx_icc_register(struct platform_device *pdev,
|
||||
struct imx_icc_node_desc *nodes,
|
||||
int nodes_count,
|
||||
struct imx_icc_noc_setting *noc_settings);
|
||||
int imx_icc_unregister(struct platform_device *pdev);
|
||||
void imx_icc_unregister(struct platform_device *pdev);
|
||||
|
||||
#endif /* __DRIVERS_INTERCONNECT_IMX_H */
|
||||
|
@ -88,7 +88,9 @@ static int imx8mm_icc_probe(struct platform_device *pdev)
|
||||
|
||||
static int imx8mm_icc_remove(struct platform_device *pdev)
|
||||
{
|
||||
return imx_icc_unregister(pdev);
|
||||
imx_icc_unregister(pdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver imx8mm_icc_driver = {
|
||||
|
@ -77,7 +77,9 @@ static int imx8mn_icc_probe(struct platform_device *pdev)
|
||||
|
||||
static int imx8mn_icc_remove(struct platform_device *pdev)
|
||||
{
|
||||
return imx_icc_unregister(pdev);
|
||||
imx_icc_unregister(pdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver imx8mn_icc_driver = {
|
||||
|
@ -242,7 +242,9 @@ static int imx8mp_icc_probe(struct platform_device *pdev)
|
||||
|
||||
static int imx8mp_icc_remove(struct platform_device *pdev)
|
||||
{
|
||||
return imx_icc_unregister(pdev);
|
||||
imx_icc_unregister(pdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver imx8mp_icc_driver = {
|
||||
|
@ -87,7 +87,9 @@ static int imx8mq_icc_probe(struct platform_device *pdev)
|
||||
|
||||
static int imx8mq_icc_remove(struct platform_device *pdev)
|
||||
{
|
||||
return imx_icc_unregister(pdev);
|
||||
imx_icc_unregister(pdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver imx8mq_icc_driver = {
|
||||
|
@ -563,6 +563,8 @@ int qnoc_remove(struct platform_device *pdev)
|
||||
|
||||
icc_nodes_remove(&qp->provider);
|
||||
clk_bulk_disable_unprepare(qp->num_clks, qp->bus_clks);
|
||||
return icc_provider_del(&qp->provider);
|
||||
icc_provider_del(&qp->provider);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(qnoc_remove);
|
||||
|
@ -251,7 +251,9 @@ int qcom_icc_rpmh_remove(struct platform_device *pdev)
|
||||
struct qcom_icc_provider *qp = platform_get_drvdata(pdev);
|
||||
|
||||
icc_nodes_remove(&qp->provider);
|
||||
return icc_provider_del(&qp->provider);
|
||||
icc_provider_del(&qp->provider);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(qcom_icc_rpmh_remove);
|
||||
|
||||
|
@ -749,7 +749,9 @@ static int msm8974_icc_remove(struct platform_device *pdev)
|
||||
|
||||
icc_nodes_remove(&qp->provider);
|
||||
clk_bulk_disable_unprepare(qp->num_clks, qp->bus_clks);
|
||||
return icc_provider_del(&qp->provider);
|
||||
icc_provider_del(&qp->provider);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id msm8974_noc_of_match[] = {
|
||||
|
@ -217,7 +217,9 @@ static int qcom_osm_l3_remove(struct platform_device *pdev)
|
||||
struct qcom_osm_l3_icc_provider *qp = platform_get_drvdata(pdev);
|
||||
|
||||
icc_nodes_remove(&qp->provider);
|
||||
return icc_provider_del(&qp->provider);
|
||||
icc_provider_del(&qp->provider);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int qcom_osm_l3_probe(struct platform_device *pdev)
|
||||
|
@ -1933,7 +1933,9 @@ static int qnoc_remove(struct platform_device *pdev)
|
||||
struct qcom_icc_provider *qp = platform_get_drvdata(pdev);
|
||||
|
||||
icc_nodes_remove(&qp->provider);
|
||||
return icc_provider_del(&qp->provider);
|
||||
icc_provider_del(&qp->provider);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id qnoc_of_match[] = {
|
||||
|
@ -123,7 +123,7 @@ void icc_node_add(struct icc_node *node, struct icc_provider *provider);
|
||||
void icc_node_del(struct icc_node *node);
|
||||
int icc_nodes_remove(struct icc_provider *provider);
|
||||
int icc_provider_add(struct icc_provider *provider);
|
||||
int icc_provider_del(struct icc_provider *provider);
|
||||
void icc_provider_del(struct icc_provider *provider);
|
||||
struct icc_node_data *of_icc_get_from_provider(struct of_phandle_args *spec);
|
||||
void icc_sync_state(struct device *dev);
|
||||
|
||||
@ -172,9 +172,8 @@ static inline int icc_provider_add(struct icc_provider *provider)
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
static inline int icc_provider_del(struct icc_provider *provider)
|
||||
static inline void icc_provider_del(struct icc_provider *provider)
|
||||
{
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
static inline struct icc_node_data *of_icc_get_from_provider(struct of_phandle_args *spec)
|
||||
|
Loading…
Reference in New Issue
Block a user