>               error = of_property_read_u32(np, "reg", &channel_num);
> -             if (error || channel_num > 2) {
> +             if (error || channel_num > data->last_channel) {

Just an idea, I haven't tested it: Couldn't we use
ARRAY_SIZE(data->select_value) to avoid the extra member in the struct?

Attachment: signature.asc
Description: PGP signature

Reply via email to