quoted
+static int ad5529r_parse_channel_ranges(struct device *dev,
+ struct ad5529r_state *st)
+{
+ unsigned long channel_mask = 0;
+ s32 vals[2];
+ int ret, range_idx;
+ u32 ch;
+
+ device_for_each_child_node_scoped(dev, child) {
+ if (st->num_channels == ARRAY_SIZE(st->channels))
+ return dev_err_probe(dev, -ECHRNG, "Too many channels\n");
Okay, this actually better to be ENOSPC
quoted
+ ret = fwnode_property_read_u32(child, "reg", &ch);
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "Missing reg property in channel node\n");
+
+ if (ch >= AD5529R_MAX_CHANNELS)
+ return dev_err_probe(dev, -EINVAL,
and ECHRNG is here.
That one is getting rather creative even though I guess the description
does fit rather well. So I don't object, but also feel -EINVAL is
probably good enough for an invalid property value.
quoted
+ "Channel %u exceeds maximum 15\n",
J