iio: adc: ad7192: use devm_clk_get_optional() for mclk
authorAlexandru Ardelean <aardelean@deviqon.com>
Thu, 13 May 2021 12:07:49 +0000 (15:07 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 13 Jun 2021 16:00:16 +0000 (17:00 +0100)
commitc9ec2cb328e3273327efad09f99f3744a778108a
treea735253b8f25c6d40df618d64b70055be3f88e4e
parente50aab18dd7fbfb7419d0b9c4b4e45251f36beb8
iio: adc: ad7192: use devm_clk_get_optional() for mclk

The devm_clk_get_optional() helper returns NULL when devm_clk_get() returns
-ENOENT.
This makes things slightly cleaner. The added benefit is mostly cosmetic.

Also, a minor detail with this call, is that the reference for the parent
device is taken as `spi->dev` instead of `&st->sd.spi->dev` (which looks a
little quirky).

Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
Link: https://lore.kernel.org/r/20210513120752.90074-10-aardelean@deviqon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7192.c