mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Valentin CARON <valentin.caron@foss.st.com>,
	Mark Brown <broonie@kernel.org>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Alain Volmat <alain.volmat@foss.st.com>,
	linux-spi@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] spi: stm32: disable device mode with st,stm32f4-spi compatible
Date: Thu, 6 Jul 2023 08:08:00 +0200	[thread overview]
Message-ID: <7a08dcf4-e6d4-ef60-48d2-81275a7d7a6e@linaro.org> (raw)
In-Reply-To: <ec4f025e-680f-2145-7ca8-1ee6b38baa43@foss.st.com>

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


      reply	other threads:[~2023-07-06  6:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-27 12:39 Valentin Caron
2023-06-27 13:39 ` Krzysztof Kozlowski
2023-06-28 16:21   ` Valentin CARON
2023-07-01  8:09     ` Krzysztof Kozlowski
2023-07-05 17:16       ` Valentin CARON
2023-07-06  6:08         ` Krzysztof Kozlowski [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=7a08dcf4-e6d4-ef60-48d2-81275a7d7a6e@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=alain.volmat@foss.st.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=broonie@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=valentin.caron@foss.st.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

all inboxes | Powered by JetHome®