All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: "Vishwanathrao Badarkhe, Manish" <manishv.b@ti.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-omap@vger.kernel.org
Cc: khilman@kernel.org, anton@enomsg.org, dwmw2@infradead.org
Subject: Re: [PATCH] PM/AVS: SmartReflex: fix fake probe success on debugfs fail
Date: Wed, 16 Oct 2013 08:24:16 -0500	[thread overview]
Message-ID: <525E9380.7090905@ti.com> (raw)
In-Reply-To: <1381923650-7556-1-git-send-email-manishv.b@ti.com>

On 10/16/2013 06:40 AM, Vishwanathrao Badarkhe, Manish wrote:
> From: "Vishwanathrao Badarkhe, Manish" <manishv.b@ti.com>
> 
> Currently, probe returns success(0) on "debugfs_create_dir"
> function call failed. Return proper error on "debugfs_create_dir"
> call failed.
> 
> Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
> ---
> Not tested on any EVM. Bug has been found while doing static review.
> Please confirm.


IMHO, fail of creation of debugfs is not reason enough to fail the
probe - further, this code needs a major revamp to work with device tree.

> 
> :100644 100644 db9973b... 7b101c1... M	drivers/power/avs/smartreflex.c
>  drivers/power/avs/smartreflex.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/power/avs/smartreflex.c b/drivers/power/avs/smartreflex.c
> index db9973b..7b101c1 100644
> --- a/drivers/power/avs/smartreflex.c
> +++ b/drivers/power/avs/smartreflex.c
> @@ -921,7 +921,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>  	if (!sr_dbg_dir) {
>  		sr_dbg_dir = debugfs_create_dir("smartreflex", NULL);
>  		if (IS_ERR_OR_NULL(sr_dbg_dir)) {
> -			ret = PTR_ERR(sr_dbg_dir);
> +			ret = sr_dbg_dir ? PTR_ERR(sr_dbg_dir) : -EIO;
>  			pr_err("%s:sr debugfs dir creation failed(%d)\n",
>  				__func__, ret);
>  			goto err_list_del;
> @@ -932,7 +932,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>  	if (IS_ERR_OR_NULL(sr_info->dbg_dir)) {
>  		dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
>  			__func__);
> -		ret = PTR_ERR(sr_info->dbg_dir);
> +		ret = sr_info->dbg_dir ? PTR_ERR(sr_info->dbg_dir) : -EIO;
>  		goto err_debugfs;
>  	}
>  
> @@ -947,7 +947,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>  	if (IS_ERR_OR_NULL(nvalue_dir)) {
>  		dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
>  			"for n-values\n", __func__);
> -		ret = PTR_ERR(nvalue_dir);
> +		ret = nvalue_dir ? PTR_ERR(nvalue_dir) : -EIO;
>  		goto err_debugfs;
>  	}
>  
> 

-- 
Regards,
Nishanth Menon

WARNING: multiple messages have this Message-ID (diff)
From: Nishanth Menon <nm@ti.com>
To: "Vishwanathrao Badarkhe, Manish" <manishv.b@ti.com>,
	<linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-omap@vger.kernel.org>
Cc: <khilman@kernel.org>, <anton@enomsg.org>, <dwmw2@infradead.org>
Subject: Re: [PATCH] PM/AVS: SmartReflex: fix fake probe success on debugfs fail
Date: Wed, 16 Oct 2013 08:24:16 -0500	[thread overview]
Message-ID: <525E9380.7090905@ti.com> (raw)
In-Reply-To: <1381923650-7556-1-git-send-email-manishv.b@ti.com>

On 10/16/2013 06:40 AM, Vishwanathrao Badarkhe, Manish wrote:
> From: "Vishwanathrao Badarkhe, Manish" <manishv.b@ti.com>
> 
> Currently, probe returns success(0) on "debugfs_create_dir"
> function call failed. Return proper error on "debugfs_create_dir"
> call failed.
> 
> Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@ti.com>
> ---
> Not tested on any EVM. Bug has been found while doing static review.
> Please confirm.


IMHO, fail of creation of debugfs is not reason enough to fail the
probe - further, this code needs a major revamp to work with device tree.

> 
> :100644 100644 db9973b... 7b101c1... M	drivers/power/avs/smartreflex.c
>  drivers/power/avs/smartreflex.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/power/avs/smartreflex.c b/drivers/power/avs/smartreflex.c
> index db9973b..7b101c1 100644
> --- a/drivers/power/avs/smartreflex.c
> +++ b/drivers/power/avs/smartreflex.c
> @@ -921,7 +921,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>  	if (!sr_dbg_dir) {
>  		sr_dbg_dir = debugfs_create_dir("smartreflex", NULL);
>  		if (IS_ERR_OR_NULL(sr_dbg_dir)) {
> -			ret = PTR_ERR(sr_dbg_dir);
> +			ret = sr_dbg_dir ? PTR_ERR(sr_dbg_dir) : -EIO;
>  			pr_err("%s:sr debugfs dir creation failed(%d)\n",
>  				__func__, ret);
>  			goto err_list_del;
> @@ -932,7 +932,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>  	if (IS_ERR_OR_NULL(sr_info->dbg_dir)) {
>  		dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
>  			__func__);
> -		ret = PTR_ERR(sr_info->dbg_dir);
> +		ret = sr_info->dbg_dir ? PTR_ERR(sr_info->dbg_dir) : -EIO;
>  		goto err_debugfs;
>  	}
>  
> @@ -947,7 +947,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
>  	if (IS_ERR_OR_NULL(nvalue_dir)) {
>  		dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
>  			"for n-values\n", __func__);
> -		ret = PTR_ERR(nvalue_dir);
> +		ret = nvalue_dir ? PTR_ERR(nvalue_dir) : -EIO;
>  		goto err_debugfs;
>  	}
>  
> 

-- 
Regards,
Nishanth Menon

       reply	other threads:[~2013-10-16 13:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1381923650-7556-1-git-send-email-manishv.b@ti.com>
2013-10-16 13:24 ` Nishanth Menon [this message]
2013-10-16 13:24   ` [PATCH] PM/AVS: SmartReflex: fix fake probe success on debugfs fail Nishanth Menon
2013-10-16 14:24   ` Manish Badarkhe
2013-10-16 14:43     ` Nishanth Menon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=525E9380.7090905@ti.com \
    --to=nm@ti.com \
    --cc=anton@enomsg.org \
    --cc=dwmw2@infradead.org \
    --cc=khilman@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=manishv.b@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.