2013-10-01 04:11:31

by Manish Badarkhe

[permalink] [raw]
Subject: [PATCH] regulator: tps65090: remove usage of IS_ERR_OR_NULL

This patch changes the driver to avoid the usage of IS_ERR_OR_NULL()
macro.

The case present in this patch simply translates to normal check for pointer,
wheather it is NULL or has an error code.

Signed-off-by: Manish Badarkhe <[email protected]>
---
:100644 100644 bd611cdf.. ad3d4d4... M drivers/regulator/tps65090-regulator.c
drivers/regulator/tps65090-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/tps65090-regulator.c b/drivers/regulator/tps65090-regulator.c
index bd611cdf..ad3d4d4 100644
--- a/drivers/regulator/tps65090-regulator.c
+++ b/drivers/regulator/tps65090-regulator.c
@@ -245,7 +245,7 @@ static int tps65090_regulator_probe(struct platform_device *pdev)
if (!tps65090_pdata && tps65090_mfd->dev->of_node)
tps65090_pdata = tps65090_parse_dt_reg_data(pdev,
&tps65090_reg_matches);
- if (IS_ERR_OR_NULL(tps65090_pdata)) {
+ if (!tps65090_pdata || IS_ERR(tps65090_pdata)) {
dev_err(&pdev->dev, "Platform data missing\n");
return tps65090_pdata ? PTR_ERR(tps65090_pdata) : -EINVAL;
}
--
1.7.10.4


2013-10-01 09:23:45

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] regulator: tps65090: remove usage of IS_ERR_OR_NULL

On Tue, Oct 01, 2013 at 09:41:04AM +0530, Manish Badarkhe wrote:
> This patch changes the driver to avoid the usage of IS_ERR_OR_NULL()
> macro.

Why?


Attachments:
(No filename) (151.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2013-10-01 14:59:59

by Manish Badarkhe

[permalink] [raw]
Subject: Re: [PATCH] regulator: tps65090: remove usage of IS_ERR_OR_NULL

Hi Mark,

Thank you for your reply.

On Tue, Oct 1, 2013 at 2:52 PM, Mark Brown <[email protected]> wrote:
> On Tue, Oct 01, 2013 at 09:41:04AM +0530, Manish Badarkhe wrote:
>> This patch changes the driver to avoid the usage of IS_ERR_OR_NULL()
>> macro.
>
> Why?

Code use "IS_ERR_OR_NULL()" properly as per current implementation. But
as per patches [1], [2] below, the use of "IS_ERR_OR_NULL()" has been
deprecated.
Hence done this change.

[1] - http://www.mail-archive.com/[email protected]/msg78030.html
[2] - http://comments.gmane.org/gmane.linux.power-management.general/33515

Please let me know your opinion about this change, If not necessary,
will revert back
this change.

Regards,
Manish Badarkhe

2013-10-01 15:49:40

by Stephen Warren

[permalink] [raw]
Subject: Re: [PATCH] regulator: tps65090: remove usage of IS_ERR_OR_NULL

On 10/01/2013 08:59 AM, Manish Badarkhe wrote:
> Hi Mark,
>
> Thank you for your reply.
>
> On Tue, Oct 1, 2013 at 2:52 PM, Mark Brown <[email protected]> wrote:
>> On Tue, Oct 01, 2013 at 09:41:04AM +0530, Manish Badarkhe wrote:
>>> This patch changes the driver to avoid the usage of IS_ERR_OR_NULL()
>>> macro.
>>
>> Why?
>
> Code use "IS_ERR_OR_NULL()" properly as per current implementation. But
> as per patches [1], [2] below, the use of "IS_ERR_OR_NULL()" has been
> deprecated.
> Hence done this change.

The intent was to deprecate to *concept* of checking a return value for
both NULL and an error. Simply removing usage of the macro and replacing
it with the exact same code that was part of the macro doesn't fulfil
the intent at all.

2013-10-01 16:32:43

by Manish Badarkhe

[permalink] [raw]
Subject: Re: [PATCH] regulator: tps65090: remove usage of IS_ERR_OR_NULL

Hi Stephan,

Thank you for your reply.

On Tue, Oct 1, 2013 at 9:19 PM, Stephen Warren <[email protected]> wrote:
> On 10/01/2013 08:59 AM, Manish Badarkhe wrote:
>> Hi Mark,
>>
>> Thank you for your reply.
>>
>> On Tue, Oct 1, 2013 at 2:52 PM, Mark Brown <[email protected]> wrote:
>>> On Tue, Oct 01, 2013 at 09:41:04AM +0530, Manish Badarkhe wrote:
>>>> This patch changes the driver to avoid the usage of IS_ERR_OR_NULL()
>>>> macro.
>>>
>>> Why?
>>
>> Code use "IS_ERR_OR_NULL()" properly as per current implementation. But
>> as per patches [1], [2] below, the use of "IS_ERR_OR_NULL()" has been
>> deprecated.
>> Hence done this change.
>
> The intent was to deprecate to *concept* of checking a return value for
> both NULL and an error. Simply removing usage of the macro and replacing
> it with the exact same code that was part of the macro doesn't fulfil
> the intent at all.

Ok, Please drop this patch.

Regards
Manish Badarkhe