>> diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c
>> index bf02225..ff64dd4 100644
>> --- a/drivers/power/ab8500_fg.c
>> +++ b/drivers/power/ab8500_fg.c
>> @@ -22,15 +22,16 @@
[...]
>>
>> #define MILLI_TO_MICRO 1000
>> #define FG_LSB_IN_MA 1627
>> @@ -212,7 +213,6 @@ struct ab8500_fg {
>> struct ab8500_fg_avg_cap avg_cap;
>> struct ab8500 *parent;
>> struct ab8500_gpadc *gpadc;
>> - struct abx500_fg_platform_data *pdata;
>> struct abx500_bm_data *bat;
>> struct power_supply fg_psy;
>> struct workqueue_struct *fg_wq;
>> @@ -2416,6 +2416,8 @@ static int __devexit ab8500_fg_remove(struct
>> platform_device *pdev)
>> int ret = 0;
>> struct ab8500_fg *di = platform_get_drvdata(pdev);
>>
>> + of_node_put(pdev->dev.of_node);
>
> This is wrong, the probe function doesn't increment the refcount of this
> node, so you don't have to decrement it here.
you hinted in one of your earlier comments as:
"
Also, if I'm not mistaken we have a leak here, because the refcount of
these nodes is never decremented, not even in the driver remove routine.
" while referring bmdevs_of_probe(..), nodes being referred,
np and np_bat_supply
Note:
I found 'refcount of kref' being 1 in case of node obtained from
probe() also through of_parse_phandle(...).
ref: struct device_node { kref kref }
Lee, any comments?
_______________________________________________
linaro-dev mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/linaro-dev