Re: [PATCH] ARM: OMAP3+: PM debug: fix the use of debugfs_create_* API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kevin,

On Tue, Jan 31, 2012 at 6:44 PM, Kevin Hilman <khilman@xxxxxx> wrote:
> Jean Pihet <jean.pihet@xxxxxxxxxxxxxx> writes:
>
>> The debugfs_create_* API returns a NULL ptr in case of problem.
>> Fix the PM debug code to take this into account.
>>
>> Signed-off-by: Jean Pihet <j-pihet@xxxxxx>
>> ---
>>  arch/arm/mach-omap2/pm-debug.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
>> index 4411163..e5bf367 100644
>> --- a/arch/arm/mach-omap2/pm-debug.c
>> +++ b/arch/arm/mach-omap2/pm-debug.c
>> @@ -264,8 +264,8 @@ static int __init pm_dbg_init(void)
>>               return 0;
>>
>>       d = debugfs_create_dir("pm_debug", NULL);
>> -     if (IS_ERR(d))
>> -             return PTR_ERR(d);
>> +     if (!d)
>
> I think this should be IS_ERR_OR_NULL() because this function can also
> return ERR_PTR(-ENODEV).  (Yes, only when debugfs is not enabled, but
> it's still more correct.)
That makes sense, even if the PM debug code is enclosed by #ifdef
CONFIG_DEBUG_FS.
I have a new version of the patch, it also fixes another potential
problem with debugfs.

Thanks,
Jean

>
> Kevin
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux