Skip to content

Commit 6982743

Browse files
andy-shevjic23
authored andcommitted
iio: magnetometer: ak8975: drop duplicate NULL check
The gpiod_set_consumer_name() is NULL-aware, no need to perform the same check in the caller. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
1 parent 4cff988 commit 6982743

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/iio/magnetometer/ak8975.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -919,8 +919,7 @@ static int ak8975_probe(struct i2c_client *client)
919919
eoc_gpiod = devm_gpiod_get_optional(&client->dev, NULL, GPIOD_IN);
920920
if (IS_ERR(eoc_gpiod))
921921
return PTR_ERR(eoc_gpiod);
922-
if (eoc_gpiod)
923-
gpiod_set_consumer_name(eoc_gpiod, "ak_8975");
922+
gpiod_set_consumer_name(eoc_gpiod, "ak_8975");
924923

925924
/*
926925
* According to AK09911 datasheet, if reset GPIO is provided then

0 commit comments

Comments
 (0)