Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: cs35l32: Remove unneeded NULL test for cs35l32->reset_gpio

It's safe to call gpiod_set_value_cansleep() with NULL desc.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Axel Lin and committed by
Mark Brown
d5a78c8e 4c38b9c3

+4 -8
+4 -8
sound/soc/codecs/cs35l32.c
··· 441 441 if (IS_ERR(cs35l32->reset_gpio)) 442 442 return PTR_ERR(cs35l32->reset_gpio); 443 443 444 - if (cs35l32->reset_gpio) 445 - gpiod_set_value_cansleep(cs35l32->reset_gpio, 1); 444 + gpiod_set_value_cansleep(cs35l32->reset_gpio, 1); 446 445 447 446 /* initialize codec */ 448 447 ret = regmap_read(cs35l32->regmap, CS35L32_DEVID_AB, &reg); ··· 535 536 snd_soc_unregister_codec(&i2c_client->dev); 536 537 537 538 /* Hold down reset */ 538 - if (cs35l32->reset_gpio) 539 - gpiod_set_value_cansleep(cs35l32->reset_gpio, 0); 539 + gpiod_set_value_cansleep(cs35l32->reset_gpio, 0); 540 540 541 541 return 0; 542 542 } ··· 549 551 regcache_mark_dirty(cs35l32->regmap); 550 552 551 553 /* Hold down reset */ 552 - if (cs35l32->reset_gpio) 553 - gpiod_set_value_cansleep(cs35l32->reset_gpio, 0); 554 + gpiod_set_value_cansleep(cs35l32->reset_gpio, 0); 554 555 555 556 /* remove power */ 556 557 regulator_bulk_disable(ARRAY_SIZE(cs35l32->supplies), ··· 572 575 return ret; 573 576 } 574 577 575 - if (cs35l32->reset_gpio) 576 - gpiod_set_value_cansleep(cs35l32->reset_gpio, 1); 578 + gpiod_set_value_cansleep(cs35l32->reset_gpio, 1); 577 579 578 580 regcache_cache_only(cs35l32->regmap, false); 579 581 regcache_sync(cs35l32->regmap);