drivers/spi/spi-xilinx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
From: Abdurrahman Hussain <abdurrahman@nexthop.ai>
Switch to device property accessors.
Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
---
Switch to generic device property accessors.
Changed from v3:
Removed the patches to make irq optional from the series
2.52.0
base-commit: 944aacb68baf7624ab8d277d0ebf07f025ca137c
---
drivers/spi/spi-xilinx.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c
index c86dc56f38b4..c4b70e95b695 100644
--- a/drivers/spi/spi-xilinx.c
+++ b/drivers/spi/spi-xilinx.c
@@ -405,11 +405,11 @@ static int xilinx_spi_probe(struct platform_device *pdev)
bits_per_word = pdata->bits_per_word;
force_irq = pdata->force_irq;
} else {
- of_property_read_u32(pdev->dev.of_node, "xlnx,num-ss-bits",
- &num_cs);
- ret = of_property_read_u32(pdev->dev.of_node,
- "xlnx,num-transfer-bits",
- &bits_per_word);
+ device_property_read_u32(&pdev->dev, "xlnx,num-ss-bits",
+ &num_cs);
+ ret = device_property_read_u32(&pdev->dev,
+ "xlnx,num-transfer-bits",
+ &bits_per_word);
if (ret)
bits_per_word = 8;
}
---
base-commit: 944aacb68baf7624ab8d277d0ebf07f025ca137c
change-id: 20260118-spi-xilinx-1b884d5b6519
Best regards,
--
Abdurrahman Hussain <abdurrahman@nexthop.ai>
On Thu, 22 Jan 2026 09:00:29 +0000, Abdurrahman Hussain wrote:
> Switch to device property accessors.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: xilinx: use device property accessors.
commit: 4cc4ace709860c37f7f8019e950380a4694eb101
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
On Thu, Jan 22, 2026 at 09:00:29AM +0000, Abdurrahman Hussain via B4 Relay wrote:
> From: Abdurrahman Hussain <abdurrahman@nexthop.ai>
>
> Switch to device property accessors.
>
> Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
> ---
> Switch to generic device property accessors.
>
> Changed from v3:
>
> Removed the patches to make irq optional from the series
>
> 2.52.0
>
> base-commit: 944aacb68baf7624ab8d277d0ebf07f025ca137c
> ---
> drivers/spi/spi-xilinx.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c
> index c86dc56f38b4..c4b70e95b695 100644
> --- a/drivers/spi/spi-xilinx.c
> +++ b/drivers/spi/spi-xilinx.c
> @@ -405,11 +405,11 @@ static int xilinx_spi_probe(struct platform_device *pdev)
> bits_per_word = pdata->bits_per_word;
> force_irq = pdata->force_irq;
> } else {
> - of_property_read_u32(pdev->dev.of_node, "xlnx,num-ss-bits",
> - &num_cs);
> - ret = of_property_read_u32(pdev->dev.of_node,
> - "xlnx,num-transfer-bits",
> - &bits_per_word);
> + device_property_read_u32(&pdev->dev, "xlnx,num-ss-bits",
> + &num_cs);
> + ret = device_property_read_u32(&pdev->dev,
> + "xlnx,num-transfer-bits",
> + &bits_per_word);
It could be my grep foo is broken, but there does not appear to be any
users of xlnx,num-transfer-bits and xlnx,num-ss-bits. So it would be
better to just remove them. There is no point Maintaining an API
nobody uses. And it would be silly to spread that API to ACPI if
nobody it going to use it.
Andrew
On 1/22/26 17:18, Andrew Lunn wrote:
> On Thu, Jan 22, 2026 at 09:00:29AM +0000, Abdurrahman Hussain via B4 Relay wrote:
>> From: Abdurrahman Hussain <abdurrahman@nexthop.ai>
>>
>> Switch to device property accessors.
>>
>> Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
>> ---
>> Switch to generic device property accessors.
>>
>> Changed from v3:
>>
>> Removed the patches to make irq optional from the series
>>
>> 2.52.0
>>
>> base-commit: 944aacb68baf7624ab8d277d0ebf07f025ca137c
>> ---
>> drivers/spi/spi-xilinx.c | 10 +++++-----
>> 1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c
>> index c86dc56f38b4..c4b70e95b695 100644
>> --- a/drivers/spi/spi-xilinx.c
>> +++ b/drivers/spi/spi-xilinx.c
>> @@ -405,11 +405,11 @@ static int xilinx_spi_probe(struct platform_device *pdev)
>> bits_per_word = pdata->bits_per_word;
>> force_irq = pdata->force_irq;
>> } else {
>> - of_property_read_u32(pdev->dev.of_node, "xlnx,num-ss-bits",
>> - &num_cs);
>> - ret = of_property_read_u32(pdev->dev.of_node,
>> - "xlnx,num-transfer-bits",
>> - &bits_per_word);
>> + device_property_read_u32(&pdev->dev, "xlnx,num-ss-bits",
>> + &num_cs);
>> + ret = device_property_read_u32(&pdev->dev,
>> + "xlnx,num-transfer-bits",
>> + &bits_per_word);
>
> It could be my grep foo is broken, but there does not appear to be any
> users of xlnx,num-transfer-bits and xlnx,num-ss-bits. So it would be
> better to just remove them. There is no point Maintaining an API
> nobody uses. And it would be silly to spread that API to ACPI if
> nobody it going to use it.
>
"xlnx,num-transfer-bits"
bits_per_word is initializing bytes_per_word which is used in code for transfer
sizes calculations.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/spi/spi-xilinx.c?h=v6.19-rc6#n470
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/spi/spi-xilinx.c?h=v6.19-rc6#n125
"xlnx,num-ss-bits"
num_cs is used in host->num_chipselect to declare amount of chip selects.
Both are also the part of DT bindings. The name of property exactly match the
name used in design tool. That's why it is 1:1 mapping and driver is quite old
before num-cs property has been created.
Thanks,
Michal
On Fri, Jan 23, 2026 at 08:11:47AM +0100, Michal Simek wrote: > On 1/22/26 17:18, Andrew Lunn wrote: > > On Thu, Jan 22, 2026 at 09:00:29AM +0000, Abdurrahman Hussain via B4 Relay wrote: > > > + ret = device_property_read_u32(&pdev->dev, > > > + "xlnx,num-transfer-bits", > > > + &bits_per_word); > > It could be my grep foo is broken, but there does not appear to be any > > users of xlnx,num-transfer-bits and xlnx,num-ss-bits. So it would be > > better to just remove them. There is no point Maintaining an API > > nobody uses. And it would be silly to spread that API to ACPI if > > nobody it going to use it. There are no upstream users of this driver at all so obviously no use of the properties. > "xlnx,num-transfer-bits" > bits_per_word is initializing bytes_per_word which is used in code for > transfer sizes calculations. The example AML posted was setting xlnx,num-transfer-bits to the default value of 8 bits FWIW.
On 1/23/26 13:40, Mark Brown wrote: > On Fri, Jan 23, 2026 at 08:11:47AM +0100, Michal Simek wrote: >> On 1/22/26 17:18, Andrew Lunn wrote: >>> On Thu, Jan 22, 2026 at 09:00:29AM +0000, Abdurrahman Hussain via B4 Relay wrote: > >>>> + ret = device_property_read_u32(&pdev->dev, >>>> + "xlnx,num-transfer-bits", >>>> + &bits_per_word); > >>> It could be my grep foo is broken, but there does not appear to be any >>> users of xlnx,num-transfer-bits and xlnx,num-ss-bits. So it would be >>> better to just remove them. There is no point Maintaining an API >>> nobody uses. And it would be silly to spread that API to ACPI if >>> nobody it going to use it. > > There are no upstream users of this driver at all so obviously no use of > the properties. We are not wiring this driver in any DT because it is soft IP but it doesn't mean that it is not used. But as you see Abdurrahman is able to use this driver is one configuration. These properties are stable for years and well documented. Thanks, Michal
On Fri, Jan 23, 2026 at 03:14:22PM +0100, Michal Simek wrote: > On 1/23/26 13:40, Mark Brown wrote: > > On Fri, Jan 23, 2026 at 08:11:47AM +0100, Michal Simek wrote: > > > On 1/22/26 17:18, Andrew Lunn wrote: > > > > On Thu, Jan 22, 2026 at 09:00:29AM +0000, Abdurrahman Hussain via B4 Relay wrote: > > > > > + ret = device_property_read_u32(&pdev->dev, > > > > > + "xlnx,num-transfer-bits", > > > > > + &bits_per_word); > > > > It could be my grep foo is broken, but there does not appear to be any > > > > users of xlnx,num-transfer-bits and xlnx,num-ss-bits. So it would be > > > > better to just remove them. There is no point Maintaining an API > > > > nobody uses. And it would be silly to spread that API to ACPI if > > > > nobody it going to use it. > > There are no upstream users of this driver at all so obviously no use of > > the properties. > We are not wiring this driver in any DT because it is soft IP but it doesn't > mean that it is not used. > But as you see Abdurrahman is able to use this driver is one configuration. > These properties are stable for years and well documented. My point here is that Andrew's concern about there being no users is not relevant.
© 2016 - 2026 Red Hat, Inc.