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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VdtpdfXUG08KytBAtrQC2VoaHnPr0-XL1jeqnXUZ-bgwQ@mail.gmail.com>
Date: Wed, 30 Apr 2025 01:10:22 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Marcelo Schmitt <marcelo.schmitt@...log.com>
Cc: linux-iio@...r.kernel.org, devicetree@...r.kernel.org, 
	linux-kernel@...r.kernel.org, jic23@...nel.org, lars@...afoo.de, 
	Michael.Hennerich@...log.com, dlechner@...libre.com, nuno.sa@...log.com, 
	andy@...nel.org, robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org, 
	marcelo.schmitt1@...il.com
Subject: Re: [PATCH v2 4/7] iio: adc: ad4170: Add clock provider support

On Mon, Apr 28, 2025 at 3:28 PM Marcelo Schmitt
<marcelo.schmitt@...log.com> wrote:
>
> The AD4170 chip can use an externally supplied clock at the XTAL2 pin, or
> an external crystal connected to the XTAL1 and XTAL2 pins. Alternatively,
> the AD4170 can provide it's 16 MHz internal clock at the XTAL2 pin. Extend

its

> the AD4170 driver so it effectively uses the provided external clock, if
> any, or supplies it's own clock as a clock provider.

its

...

> +static const char *const ad4170_clk_sel[] = {
> +       "ext-clk", "xtal"

Keep trailing comma when it's not a oneliner assignment.

> +};

...

> +static int ad4170_register_clk_provider(struct iio_dev *indio_dev)
> +{
> +       struct ad4170_state *st = iio_priv(indio_dev);
> +       struct device *dev = indio_dev->dev.parent;
> +       struct clk_init_data init = {};
> +       int ret;
> +
> +       if (!IS_ENABLED(CONFIG_COMMON_CLK))
> +               return 0;
> +
> +       if (device_property_read_string(dev, "clock-output-names", &init.name)) {
> +               init.name = devm_kasprintf(dev, GFP_KERNEL, "%s-clk",
> +                                          fwnode_get_name(dev_fwnode(dev)));

Why not %pfw ?

> +               if (!init.name)
> +                       return -ENOMEM;
> +       }
> +
> +       init.ops = &ad4170_int_clk_ops;
> +
> +       st->int_clk_hw.init = &init;
> +       ret = devm_clk_hw_register(dev, &st->int_clk_hw);
> +       if (ret)
> +               return ret;
> +
> +       return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get,
> +                                          &st->int_clk_hw);
> +}

...

> +       ret = ad4170_clock_select(indio_dev);
> +       if (ret < 0)

Why ' < 0' part?

> +               return dev_err_probe(dev, ret, "Failed to setup device clock\n");
> +
> +       ret = regmap_write(st->regmap, AD4170_CLOCK_CTRL_REG, st->clock_ctrl);
> +       if (ret)
> +               return ret;


-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ