Hi, Andre >> + } >> + >> + if (num_channels > SUN20I_GPADC_MAX_CHANNELS) { >> + dev_err(dev, "num of channel children out of range"); >> + return -EINVAL; > >Jonathan, but num_channels comes from the device tree. Why do we need to >validate the upper limit and not simply use as much as we can? > >That's why I think this is not a critical error. Looks like I missed this. So, if we rely on dtbs_check then I agree that this check is not needed.