Re: [PATCH v2 2/2] one-bit-adc-dac: Add initial version of one bit ADC-DAC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 17, 2022 at 8:41 AM Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
> On Tue, 11 Jan 2022 13:59:19 +0200
> Cristian Pop <cristian.pop@xxxxxxxxxx> wrote:

> > +     st->labels = devm_kzalloc(device, sizeof(*st->labels) * child_num, GFP_KERNEL);
> > +     if (!st->labels)
> > +             return -ENOMEM;
> > +
> > +     i = child_num;
> > +     fwnode_for_each_child_node(fwnode, child) {
> > +             if (fwnode_property_read_u32(child, "reg", &crt_ch))
> > +                     continue;
> > +
> > +             if (crt_ch >= num_channels)
> > +                     continue;
> > +
> > +             if (fwnode_property_read_string(child, "label", &label))
> > +                     continue;
> > +
> > +             chan = &channels[crt_ch];
> ? Not used.
>
> > +             st->labels[--i] = label;

> I've no idea how this works...  Should be looking for the chan->channel
> value as that's what your read uses to index.

It's an implicit memcpy().

> > +     }
> > +
> > +     return 0;
> > +}



-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux