diff mbox series

[v1,1/1] iio: dac: ad5592r: Get rid of OF specifics

Message ID 20220531135320.63096-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted
Headers show
Series [v1,1/1] iio: dac: ad5592r: Get rid of OF specifics | expand

Commit Message

Andy Shevchenko May 31, 2022, 1:53 p.m. UTC
Use dev_fwnode() instead of direct OF node dereference when checking
for regulator API error code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/iio/dac/ad5592r-base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jonathan Cameron June 3, 2022, 5:28 p.m. UTC | #1
On Tue, 31 May 2022 16:53:20 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> Use dev_fwnode() instead of direct OF node dereference when checking
> for regulator API error code.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Applied
> ---
>  drivers/iio/dac/ad5592r-base.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/dac/ad5592r-base.c b/drivers/iio/dac/ad5592r-base.c
> index 4434c1b2a322..7a9b5fc1e579 100644
> --- a/drivers/iio/dac/ad5592r-base.c
> +++ b/drivers/iio/dac/ad5592r-base.c
> @@ -603,7 +603,7 @@ int ad5592r_probe(struct device *dev, const char *name,
>  
>  	st->reg = devm_regulator_get_optional(dev, "vref");
>  	if (IS_ERR(st->reg)) {
> -		if ((PTR_ERR(st->reg) != -ENODEV) && dev->of_node)
> +		if ((PTR_ERR(st->reg) != -ENODEV) && dev_fwnode(dev))
>  			return PTR_ERR(st->reg);
>  
>  		st->reg = NULL;
diff mbox series

Patch

diff --git a/drivers/iio/dac/ad5592r-base.c b/drivers/iio/dac/ad5592r-base.c
index 4434c1b2a322..7a9b5fc1e579 100644
--- a/drivers/iio/dac/ad5592r-base.c
+++ b/drivers/iio/dac/ad5592r-base.c
@@ -603,7 +603,7 @@  int ad5592r_probe(struct device *dev, const char *name,
 
 	st->reg = devm_regulator_get_optional(dev, "vref");
 	if (IS_ERR(st->reg)) {
-		if ((PTR_ERR(st->reg) != -ENODEV) && dev->of_node)
+		if ((PTR_ERR(st->reg) != -ENODEV) && dev_fwnode(dev))
 			return PTR_ERR(st->reg);
 
 		st->reg = NULL;