[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <95b95cde-c93c-404a-a520-4bf77c62a03a@linaro.org>
Date: Tue, 30 Apr 2024 09:56:47 +0200
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Witold Sadowski <wsadowski@...vell.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-spi@...r.kernel.org" <linux-spi@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
Cc: "broonie@...nel.org" <broonie@...nel.org>,
"robh@...nel.org" <robh@...nel.org>,
"krzysztof.kozlowski+dt@...aro.org" <krzysztof.kozlowski+dt@...aro.org>,
"conor+dt@...nel.org" <conor+dt@...nel.org>,
"pthombar@...ence.com" <pthombar@...ence.com>
Subject: Re: [EXTERNAL] Re: [PATCH 2/5] spi: cadence: Add Marvell IP
modification changes
On 29/04/2024 16:55, Witold Sadowski wrote:
>>
>>> +
>>> +static bool cdns_xspi_get_hw_overlay(struct platform_device *pdev) {
>>> + int err;
>>> +
>>> + err = device_property_match_string(&pdev->dev,
>>> + "compatible", "mrvl,xspi-nor");
>>
>> No, do not add matching in some random parts of the code, but use driver
>> match/data from ID table.
>
> Ok. As I have written in different mail, a little bit of manual matching
> Will be necessary to handle both ACPI and device-tree case.
ACPI also handle variants with match data.
>
>>
>> ....
>>
>>>
>>> + cdns_xspi_print_phy_config(cdns_xspi);
>>> ret = cdns_xspi_controller_init(cdns_xspi);
>>> if (ret) {
>>> dev_err(dev, "Failed to initialize controller\n"); @@ -613,6
>> +911,9
>>> @@ static const struct of_device_id cdns_xspi_of_match[] = {
>>> {
>>> .compatible = "cdns,xspi-nor",
>>> },
>>> + {
>>> + .compatible = "mrvl,xspi-nor",
>>
>> This falsely suggest they are compatible :/
>
> I'm not sure if I understand what do you mean.
> cdns, xspi will be compatible with overlay, as it won't touch any
> additional HW. It possibly fail in second direction, as overlay
> handling code will not see expected values.
That's clear rule for almost every driver: if you do not have any match
data, it suggests entry is redundant, because devices are compatible.
There is no different treatment for SPI. As seen in other pieces of this
code, devices are not compatible, so it points to missing match data to
handle variants.
Best regards,
Krzysztof
Powered by blists - more mailing lists