Subject: Re: [PATCH 03/11] net: dsa: realtek: convert variants into real drivers

From: Simon Horman <[email-masked]>
Date: Wed, 24 Jan 2024 19:37:35 +0000

On Tue, Jan 23, 2024 at 06:44:11PM -0300, Luiz Angelo Daros de Luca wrote:

...

Hi Luiz,

some minor feedback from my side.

> diff --git a/drivers/net/dsa/realtek/realtek-mdio.c b/drivers/net/dsa/realtek/realtek-mdio.c

...

> @@ -140,7 +141,20 @@ static const struct regmap_config realtek_mdio_nolock_regmap_config = {
>  	.disable_locking = true,
>  };
>  
> -static int realtek_mdio_probe(struct mdio_device *mdiodev)
> +/**
> + * realtek_mdio_probe() - Probe a platform device for an MDIO-connected switch
> + * @pdev: platform_device to probe on.

nit: this should document @mdiodev rather than @pdev

There are similar problems elswhere in this patch,
and in patch 5/11 of this series.

'/scripts/kernel-doc -none' is useful for finding such problems.

> + *
> + * This function should be used as the .probe in an mdio_driver. It
> + * initializes realtek_priv and read data from the device-tree node. The switch
> + * is hard resetted if a method is provided. It checks the switch chip ID and,

nit: reset

...

> diff --git a/drivers/net/dsa/realtek/realtek-smi.c b/drivers/net/dsa/realtek/realtek-smi.c

...

> -static int realtek_smi_probe(struct platform_device *pdev)
> +/**
> + * realtek_smi_probe() - Probe a platform device for an SMI-connected switch
> + * @pdev: platform_device to probe on.
> + *
> + * This function should be used as the .probe in a platform_driver. It
> + * initializes realtek_priv and read data from the device-tree node. The switch
> + * is hard resetted if a method is provided. It checks the switch chip ID and,

nit: reset

> + * finally, a DSA switch is registered.
> + *
> + * Context: Any context. Takes and releases priv->map_lock.
> + * Return: Returns 0 on success, a negative error on failure.
> + *
> + */
> +int realtek_smi_probe(struct platform_device *pdev)
>  {
>  	const struct realtek_variant *var;
>  	struct device *dev = &pdev->dev;

...