Re: [PATCH v7 2/3] clk: cs2600: Add Fractional-N clock driver

Uwe Kleine-König <[email protected]>
Newsgroups org.kernel.vger.linux-devicetree,org.kernel.vger.linux-clk,org.kernel.vger.linux-kernel
Message-ID <anZEtfI1tFz8Xc00@monoceros>
On Fri, Aug 07, 2026 at 04:54:05PM +0100, Richard Fitzgerald wrote:
> +#include <dt-bindings/clock/cirrus,cs2600-clock.h>
> +#include <linux/bitfield.h>
> +#include <linux/clk.h>
> +#include <linux/clk-provider.h>
> +#include <linux/container_of.h>
> +#include <linux/delay.h>
> +#include <linux/i2c.h>
> +#include <linux/math.h>
> +#include <linux/math64.h>
> +#include <linux/mod_devicetable.h>

Please drop <linux/mod_devicetable.h>. You can rely on <linux/i2c.h> to
provide struct i2c_device_id and of_device_id.

(Background of this request is that <linux/mod_devicetable.h> should go
away soon.)

> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/regmap.h>
> +#include <linux/string.h>
> +
> [...]
> +static const struct of_device_id cs2600_of_match[] = {
> +	{ .compatible = "cirrus,cs2600", },

No comma before a closing } in the same line please.

> +	{}

{ } is the most common way to write the terminator.

> +};
> +MODULE_DEVICE_TABLE(of, cs2600_of_match);
> +
> +static const struct i2c_device_id cs2600_id[] = {
> +	{ .name = "cs2600", },
> +	{}
> +};

Here the same please.

> +MODULE_DEVICE_TABLE(i2c, cs2600_id);
> +
> +static struct i2c_driver cs2600_driver = {
> +	.driver = {
> +		.name = "cs2600",
> +		.of_match_table = cs2600_of_match,
> +	},
> +	.probe		= cs2600_i2c_probe,
> +	.id_table	= cs2600_id,

I'm not a fan of aligning `=`s as it gets inconsistent over time. Here
it's wrong already from the start. Only 2 out of 3 members of the
i2c_driver use alignment and .driver doesn't. If you ask me, just use a
single space before each `=`.

> +};
> +
> +module_i2c_driver(cs2600_driver);

No empty line before module_i2c_driver() please.

> +
> +MODULE_DESCRIPTION("CS2600 clock driver");
> +MODULE_AUTHOR("Paul Handrigan <[email protected]>");
> +MODULE_LICENSE("GPL");
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmp2RigACgkQj4D7WH0S
/k58Dgf+MClFTxmS/qK0orwG1HB6xEl5A6Df4iMYUnOfblE7l7XB5JJJeO/A5XyB
zCNvQ5obXXkYh7UnOTBCOCqCXMOAhRFkMWL/71plvOo/xogZC9cICDs8LjElucLA
meOkRGqabSTG4YnkLr5mDOP3lFYEUxmAN0NIcMUCUTrOY833wpDDdbVqfioMqXb0
V0bh3jEEoSqc5S0VtSzmTWsXUl5j9JNUZd/9+vaZdpsEYov2U2UXVyv2mBqglfEM
zAdXsQoUF8qimawimqOhCcM/ll5LFxLwJwDUd5ccK1R3nocXeECwRPu9hh8PrHO+
nniM1hBbVlJjPOHVZz47EU46oOUTvQ==
=69FK
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.