lkml.org 
[lkml]   [2022]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 3/3] hwmon: (adt7475) Use enum chips when loading attenuator settings
Date
Simplify load_attenuators() by making use of enum chips instead of int.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---

Notes:
Changes in v2:
- New

drivers/hwmon/adt7475.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c
index 6de501de41b2..ebe4a85eb62e 100644
--- a/drivers/hwmon/adt7475.c
+++ b/drivers/hwmon/adt7475.c
@@ -1569,7 +1569,7 @@ static int set_property_bit(const struct i2c_client *client, char *property,
return ret;
}

-static int load_attenuators(const struct i2c_client *client, int chip,
+static int load_attenuators(const struct i2c_client *client, enum chips chip,
struct adt7475_data *data)
{
int ret;
@@ -1588,7 +1588,7 @@ static int load_attenuators(const struct i2c_client *client, int chip,
data->config4);
if (ret < 0)
return ret;
- } else if (chip == adt7473 || chip == adt7475) {
+ } else {
set_property_bit(client, "adi,bypass-attenuator-in1",
&data->config2, 5);

--
2.35.1
\
 
 \ /
  Last update: 2022-03-17 23:33    [W:0.209 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site