summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorJoaquín Ignacio Aramendía <samsagax@gmail.com>2023-05-25 17:26:52 +0300
committerGuenter Roeck <linux@roeck-us.net>2023-06-08 16:41:18 +0300
commit7590e659e063dc45a5743bb4e5eb4a21ee1fd651 (patch)
tree9882fa59ca6d4ce288e20e76ce77f5c8e038ee29 /drivers/hwmon
parent16d60ba8fdc4c6e4745005889dea6ed82b6b5cbd (diff)
downloadlinux-7590e659e063dc45a5743bb4e5eb4a21ee1fd651.tar.xz
hwmon: (oxp-sensors) Stop passing device structure
We don't need to pass device structure to write_to_ec() so we remove that from the function declaration. The same is valid for pwm_enable() and pwm_disable() as we were passing the pointer to hand it off to write_to_ec(). Signed-off-by: Joaquín Ignacio Aramendía <samsagax@gmail.com> Link: https://lore.kernel.org/r/20230525142652.41981-1-samsagax@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/oxp-sensors.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/hwmon/oxp-sensors.c b/drivers/hwmon/oxp-sensors.c
index a4ee757f879f..0ec7588610ad 100644
--- a/drivers/hwmon/oxp-sensors.c
+++ b/drivers/hwmon/oxp-sensors.c
@@ -141,7 +141,7 @@ static int read_from_ec(u8 reg, int size, long *val)
return 0;
}
-static int write_to_ec(const struct device *dev, u8 reg, u8 value)
+static int write_to_ec(u8 reg, u8 value)
{
int ret;
@@ -156,14 +156,14 @@ static int write_to_ec(const struct device *dev, u8 reg, u8 value)
return ret;
}
-static int oxp_pwm_enable(const struct device *dev)
+static int oxp_pwm_enable(void)
{
- return write_to_ec(dev, OXP_SENSOR_PWM_ENABLE_REG, 0x01);
+ return write_to_ec(OXP_SENSOR_PWM_ENABLE_REG, 0x01);
}
-static int oxp_pwm_disable(const struct device *dev)
+static int oxp_pwm_disable(void)
{
- return write_to_ec(dev, OXP_SENSOR_PWM_ENABLE_REG, 0x00);
+ return write_to_ec(OXP_SENSOR_PWM_ENABLE_REG, 0x00);
}
/* Callbacks for hwmon interface */
@@ -234,9 +234,9 @@ static int oxp_platform_write(struct device *dev, enum hwmon_sensor_types type,
switch (attr) {
case hwmon_pwm_enable:
if (val == 1)
- return oxp_pwm_enable(dev);
+ return oxp_pwm_enable();
else if (val == 0)
- return oxp_pwm_disable(dev);
+ return oxp_pwm_disable();
return -EINVAL;
case hwmon_pwm_input:
if (val < 0 || val > 255)
@@ -254,7 +254,7 @@ static int oxp_platform_write(struct device *dev, enum hwmon_sensor_types type,
default:
break;
}
- return write_to_ec(dev, OXP_SENSOR_PWM_REG, val);
+ return write_to_ec(OXP_SENSOR_PWM_REG, val);
default:
break;
}