mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
perf: hisilicon: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/33a8be0641b9447469fb7f6af0a10fb65efa97a3.1702648125.git.u.kleine-koenig@pengutronix.de Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
parent
78da2a93b5
commit
e07486a832
@ -341,7 +341,7 @@ static int hisi_cpa_pmu_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int hisi_cpa_pmu_remove(struct platform_device *pdev)
|
||||
static void hisi_cpa_pmu_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct hisi_pmu *cpa_pmu = platform_get_drvdata(pdev);
|
||||
|
||||
@ -349,7 +349,6 @@ static int hisi_cpa_pmu_remove(struct platform_device *pdev)
|
||||
cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HISI_CPA_ONLINE,
|
||||
&cpa_pmu->node);
|
||||
hisi_cpa_pmu_enable_pm(cpa_pmu);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver hisi_cpa_pmu_driver = {
|
||||
@ -359,7 +358,7 @@ static struct platform_driver hisi_cpa_pmu_driver = {
|
||||
.suppress_bind_attrs = true,
|
||||
},
|
||||
.probe = hisi_cpa_pmu_probe,
|
||||
.remove = hisi_cpa_pmu_remove,
|
||||
.remove_new = hisi_cpa_pmu_remove,
|
||||
};
|
||||
|
||||
static int __init hisi_cpa_pmu_module_init(void)
|
||||
|
@ -531,14 +531,13 @@ static int hisi_ddrc_pmu_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int hisi_ddrc_pmu_remove(struct platform_device *pdev)
|
||||
static void hisi_ddrc_pmu_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct hisi_pmu *ddrc_pmu = platform_get_drvdata(pdev);
|
||||
|
||||
perf_pmu_unregister(&ddrc_pmu->pmu);
|
||||
cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HISI_DDRC_ONLINE,
|
||||
&ddrc_pmu->node);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver hisi_ddrc_pmu_driver = {
|
||||
@ -548,7 +547,7 @@ static struct platform_driver hisi_ddrc_pmu_driver = {
|
||||
.suppress_bind_attrs = true,
|
||||
},
|
||||
.probe = hisi_ddrc_pmu_probe,
|
||||
.remove = hisi_ddrc_pmu_remove,
|
||||
.remove_new = hisi_ddrc_pmu_remove,
|
||||
};
|
||||
|
||||
static int __init hisi_ddrc_pmu_module_init(void)
|
||||
|
@ -534,14 +534,13 @@ static int hisi_hha_pmu_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int hisi_hha_pmu_remove(struct platform_device *pdev)
|
||||
static void hisi_hha_pmu_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct hisi_pmu *hha_pmu = platform_get_drvdata(pdev);
|
||||
|
||||
perf_pmu_unregister(&hha_pmu->pmu);
|
||||
cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HISI_HHA_ONLINE,
|
||||
&hha_pmu->node);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver hisi_hha_pmu_driver = {
|
||||
@ -551,7 +550,7 @@ static struct platform_driver hisi_hha_pmu_driver = {
|
||||
.suppress_bind_attrs = true,
|
||||
},
|
||||
.probe = hisi_hha_pmu_probe,
|
||||
.remove = hisi_hha_pmu_remove,
|
||||
.remove_new = hisi_hha_pmu_remove,
|
||||
};
|
||||
|
||||
static int __init hisi_hha_pmu_module_init(void)
|
||||
|
@ -568,14 +568,13 @@ static int hisi_l3c_pmu_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int hisi_l3c_pmu_remove(struct platform_device *pdev)
|
||||
static void hisi_l3c_pmu_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct hisi_pmu *l3c_pmu = platform_get_drvdata(pdev);
|
||||
|
||||
perf_pmu_unregister(&l3c_pmu->pmu);
|
||||
cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HISI_L3_ONLINE,
|
||||
&l3c_pmu->node);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver hisi_l3c_pmu_driver = {
|
||||
@ -585,7 +584,7 @@ static struct platform_driver hisi_l3c_pmu_driver = {
|
||||
.suppress_bind_attrs = true,
|
||||
},
|
||||
.probe = hisi_l3c_pmu_probe,
|
||||
.remove = hisi_l3c_pmu_remove,
|
||||
.remove_new = hisi_l3c_pmu_remove,
|
||||
};
|
||||
|
||||
static int __init hisi_l3c_pmu_module_init(void)
|
||||
|
@ -514,14 +514,13 @@ static int hisi_pa_pmu_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int hisi_pa_pmu_remove(struct platform_device *pdev)
|
||||
static void hisi_pa_pmu_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct hisi_pmu *pa_pmu = platform_get_drvdata(pdev);
|
||||
|
||||
perf_pmu_unregister(&pa_pmu->pmu);
|
||||
cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HISI_PA_ONLINE,
|
||||
&pa_pmu->node);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct acpi_device_id hisi_pa_pmu_acpi_match[] = {
|
||||
@ -539,7 +538,7 @@ static struct platform_driver hisi_pa_pmu_driver = {
|
||||
.suppress_bind_attrs = true,
|
||||
},
|
||||
.probe = hisi_pa_pmu_probe,
|
||||
.remove = hisi_pa_pmu_remove,
|
||||
.remove_new = hisi_pa_pmu_remove,
|
||||
};
|
||||
|
||||
static int __init hisi_pa_pmu_module_init(void)
|
||||
|
@ -460,14 +460,13 @@ static int hisi_sllc_pmu_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int hisi_sllc_pmu_remove(struct platform_device *pdev)
|
||||
static void hisi_sllc_pmu_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct hisi_pmu *sllc_pmu = platform_get_drvdata(pdev);
|
||||
|
||||
perf_pmu_unregister(&sllc_pmu->pmu);
|
||||
cpuhp_state_remove_instance_nocalls(CPUHP_AP_PERF_ARM_HISI_SLLC_ONLINE,
|
||||
&sllc_pmu->node);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver hisi_sllc_pmu_driver = {
|
||||
@ -477,7 +476,7 @@ static struct platform_driver hisi_sllc_pmu_driver = {
|
||||
.suppress_bind_attrs = true,
|
||||
},
|
||||
.probe = hisi_sllc_pmu_probe,
|
||||
.remove = hisi_sllc_pmu_remove,
|
||||
.remove_new = hisi_sllc_pmu_remove,
|
||||
};
|
||||
|
||||
static int __init hisi_sllc_pmu_module_init(void)
|
||||
|
Loading…
Reference in New Issue
Block a user