Thread (17 messages) flat view 17 messages, 6 authors, 20d ago

Re: [PATCH v10 3/3] iio: dac: Add AD5529R DAC driver support

From: Jonathan Cameron <jic23@kernel.org>
Date: 2026-08-30 23:16:43
Also in: linux-doc, linux-iio, linux-riscv, linux-spi, lkml

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help