linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Marek Vasut <marek.vasut@gmail.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Robert Eshleman <bobbyeshleman@gmail.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] iio: light: max44009: add missing OF device matching
Date: Sun, 12 Mar 2023 11:15:01 +0100	[thread overview]
Message-ID: <c9cfb54e-1418-ac98-9021-0c27a8bc3c20@linaro.org> (raw)
In-Reply-To: <20230311183534.1d0dfd64@jic23-huawei>

On 11/03/2023 19:35, Jonathan Cameron wrote:
> On Sat, 11 Mar 2023 13:28:17 +0100
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> 
>> On 11/03/2023 13:26, Jonathan Cameron wrote:
>>> On Sat, 11 Mar 2023 12:14:56 +0100
>>> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
>>>   
>>>> The driver currently matches only via i2c_device_id, but also has
>>>> of_device_id table:
>>>>
>>>>   drivers/iio/light/max44009.c:545:34: error: ‘max44009_of_match’ defined but not used [-Werror=unused-const-variable=]
>>>>
>>>> Fixes: 6aef699a7d7e ("iio: light: add driver for MAX44009")
>>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>  
>>>
>>> Don't use of_match_ptr() unless you are absolutely sure no other firmware
>>> route will make use of the of_match_table.
>>>
>>> In this particular case ACPI using PRP0001 is broken by that macro.  
>>
>> It's not broken because there was no matching via PRP0001 due to missing
>> table.
>>
>>>
>>> So good to set the of_match_table, but make sure to always set it
>>> and hence you don't need the __maybe_unused.  
>>
>> So you want to add PRP0001? We can, the fix is for different issue, though.
> 
> There is nothing to add.  You need to do less than you have done in this patch.
> Drop the of_match_ptr() and the __maybe_unused and PRP0001 based matching will just
> work. The PRP0001 path just uses the of_device_id table and needs no

Sure, but that's *adding a feature*. You said that "ACPI using PRP0001
is broken", but it was never here in the first place. PRP0001 *was*
already broken here, not *is*. The patch does not decrease the
functionality.

> specific support in a driver - it doesn't need an ACPI id table or anything like
> that.
> 
> It's a long story, but hindsight says that of_match_ptr() should never have
> existed as it only serves to stop things working that otherwise work for free.

Sure, I can go with ID table always present.

Best regards,
Krzysztof


  reply	other threads:[~2023-03-12 10:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-11 11:14 [PATCH 1/4] iio: adc: rcar-gyroadc: mark OF related data as maybe unused Krzysztof Kozlowski
2023-03-11 11:14 ` [PATCH 2/4] iio: dac: ad5755: " Krzysztof Kozlowski
2023-03-11 12:22   ` Jonathan Cameron
2023-03-11 12:25     ` Krzysztof Kozlowski
2023-03-11 18:31       ` Jonathan Cameron
2023-03-12 10:11         ` Krzysztof Kozlowski
2023-03-11 11:14 ` [PATCH 3/4] iio: light: max44009: add missing OF device matching Krzysztof Kozlowski
2023-03-11 12:26   ` Jonathan Cameron
2023-03-11 12:28     ` Krzysztof Kozlowski
2023-03-11 18:35       ` Jonathan Cameron
2023-03-12 10:15         ` Krzysztof Kozlowski [this message]
2023-03-11 11:14 ` [PATCH 4/4] iio: proximity: sx9500: Mark ACPI and OF related data as maybe unused Krzysztof Kozlowski
2023-03-11 12:28   ` Jonathan Cameron
2023-03-11 12:30     ` Krzysztof Kozlowski
2023-03-11 18:44       ` Jonathan Cameron
2023-03-12 10:17         ` Krzysztof Kozlowski
2023-03-12 14:14           ` Jonathan Cameron
2023-03-12 15:19             ` Krzysztof Kozlowski
2023-03-11 12:23 ` [PATCH 1/4] iio: adc: rcar-gyroadc: mark " Jonathan Cameron
2023-03-11 12:26   ` Krzysztof Kozlowski
2023-03-11 18:47     ` Jonathan Cameron

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=c9cfb54e-1418-ac98-9021-0c27a8bc3c20@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=bobbyeshleman@gmail.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marek.vasut@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).