Re: [PATCH 2/7] w1: ds2433: add support for registering multiple families

From: Krzysztof Kozlowski
Date: Mon Nov 20 2023 - 04:22:24 EST


On 17/11/2023 20:29, marc.ferland@xxxxxxxxx wrote:
> From: Jean-Francois Dagenais <jeff.dagenais@xxxxxxxxx>
>
> This is ground work for supporting both the ds2433 and the
> ds28ec20. Inspired by the w1_ds250x driver.
>
> Signed-off-by: Marc Ferland <marc.ferland@xxxxxxxxxxxx>
> Signed-off-by: Jean-Francois Dagenais <jeff.dagenais@xxxxxxxxx>

Your patchset has build warnings, so only limited review follows. I will
perform full review once you do not have any warnings.

> ---
> drivers/w1/slaves/w1_ds2433.c | 20 +++++++++++++++++++-
> 1 file changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/w1/slaves/w1_ds2433.c b/drivers/w1/slaves/w1_ds2433.c
> index e18523ef8c45..e1e45ea1bfa4 100644
> --- a/drivers/w1/slaves/w1_ds2433.c
> +++ b/drivers/w1/slaves/w1_ds2433.c
> @@ -299,7 +299,25 @@ static struct w1_family w1_family_23 = {
> .fid = W1_EEPROM_DS2433,
> .fops = &w1_f23_fops,
> };
> -module_w1_family(w1_family_23);
> +
> +static int __init w1_ds2433_init(void)
> +{
> + int err;
> +
> + err = w1_register_family(&w1_family_23);
> + if (err)
> + return err;
> +
> + return 0;
> +}
> +
> +static void __exit w1_ds2433_exit(void)
> +{
> + w1_unregister_family(&w1_family_23);
> +}

This does not make much sense on its own. I do not see any benefits.

Best regards,
Krzysztof