lkml.org 
[lkml]   [2019]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 5/5] interconnect: qcom: Use the new common helper for node removal
From
Date
On 28.11.19 г. 15:43 ч., Dmitry Osipenko wrote:
> 28.11.2019 16:34, Georgi Djakov пишет:
>> There is a new helper function for removing all nodes. Let's use it instead
>> of duplicating the code.
>>
>> In addition to the above, instead of duplicating the code, simplify the
>> probe function error path by calling driver removal function directly.
>>
>> Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
>> ---
>> drivers/interconnect/qcom/msm8974.c | 40 ++++++++++-------------------
>> drivers/interconnect/qcom/qcs404.c | 31 ++++++++--------------
>> drivers/interconnect/qcom/sdm845.c | 29 +++++++--------------
>> 3 files changed, 33 insertions(+), 67 deletions(-)
>>
[..]>> +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);
>> +}
>> +
>> static int qnoc_probe(struct platform_device *pdev)
>> {
>> const struct qcom_icc_desc *desc;
>> @@ -855,29 +863,10 @@ static int qnoc_probe(struct platform_device *pdev)
>>
>> return ret;
>> err:
>> - list_for_each_entry(node, &provider->nodes, node_list) {
>> - icc_node_del(node);
>> - icc_node_destroy(node->id);
>> - }
>> -
>> - icc_provider_del(provider);
>> + qnoc_remove(pdev);
>
> This is wrong because platform_set_drvdata() is invoked at the end of
> qnoc_probe(), thus platform_get_drvdata() of qnoc_remove() returns NULL
> here.

True! Will fix it! Thank you!

BR,
Georgi

\
 
 \ /
  Last update: 2019-11-28 14:52    [W:0.038 / U:1.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site