diff mbox series

ASoC: cs35l36: Fix an IS_ERR() vs NULL checking bug

Message ID 20190222063151.GC30993@kadam (mailing list archive)
State Accepted
Commit eb23dcd20e91fe97679257dc4d195a707b4a0d1a
Headers show
Series ASoC: cs35l36: Fix an IS_ERR() vs NULL checking bug | expand

Commit Message

Dan Carpenter Feb. 22, 2019, 6:31 a.m. UTC
The irq_get_irq_data() function doesn't return error pointers, it
returns NULL.

Fixes: 6ba9dd6c893b ("ASoC: cs35l36: Add support for Cirrus CS35L36 Amplifier")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 sound/soc/codecs/cs35l36.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Charles Keepax Feb. 22, 2019, 9:22 a.m. UTC | #1
On Fri, Feb 22, 2019 at 09:31:51AM +0300, Dan Carpenter wrote:
> The irq_get_irq_data() function doesn't return error pointers, it
> returns NULL.
> 
> Fixes: 6ba9dd6c893b ("ASoC: cs35l36: Add support for Cirrus CS35L36 Amplifier")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles
James Schulman Feb. 22, 2019, 9:50 p.m. UTC | #2
On Fri, 22 Feb 2019, Charles Keepax wrote:

> On Fri, Feb 22, 2019 at 09:31:51AM +0300, Dan Carpenter wrote:
>> The irq_get_irq_data() function doesn't return error pointers, it
>> returns NULL.
>>
>> Fixes: 6ba9dd6c893b ("ASoC: cs35l36: Add support for Cirrus CS35L36 Amplifier")
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>> ---
>
> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
>
> Thanks,
> Charles
>

Thanks Dan.

Reviewed-by: James Schulman <james.schulman@cirrus.com>

- James
diff mbox series

Patch

diff --git a/sound/soc/codecs/cs35l36.c b/sound/soc/codecs/cs35l36.c
index e374fffb7e17..901d57491218 100644
--- a/sound/soc/codecs/cs35l36.c
+++ b/sound/soc/codecs/cs35l36.c
@@ -1845,9 +1845,9 @@  static int cs35l36_i2c_probe(struct i2c_client *i2c_client,
 		cs35l36_apply_vpbr_config(cs35l36);
 
 	irq_d = irq_get_irq_data(i2c_client->irq);
-	if (IS_ERR(irq_d)) {
+	if (!irq_d) {
 		dev_err(&i2c_client->dev, "Invalid IRQ: %d\n", i2c_client->irq);
-		ret = PTR_ERR(irq_d);
+		ret = -ENODEV;
 		goto err;
 	}