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]
Message-ID: <7485514e-4c10-361a-6468-050a5897f0d5@sberdevices.ru>
Date:   Sun, 28 May 2023 00:37:49 +0300
From:   George Stark <gnstark@...rdevices.ru>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
CC:     "jic23@...nel.org" <jic23@...nel.org>,
        "lars@...afoo.de" <lars@...afoo.de>,
        "neil.armstrong@...aro.org" <neil.armstrong@...aro.org>,
        "khilman@...libre.com" <khilman@...libre.com>,
        "jbrunet@...libre.com" <jbrunet@...libre.com>,
        "martin.blumenstingl@...glemail.com" 
        <martin.blumenstingl@...glemail.com>,
        "nuno.sa@...log.com" <nuno.sa@...log.com>,
        "linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-amlogic@...ts.infradead.org" 
        <linux-amlogic@...ts.infradead.org>, kernel <kernel@...rdevices.ru>
Subject: Re: [PATCH v1] meson saradc: add iio device attrib to switch channel
 7 mux

Hi Andy

Thanks for review. I fixed it in patch v2

Best regards
George


On 5/27/23 11:21, Andy Shevchenko wrote:
> On Wed, May 24, 2023 at 03:01:11AM +0300, George Stark wrote:
>> Patch adds two sysfs nodes: chan7_mux to set mux state
>> and chan7_mux_available to show available mux states.
>> Mux can be used to debug and calibrate adc by
>> switching and measuring well-known inputs like gnd, vdd etc.
> GND
> Vdd
>
> ...
>
>> +static ssize_t chan7_mux_store(struct device *dev,
>> +			       struct device_attribute *attr,
>> +			       const char *buf, size_t count)
>> +{
>> +	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
>> +	int i;
>> +
>> +	for (i = 0; i < ARRAY_SIZE(chan7_vol); i++)
>> +		if (!strcmp(chan7_vol[i], buf)) {
>> +			meson_sar_adc_set_chan7_mux(indio_dev, i);
>> +			return count;
>> +		}
>> +
>> +	return -EINVAL;
> NIH sysfs_match_string().
>
>> +}
> ...
>
>> +static IIO_DEVICE_ATTR_RW(chan7_mux, -1);
>> +static IIO_DEVICE_ATTR_RO(chan7_mux_available, -1);
> Place each of them near to the respective callback(s),
>
> ...
>
>> +static struct attribute *meson_sar_adc_attrs[] = {
>> +	&iio_dev_attr_chan7_mux_available.dev_attr.attr,
>> +	&iio_dev_attr_chan7_mux.dev_attr.attr,
>> +	NULL,
> No comma for the terminator entry.
>
>> +};


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ