lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 3 Nov 2021 17:19:28 +0000
From:   Jonathan Cameron <jic23@...nel.org>
To:     Anand Ashok Dumbre <ANANDASH@...inx.com>
Cc:     Andy Shevchenko <andy.shevchenko@...il.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Lars-Peter Clausen <lars@...afoo.de>,
        linux-iio <linux-iio@...r.kernel.org>, git <git@...inx.com>,
        Michal Simek <michals@...inx.com>,
        Peter Meerwald <pmeerw@...erw.net>,
        devicetree <devicetree@...r.kernel.org>,
        Manish Narani <MNARANI@...inx.com>
Subject: Re: [PATCH v7 2/4] iio: adc: Add Xilinx AMS driver

On Tue, 2 Nov 2021 21:31:21 +0000
Anand Ashok Dumbre <ANANDASH@...inx.com> wrote:

> Hi Andy,
> 
> Thanks for the review.
...

> > > +               return IRQ_NONE;  
> > 
> > ...
> >   
> > > +       for_each_child_of_node(chan_node, child) {
> > > +               ret = of_property_read_u32(child, "reg", &reg);
> > > +               if (ret || reg > (AMS_PL_MAX_EXT_CHANNEL + 30))
> > > +                       continue;
> > > +
> > > +               memcpy(&channels[num_channels], &ams_pl_channels[reg +
> > > +                      AMS_PL_MAX_FIXED_CHANNEL - 30],
> > > + sizeof(*channels));
> > > +
> > > +               if (of_property_read_bool(child, "xlnx,bipolar"))
> > > +                       channels[num_channels].scan_type.sign = 's';
> > > +
> > > +               num_channels++;
> > > +       }  
> > 
> > Use device property API here instead of *of_*() calls.  
> 
> 
> > 
> > ...
> >   
> > > +       /* Initialize buffer for channel specification */
> > > +       ams_channels = kzalloc(sizeof(ams_ps_channels) +
> > > +                              sizeof(ams_pl_channels) +
> > > +                              sizeof(ams_ctrl_channels), GFP_KERNEL);  
> > 
> > Use the corresponding macro from overflow.h.
> >   
> > > +       if (!ams_channels)
> > > +               return -ENOMEM;  
> > 
> > ...
> >   
> > > +       if (of_device_is_available(np)) {  
> > 
> > fwnode_device_is_available()  
> 
> Currently acpi is not supported with this driver. But I will add support in the next series of patches.
> I don’t have a full understanding of ACPI and its interfaces. So would it be okay once the first iteration
> gets checked in, I will add ACPI support on top.

If you use the generic fwnode etc from property.h then dt
will just work and it may well be enough to enable the weirdness that
is ACPI ID PRP0001 which actually uses dt properties but reads them
from an ACPI DSDT.

So basically nothing to do except use the generic accessors rather than
the of_ variants.

Jonathan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ