#define LTC2991_V7_V8_FILT_EN BIT(7)
#define LTC2991_V7_V8_TEMP_EN BIT(5)
#define LTC2991_V7_V8_DIFF_EN BIT(4)
-#define LTC2991_V5_V6_FILT_EN BIT(7)
-#define LTC2991_V5_V6_TEMP_EN BIT(5)
-#define LTC2991_V5_V6_DIFF_EN BIT(4)
+#define LTC2991_V5_V6_FILT_EN BIT(3)
+#define LTC2991_V5_V6_TEMP_EN BIT(1)
+#define LTC2991_V5_V6_DIFF_EN BIT(0)
#define LTC2991_REPEAT_ACQ_EN BIT(4)
#define LTC2991_T_INT_FILT_EN BIT(3)
case hwmon_temp:
switch (attr) {
case hwmon_temp_input:
- if (st->temp_en[channel] ||
- channel == LTC2991_T_INT_CH_NR)
+ if (channel == LTC2991_T_INT_CH_NR ||
+ st->temp_en[channel])
return 0444;
break;
}
static int ltc2991_init(struct ltc2991_state *st, struct device *dev)
{
- struct fwnode_handle *child;
int ret;
u32 val, addr;
u8 v5_v8_reg_data = 0, v1_v4_reg_data = 0;
return dev_err_probe(dev, ret,
"failed to enable regulator\n");
- device_for_each_child_node(dev, child) {
+ device_for_each_child_node_scoped(dev, child) {
ret = fwnode_property_read_u32(child, "reg", &addr);
- if (ret < 0) {
- fwnode_handle_put(child);
+ if (ret < 0)
return ret;
- }
- if (addr > 3) {
- fwnode_handle_put(child);
+ if (addr > 3)
return -EINVAL;
- }
ret = fwnode_property_read_u32(child,
"shunt-resistor-micro-ohms",