* [PATCH] omap2plus: smartreflex: remove sr debug directory in omap_sr_remove()
@ 2011-02-05 13:32 Anand S Sawant
2011-02-11 23:50 ` Kevin Hilman
0 siblings, 1 reply; 7+ messages in thread
From: Anand S Sawant @ 2011-02-05 13:32 UTC (permalink / raw)
To: linux-omap; +Cc: Anand S Sawant
omap_sr_probe() creates the smartreflex debug directory and its
underlying nvalue debug directory. These directories are removed in
omap_sr_remove().
Basic smartreflex functionality tested on OMAP3630 Zoom3 & OMAP4430 SDP
Signed-off-by: Anand S Sawant <sawant@ti.com>
---
arch/arm/mach-omap2/smartreflex.c | 24 ++++++++++++++----------
1 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index d7deadf..57df5cf 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -54,6 +54,7 @@ struct omap_sr {
struct list_head node;
struct omap_sr_nvalue_table *nvalue_table;
struct voltagedomain *voltdm;
+ struct dentry *dbg_dir;
};
/* sr_list contains all the instances of smartreflex module */
@@ -822,7 +823,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL);
struct omap_sr_data *pdata = pdev->dev.platform_data;
struct resource *mem, *irq;
- struct dentry *vdd_dbg_dir, *dbg_dir, *nvalue_dir;
+ struct dentry *vdd_dbg_dir, *nvalue_dir;
struct omap_volt_data *volt_data;
int i, ret = 0;
@@ -894,23 +895,24 @@ static int __init omap_sr_probe(struct platform_device *pdev)
if (!vdd_dbg_dir)
return -EINVAL;
- dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
- if (IS_ERR(dbg_dir)) {
+ sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
+ if (IS_ERR(sr_info->dbg_dir)) {
dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
__func__);
- return PTR_ERR(dbg_dir);
+ return PTR_ERR(sr_info->dbg_dir);
}
- (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUGO, dbg_dir,
- (void *)sr_info, &pm_sr_fops);
- (void) debugfs_create_x32("errweight", S_IRUGO, dbg_dir,
+ /* Using S_IWUSR to fix checkpatch warning */
+ (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR,
+ sr_info->dbg_dir, (void *)sr_info, &pm_sr_fops);
+ (void) debugfs_create_x32("errweight", S_IRUGO, sr_info->dbg_dir,
&sr_info->err_weight);
- (void) debugfs_create_x32("errmaxlimit", S_IRUGO, dbg_dir,
+ (void) debugfs_create_x32("errmaxlimit", S_IRUGO, sr_info->dbg_dir,
&sr_info->err_maxlimit);
- (void) debugfs_create_x32("errminlimit", S_IRUGO, dbg_dir,
+ (void) debugfs_create_x32("errminlimit", S_IRUGO, sr_info->dbg_dir,
&sr_info->err_minlimit);
- nvalue_dir = debugfs_create_dir("nvalue", dbg_dir);
+ nvalue_dir = debugfs_create_dir("nvalue", sr_info->dbg_dir);
if (IS_ERR(nvalue_dir)) {
dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
"for n-values\n", __func__);
@@ -974,6 +976,8 @@ static int __devexit omap_sr_remove(struct platform_device *pdev)
if (sr_info->autocomp_active)
sr_stop_vddautocomp(sr_info);
+ if (sr_info->dbg_dir)
+ debugfs_remove_recursive(sr_info->dbg_dir);
list_del(&sr_info->node);
iounmap(sr_info->base);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] omap2plus: smartreflex: remove sr debug directory in omap_sr_remove()
2011-02-05 13:32 [PATCH] omap2plus: smartreflex: remove sr debug directory in omap_sr_remove() Anand S Sawant
@ 2011-02-11 23:50 ` Kevin Hilman
2011-02-15 5:26 ` Sawant, Anand
0 siblings, 1 reply; 7+ messages in thread
From: Kevin Hilman @ 2011-02-11 23:50 UTC (permalink / raw)
To: Anand S Sawant; +Cc: linux-omap
Hi Anand,
Anand S Sawant <sawant@ti.com> writes:
> omap_sr_probe() creates the smartreflex debug directory and its
> underlying nvalue debug directory. These directories are removed in
> omap_sr_remove().
>
> Basic smartreflex functionality tested on OMAP3630 Zoom3 & OMAP4430 SDP
>
> Signed-off-by: Anand S Sawant <sawant@ti.com>
Looks good.
Please repost with the linux-arm-kernel list in CC:
linux-arm-kernel@lists.infradead.org. Thend, unless there are other
comments/objections, I'll queue this for 2.6.39.
Also, can summarize on which platforms this was tested. Just curious:
Were you able to build SR as a module to test this?
Kevin
> ---
> arch/arm/mach-omap2/smartreflex.c | 24 ++++++++++++++----------
> 1 files changed, 14 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
> index d7deadf..57df5cf 100644
> --- a/arch/arm/mach-omap2/smartreflex.c
> +++ b/arch/arm/mach-omap2/smartreflex.c
> @@ -54,6 +54,7 @@ struct omap_sr {
> struct list_head node;
> struct omap_sr_nvalue_table *nvalue_table;
> struct voltagedomain *voltdm;
> + struct dentry *dbg_dir;
> };
>
> /* sr_list contains all the instances of smartreflex module */
> @@ -822,7 +823,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
> struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL);
> struct omap_sr_data *pdata = pdev->dev.platform_data;
> struct resource *mem, *irq;
> - struct dentry *vdd_dbg_dir, *dbg_dir, *nvalue_dir;
> + struct dentry *vdd_dbg_dir, *nvalue_dir;
> struct omap_volt_data *volt_data;
> int i, ret = 0;
>
> @@ -894,23 +895,24 @@ static int __init omap_sr_probe(struct platform_device *pdev)
> if (!vdd_dbg_dir)
> return -EINVAL;
>
> - dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
> - if (IS_ERR(dbg_dir)) {
> + sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
> + if (IS_ERR(sr_info->dbg_dir)) {
> dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
> __func__);
> - return PTR_ERR(dbg_dir);
> + return PTR_ERR(sr_info->dbg_dir);
> }
>
> - (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUGO, dbg_dir,
> - (void *)sr_info, &pm_sr_fops);
> - (void) debugfs_create_x32("errweight", S_IRUGO, dbg_dir,
> + /* Using S_IWUSR to fix checkpatch warning */
> + (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR,
> + sr_info->dbg_dir, (void *)sr_info, &pm_sr_fops);
> + (void) debugfs_create_x32("errweight", S_IRUGO, sr_info->dbg_dir,
> &sr_info->err_weight);
> - (void) debugfs_create_x32("errmaxlimit", S_IRUGO, dbg_dir,
> + (void) debugfs_create_x32("errmaxlimit", S_IRUGO, sr_info->dbg_dir,
> &sr_info->err_maxlimit);
> - (void) debugfs_create_x32("errminlimit", S_IRUGO, dbg_dir,
> + (void) debugfs_create_x32("errminlimit", S_IRUGO, sr_info->dbg_dir,
> &sr_info->err_minlimit);
>
> - nvalue_dir = debugfs_create_dir("nvalue", dbg_dir);
> + nvalue_dir = debugfs_create_dir("nvalue", sr_info->dbg_dir);
> if (IS_ERR(nvalue_dir)) {
> dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
> "for n-values\n", __func__);
> @@ -974,6 +976,8 @@ static int __devexit omap_sr_remove(struct platform_device *pdev)
>
> if (sr_info->autocomp_active)
> sr_stop_vddautocomp(sr_info);
> + if (sr_info->dbg_dir)
> + debugfs_remove_recursive(sr_info->dbg_dir);
>
> list_del(&sr_info->node);
> iounmap(sr_info->base);
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] omap2plus: smartreflex: remove sr debug directory in omap_sr_remove()
2011-02-11 23:50 ` Kevin Hilman
@ 2011-02-15 5:26 ` Sawant, Anand
2011-02-15 16:06 ` Kevin Hilman
0 siblings, 1 reply; 7+ messages in thread
From: Sawant, Anand @ 2011-02-15 5:26 UTC (permalink / raw)
To: Kevin Hilman; +Cc: linux-omap
Kevin,
On Sat, Feb 12, 2011 at 5:20 AM, Kevin Hilman <khilman@ti.com> wrote:
> Hi Anand,
>
> Anand S Sawant <sawant@ti.com> writes:
>
>> omap_sr_probe() creates the smartreflex debug directory and its
>> underlying nvalue debug directory. These directories are removed in
>> omap_sr_remove().
>>
>> Basic smartreflex functionality tested on OMAP3630 Zoom3 & OMAP4430 SDP
>>
>> Signed-off-by: Anand S Sawant <sawant@ti.com>
>
> Looks good.
>
> Please repost with the linux-arm-kernel list in CC:
> linux-arm-kernel@lists.infradead.org. Thend, unless there are other
> comments/objections, I'll queue this for 2.6.39.
>
Thanks, will repost.
> Also, can summarize on which platforms this was tested.
I tested SR functionality at the default OPP on 3630 Zoom3 &
OMAP4430 SDP.
> Just curious:
> Were you able to build SR as a module to test this?
>
No.
Best Regards,
Anand S Sawant
> Kevin
>
>> ---
>> arch/arm/mach-omap2/smartreflex.c | 24 ++++++++++++++----------
>> 1 files changed, 14 insertions(+), 10 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
>> index d7deadf..57df5cf 100644
>> --- a/arch/arm/mach-omap2/smartreflex.c
>> +++ b/arch/arm/mach-omap2/smartreflex.c
>> @@ -54,6 +54,7 @@ struct omap_sr {
>> struct list_head node;
>> struct omap_sr_nvalue_table *nvalue_table;
>> struct voltagedomain *voltdm;
>> + struct dentry *dbg_dir;
>> };
>>
>> /* sr_list contains all the instances of smartreflex module */
>> @@ -822,7 +823,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>> struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL);
>> struct omap_sr_data *pdata = pdev->dev.platform_data;
>> struct resource *mem, *irq;
>> - struct dentry *vdd_dbg_dir, *dbg_dir, *nvalue_dir;
>> + struct dentry *vdd_dbg_dir, *nvalue_dir;
>> struct omap_volt_data *volt_data;
>> int i, ret = 0;
>>
>> @@ -894,23 +895,24 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>> if (!vdd_dbg_dir)
>> return -EINVAL;
>>
>> - dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
>> - if (IS_ERR(dbg_dir)) {
>> + sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
>> + if (IS_ERR(sr_info->dbg_dir)) {
>> dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
>> __func__);
>> - return PTR_ERR(dbg_dir);
>> + return PTR_ERR(sr_info->dbg_dir);
>> }
>>
>> - (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUGO, dbg_dir,
>> - (void *)sr_info, &pm_sr_fops);
>> - (void) debugfs_create_x32("errweight", S_IRUGO, dbg_dir,
>> + /* Using S_IWUSR to fix checkpatch warning */
>> + (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR,
>> + sr_info->dbg_dir, (void *)sr_info, &pm_sr_fops);
>> + (void) debugfs_create_x32("errweight", S_IRUGO, sr_info->dbg_dir,
>> &sr_info->err_weight);
>> - (void) debugfs_create_x32("errmaxlimit", S_IRUGO, dbg_dir,
>> + (void) debugfs_create_x32("errmaxlimit", S_IRUGO, sr_info->dbg_dir,
>> &sr_info->err_maxlimit);
>> - (void) debugfs_create_x32("errminlimit", S_IRUGO, dbg_dir,
>> + (void) debugfs_create_x32("errminlimit", S_IRUGO, sr_info->dbg_dir,
>> &sr_info->err_minlimit);
>>
>> - nvalue_dir = debugfs_create_dir("nvalue", dbg_dir);
>> + nvalue_dir = debugfs_create_dir("nvalue", sr_info->dbg_dir);
>> if (IS_ERR(nvalue_dir)) {
>> dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
>> "for n-values\n", __func__);
>> @@ -974,6 +976,8 @@ static int __devexit omap_sr_remove(struct platform_device *pdev)
>>
>> if (sr_info->autocomp_active)
>> sr_stop_vddautocomp(sr_info);
>> + if (sr_info->dbg_dir)
>> + debugfs_remove_recursive(sr_info->dbg_dir);
>>
>> list_del(&sr_info->node);
>> iounmap(sr_info->base);
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] omap2plus: smartreflex: remove sr debug directory in omap_sr_remove()
2011-02-15 5:26 ` Sawant, Anand
@ 2011-02-15 16:06 ` Kevin Hilman
2011-02-17 16:09 ` Sawant, Anand
0 siblings, 1 reply; 7+ messages in thread
From: Kevin Hilman @ 2011-02-15 16:06 UTC (permalink / raw)
To: Sawant, Anand; +Cc: linux-omap
"Sawant, Anand" <sawant@ti.com> writes:
> Kevin,
>
> On Sat, Feb 12, 2011 at 5:20 AM, Kevin Hilman <khilman@ti.com> wrote:
>> Hi Anand,
>>
>> Anand S Sawant <sawant@ti.com> writes:
>>
>>> omap_sr_probe() creates the smartreflex debug directory and its
>>> underlying nvalue debug directory. These directories are removed in
>>> omap_sr_remove().
>>>
>>> Basic smartreflex functionality tested on OMAP3630 Zoom3 & OMAP4430 SDP
>>>
>>> Signed-off-by: Anand S Sawant <sawant@ti.com>
>>
>> Looks good.
>>
>> Please repost with the linux-arm-kernel list in CC:
>> linux-arm-kernel@lists.infradead.org. Thend, unless there are other
>> comments/objections, I'll queue this for 2.6.39.
>>
>
> Thanks, will repost.
>
>> Also, can summarize on which platforms this was tested.
>
> I tested SR functionality at the default OPP on 3630 Zoom3 &
> OMAP4430 SDP.
What I was wondering is how you tested the functionality of the changes
you made, namely the sr-remove path.
Kevin
>> Just curious:
>> Were you able to build SR as a module to test this?
>>
>
> No.
>
> Best Regards,
>
> Anand S Sawant
>> Kevin
>>
>>> ---
>>> arch/arm/mach-omap2/smartreflex.c | 24 ++++++++++++++----------
>>> 1 files changed, 14 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
>>> index d7deadf..57df5cf 100644
>>> --- a/arch/arm/mach-omap2/smartreflex.c
>>> +++ b/arch/arm/mach-omap2/smartreflex.c
>>> @@ -54,6 +54,7 @@ struct omap_sr {
>>> struct list_head node;
>>> struct omap_sr_nvalue_table *nvalue_table;
>>> struct voltagedomain *voltdm;
>>> + struct dentry *dbg_dir;
>>> };
>>>
>>> /* sr_list contains all the instances of smartreflex module */
>>> @@ -822,7 +823,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>>> struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL);
>>> struct omap_sr_data *pdata = pdev->dev.platform_data;
>>> struct resource *mem, *irq;
>>> - struct dentry *vdd_dbg_dir, *dbg_dir, *nvalue_dir;
>>> + struct dentry *vdd_dbg_dir, *nvalue_dir;
>>> struct omap_volt_data *volt_data;
>>> int i, ret = 0;
>>>
>>> @@ -894,23 +895,24 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>>> if (!vdd_dbg_dir)
>>> return -EINVAL;
>>>
>>> - dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
>>> - if (IS_ERR(dbg_dir)) {
>>> + sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
>>> + if (IS_ERR(sr_info->dbg_dir)) {
>>> dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
>>> __func__);
>>> - return PTR_ERR(dbg_dir);
>>> + return PTR_ERR(sr_info->dbg_dir);
>>> }
>>>
>>> - (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUGO, dbg_dir,
>>> - (void *)sr_info, &pm_sr_fops);
>>> - (void) debugfs_create_x32("errweight", S_IRUGO, dbg_dir,
>>> + /* Using S_IWUSR to fix checkpatch warning */
>>> + (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR,
>>> + sr_info->dbg_dir, (void *)sr_info, &pm_sr_fops);
>>> + (void) debugfs_create_x32("errweight", S_IRUGO, sr_info->dbg_dir,
>>> &sr_info->err_weight);
>>> - (void) debugfs_create_x32("errmaxlimit", S_IRUGO, dbg_dir,
>>> + (void) debugfs_create_x32("errmaxlimit", S_IRUGO, sr_info->dbg_dir,
>>> &sr_info->err_maxlimit);
>>> - (void) debugfs_create_x32("errminlimit", S_IRUGO, dbg_dir,
>>> + (void) debugfs_create_x32("errminlimit", S_IRUGO, sr_info->dbg_dir,
>>> &sr_info->err_minlimit);
>>>
>>> - nvalue_dir = debugfs_create_dir("nvalue", dbg_dir);
>>> + nvalue_dir = debugfs_create_dir("nvalue", sr_info->dbg_dir);
>>> if (IS_ERR(nvalue_dir)) {
>>> dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
>>> "for n-values\n", __func__);
>>> @@ -974,6 +976,8 @@ static int __devexit omap_sr_remove(struct platform_device *pdev)
>>>
>>> if (sr_info->autocomp_active)
>>> sr_stop_vddautocomp(sr_info);
>>> + if (sr_info->dbg_dir)
>>> + debugfs_remove_recursive(sr_info->dbg_dir);
>>>
>>> list_del(&sr_info->node);
>>> iounmap(sr_info->base);
>>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] omap2plus: smartreflex: remove sr debug directory in omap_sr_remove()
2011-02-15 16:06 ` Kevin Hilman
@ 2011-02-17 16:09 ` Sawant, Anand
0 siblings, 0 replies; 7+ messages in thread
From: Sawant, Anand @ 2011-02-17 16:09 UTC (permalink / raw)
To: Kevin Hilman; +Cc: linux-omap
Kevin,
On Tue, Feb 15, 2011 at 9:36 PM, Kevin Hilman <khilman@ti.com> wrote:
> "Sawant, Anand" <sawant@ti.com> writes:
>
>> Kevin,
>>
>> On Sat, Feb 12, 2011 at 5:20 AM, Kevin Hilman <khilman@ti.com> wrote:
>>> Hi Anand,
>>>
>>> Anand S Sawant <sawant@ti.com> writes:
>>>
>>>> omap_sr_probe() creates the smartreflex debug directory and its
>>>> underlying nvalue debug directory. These directories are removed in
>>>> omap_sr_remove().
>>>>
>>>> Basic smartreflex functionality tested on OMAP3630 Zoom3 & OMAP4430 SDP
>>>>
>>>> Signed-off-by: Anand S Sawant <sawant@ti.com>
>>>
>>> Looks good.
>>>
>>> Please repost with the linux-arm-kernel list in CC:
>>> linux-arm-kernel@lists.infradead.org. Thend, unless there are other
>>> comments/objections, I'll queue this for 2.6.39.
>>>
>>
>> Thanks, will repost.
>>
>>> Also, can summarize on which platforms this was tested.
>>
>> I tested SR functionality at the default OPP on 3630 Zoom3 &
>> OMAP4430 SDP.
>
> What I was wondering is how you tested the functionality of the changes
> you made, namely the sr-remove path.
>
Since SR is not built as a module, I explicitly invoked omap_sr_remove() at
the end of omap_sr_probe(). Through a message print, I confirmed that
debugfs_remove_recursive() was getting called successfully.
The rest of the changes get tested when the smartreflex and nvalue debug
directories are created successfully and smartreflex functionality works at
the default OPP.
Best Regards,
Anand
> Kevin
>
>>> Just curious:
>>> Were you able to build SR as a module to test this?
>>>
>>
>> No.
>>
>> Best Regards,
>>
>> Anand S Sawant
>>> Kevin
>>>
>>>> ---
>>>> arch/arm/mach-omap2/smartreflex.c | 24 ++++++++++++++----------
>>>> 1 files changed, 14 insertions(+), 10 deletions(-)
>>>>
>>>> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
>>>> index d7deadf..57df5cf 100644
>>>> --- a/arch/arm/mach-omap2/smartreflex.c
>>>> +++ b/arch/arm/mach-omap2/smartreflex.c
>>>> @@ -54,6 +54,7 @@ struct omap_sr {
>>>> struct list_head node;
>>>> struct omap_sr_nvalue_table *nvalue_table;
>>>> struct voltagedomain *voltdm;
>>>> + struct dentry *dbg_dir;
>>>> };
>>>>
>>>> /* sr_list contains all the instances of smartreflex module */
>>>> @@ -822,7 +823,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>>>> struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL);
>>>> struct omap_sr_data *pdata = pdev->dev.platform_data;
>>>> struct resource *mem, *irq;
>>>> - struct dentry *vdd_dbg_dir, *dbg_dir, *nvalue_dir;
>>>> + struct dentry *vdd_dbg_dir, *nvalue_dir;
>>>> struct omap_volt_data *volt_data;
>>>> int i, ret = 0;
>>>>
>>>> @@ -894,23 +895,24 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>>>> if (!vdd_dbg_dir)
>>>> return -EINVAL;
>>>>
>>>> - dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
>>>> - if (IS_ERR(dbg_dir)) {
>>>> + sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
>>>> + if (IS_ERR(sr_info->dbg_dir)) {
>>>> dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
>>>> __func__);
>>>> - return PTR_ERR(dbg_dir);
>>>> + return PTR_ERR(sr_info->dbg_dir);
>>>> }
>>>>
>>>> - (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUGO, dbg_dir,
>>>> - (void *)sr_info, &pm_sr_fops);
>>>> - (void) debugfs_create_x32("errweight", S_IRUGO, dbg_dir,
>>>> + /* Using S_IWUSR to fix checkpatch warning */
>>>> + (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR,
>>>> + sr_info->dbg_dir, (void *)sr_info, &pm_sr_fops);
>>>> + (void) debugfs_create_x32("errweight", S_IRUGO, sr_info->dbg_dir,
>>>> &sr_info->err_weight);
>>>> - (void) debugfs_create_x32("errmaxlimit", S_IRUGO, dbg_dir,
>>>> + (void) debugfs_create_x32("errmaxlimit", S_IRUGO, sr_info->dbg_dir,
>>>> &sr_info->err_maxlimit);
>>>> - (void) debugfs_create_x32("errminlimit", S_IRUGO, dbg_dir,
>>>> + (void) debugfs_create_x32("errminlimit", S_IRUGO, sr_info->dbg_dir,
>>>> &sr_info->err_minlimit);
>>>>
>>>> - nvalue_dir = debugfs_create_dir("nvalue", dbg_dir);
>>>> + nvalue_dir = debugfs_create_dir("nvalue", sr_info->dbg_dir);
>>>> if (IS_ERR(nvalue_dir)) {
>>>> dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
>>>> "for n-values\n", __func__);
>>>> @@ -974,6 +976,8 @@ static int __devexit omap_sr_remove(struct platform_device *pdev)
>>>>
>>>> if (sr_info->autocomp_active)
>>>> sr_stop_vddautocomp(sr_info);
>>>> + if (sr_info->dbg_dir)
>>>> + debugfs_remove_recursive(sr_info->dbg_dir);
>>>>
>>>> list_del(&sr_info->node);
>>>> iounmap(sr_info->base);
>>>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] omap2plus: smartreflex: remove sr debug directory in omap_sr_remove()
@ 2011-02-17 15:57 sawant
2011-03-09 23:42 ` Kevin Hilman
0 siblings, 1 reply; 7+ messages in thread
From: sawant @ 2011-02-17 15:57 UTC (permalink / raw)
To: linux-omap; +Cc: linux-arm-kernel, Anand S Sawant
From: Anand S Sawant <sawant@ti.com>
omap_sr_probe() creates the smartreflex debug directory and its
underlying nvalue debug directory. These directories are removed in
omap_sr_remove().
Basic smartreflex functionality tested on OMAP3630 Zoom3 & OMAP4430 SDP
Signed-off-by: Anand S Sawant <sawant@ti.com>
---
Rebased on the latest Kevin's pm branch
(commit id: b6fb54bc4bfc396a9b982d76c1c954c974290a1a)
arch/arm/mach-omap2/smartreflex.c | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index a1f532e..dc19f17 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -54,6 +54,7 @@ struct omap_sr {
struct list_head node;
struct omap_sr_nvalue_table *nvalue_table;
struct voltagedomain *voltdm;
+ struct dentry *dbg_dir;
};
/* sr_list contains all the instances of smartreflex module */
@@ -822,7 +823,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL);
struct omap_sr_data *pdata = pdev->dev.platform_data;
struct resource *mem, *irq;
- struct dentry *vdd_dbg_dir, *dbg_dir, *nvalue_dir;
+ struct dentry *vdd_dbg_dir, *nvalue_dir;
struct omap_volt_data *volt_data;
int i, ret = 0;
@@ -895,23 +896,23 @@ static int __init omap_sr_probe(struct platform_device *pdev)
if (!vdd_dbg_dir)
return -EINVAL;
- dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
- if (IS_ERR(dbg_dir)) {
+ sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
+ if (IS_ERR(sr_info->dbg_dir)) {
dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
__func__);
- return PTR_ERR(dbg_dir);
+ return PTR_ERR(sr_info->dbg_dir);
}
- (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, dbg_dir,
- (void *)sr_info, &pm_sr_fops);
- (void) debugfs_create_x32("errweight", S_IRUGO, dbg_dir,
+ (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR,
+ sr_info->dbg_dir, (void *)sr_info, &pm_sr_fops);
+ (void) debugfs_create_x32("errweight", S_IRUGO, sr_info->dbg_dir,
&sr_info->err_weight);
- (void) debugfs_create_x32("errmaxlimit", S_IRUGO, dbg_dir,
+ (void) debugfs_create_x32("errmaxlimit", S_IRUGO, sr_info->dbg_dir,
&sr_info->err_maxlimit);
- (void) debugfs_create_x32("errminlimit", S_IRUGO, dbg_dir,
+ (void) debugfs_create_x32("errminlimit", S_IRUGO, sr_info->dbg_dir,
&sr_info->err_minlimit);
- nvalue_dir = debugfs_create_dir("nvalue", dbg_dir);
+ nvalue_dir = debugfs_create_dir("nvalue", sr_info->dbg_dir);
if (IS_ERR(nvalue_dir)) {
dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
"for n-values\n", __func__);
@@ -975,6 +976,8 @@ static int __devexit omap_sr_remove(struct platform_device *pdev)
if (sr_info->autocomp_active)
sr_stop_vddautocomp(sr_info);
+ if (sr_info->dbg_dir)
+ debugfs_remove_recursive(sr_info->dbg_dir);
list_del(&sr_info->node);
iounmap(sr_info->base);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] omap2plus: smartreflex: remove sr debug directory in omap_sr_remove()
2011-02-17 15:57 sawant
@ 2011-03-09 23:42 ` Kevin Hilman
0 siblings, 0 replies; 7+ messages in thread
From: Kevin Hilman @ 2011-03-09 23:42 UTC (permalink / raw)
To: sawant; +Cc: linux-omap, linux-arm-kernel
sawant@ti.com writes:
> From: Anand S Sawant <sawant@ti.com>
>
> omap_sr_probe() creates the smartreflex debug directory and its
> underlying nvalue debug directory. These directories are removed in
> omap_sr_remove().
>
> Basic smartreflex functionality tested on OMAP3630 Zoom3 & OMAP4430 SDP
>
> Signed-off-by: Anand S Sawant <sawant@ti.com>
Thanks, queuing for 2.6.39 (branch: for_2.6.39/pm-misc)
Kevin
> ---
> Rebased on the latest Kevin's pm branch
> (commit id: b6fb54bc4bfc396a9b982d76c1c954c974290a1a)
>
> arch/arm/mach-omap2/smartreflex.c | 23 +++++++++++++----------
> 1 files changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
> index a1f532e..dc19f17 100644
> --- a/arch/arm/mach-omap2/smartreflex.c
> +++ b/arch/arm/mach-omap2/smartreflex.c
> @@ -54,6 +54,7 @@ struct omap_sr {
> struct list_head node;
> struct omap_sr_nvalue_table *nvalue_table;
> struct voltagedomain *voltdm;
> + struct dentry *dbg_dir;
> };
>
> /* sr_list contains all the instances of smartreflex module */
> @@ -822,7 +823,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
> struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL);
> struct omap_sr_data *pdata = pdev->dev.platform_data;
> struct resource *mem, *irq;
> - struct dentry *vdd_dbg_dir, *dbg_dir, *nvalue_dir;
> + struct dentry *vdd_dbg_dir, *nvalue_dir;
> struct omap_volt_data *volt_data;
> int i, ret = 0;
>
> @@ -895,23 +896,23 @@ static int __init omap_sr_probe(struct platform_device *pdev)
> if (!vdd_dbg_dir)
> return -EINVAL;
>
> - dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
> - if (IS_ERR(dbg_dir)) {
> + sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
> + if (IS_ERR(sr_info->dbg_dir)) {
> dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
> __func__);
> - return PTR_ERR(dbg_dir);
> + return PTR_ERR(sr_info->dbg_dir);
> }
>
> - (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, dbg_dir,
> - (void *)sr_info, &pm_sr_fops);
> - (void) debugfs_create_x32("errweight", S_IRUGO, dbg_dir,
> + (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR,
> + sr_info->dbg_dir, (void *)sr_info, &pm_sr_fops);
> + (void) debugfs_create_x32("errweight", S_IRUGO, sr_info->dbg_dir,
> &sr_info->err_weight);
> - (void) debugfs_create_x32("errmaxlimit", S_IRUGO, dbg_dir,
> + (void) debugfs_create_x32("errmaxlimit", S_IRUGO, sr_info->dbg_dir,
> &sr_info->err_maxlimit);
> - (void) debugfs_create_x32("errminlimit", S_IRUGO, dbg_dir,
> + (void) debugfs_create_x32("errminlimit", S_IRUGO, sr_info->dbg_dir,
> &sr_info->err_minlimit);
>
> - nvalue_dir = debugfs_create_dir("nvalue", dbg_dir);
> + nvalue_dir = debugfs_create_dir("nvalue", sr_info->dbg_dir);
> if (IS_ERR(nvalue_dir)) {
> dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
> "for n-values\n", __func__);
> @@ -975,6 +976,8 @@ static int __devexit omap_sr_remove(struct platform_device *pdev)
>
> if (sr_info->autocomp_active)
> sr_stop_vddautocomp(sr_info);
> + if (sr_info->dbg_dir)
> + debugfs_remove_recursive(sr_info->dbg_dir);
>
> list_del(&sr_info->node);
> iounmap(sr_info->base);
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-03-09 23:42 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-05 13:32 [PATCH] omap2plus: smartreflex: remove sr debug directory in omap_sr_remove() Anand S Sawant
2011-02-11 23:50 ` Kevin Hilman
2011-02-15 5:26 ` Sawant, Anand
2011-02-15 16:06 ` Kevin Hilman
2011-02-17 16:09 ` Sawant, Anand
-- strict thread matches above, loose matches on Subject: below --
2011-02-17 15:57 sawant
2011-03-09 23:42 ` Kevin Hilman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox