[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7a08dcf4-e6d4-ef60-48d2-81275a7d7a6e@linaro.org>
Date: Thu, 6 Jul 2023 08:08:00 +0200
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Valentin CARON <valentin.caron@...s.st.com>,
Mark Brown <broonie@...nel.org>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Alain Volmat <alain.volmat@...s.st.com>,
linux-spi@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] spi: stm32: disable device mode with st,stm32f4-spi
compatible
On 05/07/2023 19:16, Valentin CARON wrote:
> Hi, Krzysztof
>
> On 7/1/23 10:09, Krzysztof Kozlowski wrote:
>> On 28/06/2023 18:21, Valentin CARON wrote:
>>> Hi,
>>>
>>> On 6/27/23 15:39, Krzysztof Kozlowski wrote:
>>>> On 27/06/2023 14:39, Valentin Caron wrote:
>>>>> STM32 SPI driver is not capable to handle device mode with stm32f4 soc.
>>>>> Stop probing if this case happens, and print an error with involved
>>>>> compatible.
>>>>>
>>>> ...
>>>>
>>>>>
>>>>> static const struct of_device_id stm32_spi_of_match[] = {
>>>>> @@ -1798,8 +1802,16 @@ static int stm32_spi_probe(struct platform_device *pdev)
>>>>> struct device_node *np = pdev->dev.of_node;
>>>>> bool device_mode;
>>>>> int ret;
>>>>> + const char *compatible =
>>>>> + of_match_device(pdev->dev.driver->of_match_table, &pdev->dev)->compatible;
>>>> The goal was to replace it, so drop it.
>>> Is is still needed for dev_err, so I can't
>> Why do you need it for dev_err? Isn't it entirely redundant?
>>
>> Best regards,
>> Krzysztof
>>
> Only to have a clearer error message. To let know to user that spi
> device is not available on this device.
It's obvious from the probe error.
> Right now, there is only one compatible where spi device can't be
> enable. So I could use a static message. But this is not the best if a
> new compatible is added.
It does not make sense. Compatible changes here nothing. It does not
matter whether your driver supports one or two devices. Not mentioning
that errors are printed with device ID.
Drop this code, it's entirely useless.
Best regards,
Krzysztof
Powered by blists - more mailing lists