Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: "Nuno Sá" <noname.nuno@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>, linux-hwmon@vger.kernel.org
Cc: Rob Herring <robh@kernel.org>,
	linux-kernel@vger.kernel.org,
	Peter Yin <peteryin.openbmc@gmail.com>,
	Potin Lai <potin.lai.pt@gmail.com>,
	Daniel Matyas <daniel.matyas@analog.com>,
	Andrew Davis <afd@ti.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Subject: Re: [PATCH 4/4] hwmon: (pmbus/max31827) Explain why enum chips must not start with 0
Date: Tue, 11 Jun 2024 11:07:10 +0200	[thread overview]
Message-ID: <5f329f81cdfed31771f014d4d3cc35f4d13ffb0e.camel@gmail.com> (raw)
In-Reply-To: <20240610181046.1991436-5-linux@roeck-us.net>

On Mon, 2024-06-10 at 11:10 -0700, Guenter Roeck wrote:
> If a driver calls device_get_match_data(), the .data pointer in its id
> data structures must not be NULL/0 because device_get_match_data()
> returns NULL if an entry is not found. Explain that in a comment to avoid
> confusion why this is required in this driver but not in other drivers.
> 
> Cc: Daniel Matyas <daniel.matyas@analog.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---

Acked-by: Nuno Sa <nuno.sa@analog.com>

>  drivers/hwmon/max31827.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/hwmon/max31827.c b/drivers/hwmon/max31827.c
> index f8a13b30f100..391cb059e94d 100644
> --- a/drivers/hwmon/max31827.c
> +++ b/drivers/hwmon/max31827.c
> @@ -46,6 +46,11 @@
>  #define MAX31827_M_DGR_TO_16_BIT(x)	(((x) << 4) / 1000)
>  #define MAX31827_DEVICE_ENABLE(x)	((x) ? 0xA : 0x0)
>  
> +/*
> + * The enum passed in the .data pointer of struct of_device_id must
> + * start with a value != 0 since that is a requirement for using
> + * device_get_match_data().
> + */
>  enum chips { max31827 = 1, max31828, max31829 };
>  
>  enum max31827_cnv {


      reply	other threads:[~2024-06-11  9:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-10 18:10 [PATCH 0/4] hwmon: Update handling of chip-id enums Guenter Roeck
2024-06-10 18:10 ` [PATCH 1/4] hwmon: (pmbus/lm25066) Let enum chips start with index 0 Guenter Roeck
2024-06-10 18:10 ` [PATCH 2/4] hwmon: (nct6775) Let enum kinds " Guenter Roeck
2024-06-10 18:10 ` [PATCH 3/4] hwmon: (pmbus/mp2856) Let enum chips " Guenter Roeck
2024-06-10 18:10 ` [PATCH 4/4] hwmon: (pmbus/max31827) Explain why enum chips must not start with 0 Guenter Roeck
2024-06-11  9:07   ` Nuno Sá [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5f329f81cdfed31771f014d4d3cc35f4d13ffb0e.camel@gmail.com \
    --to=noname.nuno@gmail.com \
    --cc=afd@ti.com \
    --cc=daniel.matyas@analog.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=peteryin.openbmc@gmail.com \
    --cc=potin.lai.pt@gmail.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox