hwmon: Use new member visible in struct hwmon_ops to simplify drivers
Subsystems (8)
cover hwmon: Use new member visible in struct hwmon_ops to simplify drivers
This is a follow-up to 11fb69bb15c1 ("hwmon: Add static visibility member to struct hwmon_ops") and makes use of the new struct hwmon_ops member to simplify a number of drivers.
Heiner Kallweit (8):
hwmon: i5500_temp: Simplify specifying static visibility attribute
hwmon: surface_fan: Simplify specifying static visibility attribute
hwmon: sl28cpld: Simplify specifying static visibility attribute
hwmon: gsc: Simplify specifying static visibility attribute
hwmon: powerz: Simplify specifying static visibility attribute
hwmon: raspberrypi: Simplify specifying static visibility attribute
hwmon: intel-m10-bmc: Simplify specifying static visibility attribute
hwmon: nzxt-kraken2: Simplify specifying static visibility attribute
drivers/hwmon/gsc-hwmon.c | 9 +-------- drivers/hwmon/i5500_temp.c | 8 +------- drivers/hwmon/intel-m10-bmc-hwmon.c | 9 +-------- drivers/hwmon/nzxt-kraken2.c | 9 +-------- drivers/hwmon/powerz.c | 8 +------- drivers/hwmon/raspberrypi-hwmon.c | 8 +------- drivers/hwmon/sl28cpld-hwmon.c | 9 +-------- drivers/hwmon/surface_fan.c | 10 +--------- 8 files changed, 8 insertions(+), 62 deletions(-)
Signature · 1 line
2.47.0
PATCH 1/8 hwmon: i5500_temp: Simplify specifying static visibility attribute
Use new member visible of struct hwmon_ops to simplify specifying the static attribute visibility.
--- drivers/hwmon/i5500_temp.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/hwmon/i5500_temp.c +1 -7
@@ -29,12 +29,6 @@#define REG_CTCTRL 0xF7#define REG_TSTIMER 0xF8 -static umode_t i5500_is_visible (const void *drvdata,enum hwmon_sensor_types type,u32 attr, -int channel) -{ -return 0444 ; -} -static int i5500_read (struct device *dev,enum hwmon_sensor_types type,u32 attr,int channel,long *val) {
@@ -84,7 +78,7 @@ static int i5500_read(struct device *dev, enum hwmon_sensor_types type, u32 attr }static const struct hwmon_ops i5500_ops = { - .is_visible = i5500_is_visible, + .visible =0444 , .read = i5500_read, };
Signature · 1 line
2.47.0
PATCH 2/8 hwmon: surface_fan: Simplify specifying static visibility attribute
In reply to Heiner KallweitUse new member visible of struct hwmon_ops to simplify specifying the static attribute visibility.
--- drivers/hwmon/surface_fan.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/hwmon/surface_fan.c +1 -9
@@ -18,14 +18,6 @@ SSAM_DEFINE_SYNC_REQUEST_CL_R(__ssam_fan_rpm_get, __le16, { .command_id = 0x01, }); -// hwmon -static umode_t surface_fan_hwmon_is_visible (const void *drvdata, -enum hwmon_sensor_types type,u32 attr, -int channel) -{ -return 0444 ; -} -static int surface_fan_hwmon_read (struct device *dev,enum hwmon_sensor_types type,u32 attr,int channel,long *val)
@@ -49,7 +41,7 @@ static const struct hwmon_channel_info *const surface_fan_info[] = { };static const struct hwmon_ops surface_fan_hwmon_ops = { - .is_visible = surface_fan_hwmon_is_visible, + .visible =0444 , .read = surface_fan_hwmon_read, };
Signature · 1 line
2.47.0
PATCH 3/8 hwmon: sl28cpld: Simplify specifying static visibility attribute
In reply to Heiner KallweitUse new member visible of struct hwmon_ops to simplify specifying the static attribute visibility.
--- drivers/hwmon/sl28cpld-hwmon.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/hwmon/sl28cpld-hwmon.c +1 -8
@@ -23,13 +23,6 @@ struct sl28cpld_hwmon {u32 offset; }; -static umode_t sl28cpld_hwmon_is_visible (const void *data, -enum hwmon_sensor_types type, -u32 attr,int channel) -{ -return 0444 ; -} -static int sl28cpld_hwmon_read (struct device *dev,enum hwmon_sensor_types type,u32 attr,int channel,long *input)
@@ -73,7 +66,7 @@ static const struct hwmon_channel_info * const sl28cpld_hwmon_info[] = { };static const struct hwmon_ops sl28cpld_hwmon_ops = { - .is_visible = sl28cpld_hwmon_is_visible, + .visible =0444 , .read = sl28cpld_hwmon_read, };
Signature · 1 line
2.47.0
PATCH 4/8 hwmon: gsc: Simplify specifying static visibility attribute
In reply to Heiner KallweitUse new member visible of struct hwmon_ops to simplify specifying the static attribute visibility.
--- drivers/hwmon/gsc-hwmon.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/hwmon/gsc-hwmon.c +1 -8
@@ -231,15 +231,8 @@ gsc_hwmon_read_string(struct device *dev, enum hwmon_sensor_types type,return 0 ; } -static umode_t -gsc_hwmon_is_visible (const void *_data,enum hwmon_sensor_types type,u32 attr, -int ch) -{ -return 0444 ; -} -static const struct hwmon_ops gsc_hwmon_ops = { - .is_visible = gsc_hwmon_is_visible, + .visible =0444 , .read = gsc_hwmon_read, .read_string = gsc_hwmon_read_string, };
Signature · 1 line
2.47.0
PATCH 5/8 hwmon: powerz: Simplify specifying static visibility attribute
In reply to Heiner KallweitUse new member visible of struct hwmon_ops to simplify specifying the static attribute visibility.
--- drivers/hwmon/powerz.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/hwmon/powerz.c +1 -7
@@ -54,12 +54,6 @@ static const struct hwmon_channel_info *const powerz_info[] = { NULL }; -static umode_t powerz_is_visible (const void *data,enum hwmon_sensor_types type, -u32 attr,int channel) -{ -return 0444 ; -} -static int powerz_read_string (struct device *dev,enum hwmon_sensor_types type,u32 attr,int channel,const char **str) {
@@ -201,7 +195,7 @@ static int powerz_read(struct device *dev, enum hwmon_sensor_types type, }static const struct hwmon_ops powerz_hwmon_ops = { - .is_visible = powerz_is_visible, + .visible =0444 , .read = powerz_read, .read_string = powerz_read_string, };
Signature · 1 line
2.47.0
Re: [PATCH 5/8] hwmon: powerz: Simplify specifying static visibility attribute
Quoted 4 lines · Heiner Kallweit
Use new member visible of struct
hwmon_opsto simplify specifying the static attribute visibility.Signed-off-by Heiner Kallweit <[email protected]>
Thanks!
PATCH 6/8 hwmon: raspberrypi: Simplify specifying static visibility attribute
In reply to Heiner KallweitUse new member visible of struct hwmon_ops to simplify specifying the static attribute visibility.
--- drivers/hwmon/raspberrypi-hwmon.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/hwmon/raspberrypi-hwmon.c +1 -7
@@ -81,12 +81,6 @@ static int rpi_read(struct device *dev, enum hwmon_sensor_types type,return 0 ; } -static umode_t rpi_is_visible (const void *_data,enum hwmon_sensor_types type, -u32 attr,int channel) -{ -return 0444 ; -} -static const struct hwmon_channel_info *const rpi_info[] = {HWMON_CHANNEL_INFO (in,HWMON_I_LCRIT_ALARM ),
@@ -94,7 +88,7 @@ static const struct hwmon_channel_info * const rpi_info[] = { };static const struct hwmon_ops rpi_hwmon_ops = { - .is_visible = rpi_is_visible, + .visible =0444 , .read = rpi_read, };
Signature · 1 line
2.47.0
PATCH 7/8 hwmon: intel-m10-bmc: Simplify specifying static visibility attribute
In reply to Heiner KallweitUse new member visible of struct hwmon_ops to simplify specifying the static attribute visibility.
--- drivers/hwmon/intel-m10-bmc-hwmon.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/hwmon/intel-m10-bmc-hwmon.c +1 -8
@@ -565,13 +565,6 @@ static const struct m10bmc_hwmon_board_data n6000bmc_hwmon_bdata = { .hinfo = n6000bmc_hinfo, }; -static umode_t -m10bmc_hwmon_is_visible (const void *data,enum hwmon_sensor_types type, -u32 attr,int channel) -{ -return 0444 ; -} -static const struct m10bmc_sdata *find_sensor_data (struct m10bmc_hwmon *hw,enum hwmon_sensor_types type,int channel)
@@ -729,7 +722,7 @@ static int m10bmc_hwmon_read_string(struct device *dev, }static const struct hwmon_ops m10bmc_hwmon_ops = { - .is_visible = m10bmc_hwmon_is_visible, + .visible =0444 , .read = m10bmc_hwmon_read, .read_string = m10bmc_hwmon_read_string, };
Signature · 1 line
2.47.0
PATCH 8/8 hwmon: nzxt-kraken2: Simplify specifying static visibility attribute
In reply to Heiner KallweitUse new member visible of struct hwmon_ops to simplify specifying the static attribute visibility.
--- drivers/hwmon/nzxt-kraken2.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/hwmon/nzxt-kraken2.c +1 -8
@@ -35,13 +35,6 @@ struct kraken2_priv_data {unsigned long updated;/* jiffies */ }; -static umode_t kraken2_is_visible (const void *data, -enum hwmon_sensor_types type, -u32 attr,int channel) -{ -return 0444 ; -} -static int kraken2_read (struct device *dev,enum hwmon_sensor_types type,u32 attr,int channel,long *val) {
@@ -81,7 +74,7 @@ static int kraken2_read_string(struct device *dev, enum hwmon_sensor_types type, }static const struct hwmon_ops kraken2_hwmon_ops = { - .is_visible = kraken2_is_visible, + .visible =0444 , .read = kraken2_read, .read_string = kraken2_read_string, };
Signature · 1 line
2.47.0
Re: [PATCH 8/8] hwmon: nzxt-kraken2: Simplify specifying static visibility attribute
Quoted 4 lines · Heiner Kallweit
Use new member visible of struct
hwmon_opsto simplify specifying the static attribute visibility.Signed-off-by Heiner Kallweit <[email protected]>
Guenter Roeck
maintainerQuoted 14 lines · Heiner Kallweit
This is a follow-up to
11fb69bb15c1("hwmon: Add static visibility member to structhwmon_ops") and makes use of the new structhwmon_opsmember to simplify a number of drivers.Heiner Kallweit (8):
hwmon:i5500_temp: Simplify specifying static visibility attribute
hwmon:surface_fan: Simplify specifying static visibility attribute
hwmon: sl28cpld: Simplify specifying static visibility attribute
hwmon: gsc: Simplify specifying static visibility attribute
hwmon: powerz: Simplify specifying static visibility attribute
hwmon: raspberrypi: Simplify specifying static visibility attribute
hwmon: intel-m10-bmc: Simplify specifying static visibility attribute
hwmon: nzxt-kraken2: Simplify specifying static visibility attribute
Quoted 10 lines
drivers/hwmon/gsc-hwmon.c | 9 +-------- drivers/hwmon/i5500_temp.c | 8 +------- drivers/hwmon/intel-m10-bmc-hwmon.c | 9 +-------- drivers/hwmon/nzxt-kraken2.c | 9 +-------- drivers/hwmon/powerz.c | 8 +------- drivers/hwmon/raspberrypi-hwmon.c | 8 +------- drivers/hwmon/sl28cpld-hwmon.c | 9 +-------- drivers/hwmon/surface_fan.c | 10 +--------- 8 files changed, 8 insertions(+), 62 deletions(-)
Series applied.
Thanks,
Guenter