Re: [PATCH 01/28] mfd: Add Microchip ZL3073x support

Krzysztof Kozlowski
2025-04-07T17:53:59Z

On 07/04/2025 19:28, Ivan Vecera wrote:
> This adds base MFD driver for Microchip Azurite ZL3073x chip family.

Please do not use "This commit/patch/change", but imperative mood. See
longer explanation here:
https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95

> These chips provide DPLL and PHC (PTP) functionality and they can
> be connected over I2C or SPI bus.
>

...

> +/**
> + * zl3073x_get_regmap_config - return pointer to regmap config
> + *
> + * Returns pointer to regmap config
> + */
> +const struct regmap_config *zl3073x_get_regmap_config(void)
> +{
> + return &zl3073x_regmap_config;
> +}
> +EXPORT_SYMBOL_NS_GPL(zl3073x_get_regmap_config, "ZL3073X");
> +
> +struct zl3073x_dev *zl3073x_dev_alloc(struct device *dev)
> +{
> + struct zl3073x_dev *zldev;
> +
> + return devm_kzalloc(dev, sizeof(*zldev), GFP_KERNEL);
> +}
> +EXPORT_SYMBOL_NS_GPL(zl3073x_dev_alloc, "ZL3073X");
> +
> +int zl3073x_dev_init(struct zl3073x_dev *zldev)
> +{
> + devm_mutex_init(zldev->dev, &zldev->lock);
> +
> + return 0;
> +}
> +EXPORT_SYMBOL_NS_GPL(zl3073x_dev_init, "ZL3073X");
> +
> +void zl3073x_dev_exit(struct zl3073x_dev *zldev)
> +{
> +}
> +EXPORT_SYMBOL_NS_GPL(zl3073x_dev_exit, "ZL3073X");

Why do you add empty exports?

> diff --git a/drivers/mfd/zl3073x-spi.c b/drivers/mfd/zl3073x-spi.c
> new file mode 100644
> index 0000000000000..a6b9a366a7585
> --- /dev/null
> +++ b/drivers/mfd/zl3073x-spi.c
> @@ -0,0 +1,71 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/spi/spi.h>
> +#include "zl3073x.h"
> +
> +static const struct spi_device_id zl3073x_spi_id[] = {
> + { "zl3073x-spi", },
> + { /* sentinel */ },
> +};
> +MODULE_DEVICE_TABLE(spi, zl3073x_spi_id);
> +
> +static const struct of_device_id zl3073x_spi_of_match[] = {
> + { .compatible = "microchip,zl3073x-spi" },

You need bindings. If they are somewhere in this patchset then you need
correct order so before users (see DT submitting patches).

> +static void zl3073x_spi_remove(struct spi_device *spidev)
> +{
> + struct zl3073x_dev *zldev;
> +
> + zldev = spi_get_drvdata(spidev);
> + zl3073x_dev_exit(zldev);
> +}
> +
> +static struct spi_driver zl3073x_spi_driver = {
> + .driver = {
> + .name = "zl3073x-spi",
> + .of_match_table = of_match_ptr(zl3073x_spi_of_match),

Drop of_match_ptr, you have warnings here.

> + },
> + .probe = zl3073x_spi_probe,
> + .remove = zl3073x_spi_remove,
> + .id_table = zl3073x_spi_id,
> +};
> +

Best regards,
Krzysztof