public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jonathan.cameron@huawei.com>
To: Abdurrahman Hussain via B4 Relay
	<devnull+abdurrahman.nexthop.ai@kernel.org>
Cc: <abdurrahman@nexthop.ai>, Mark Brown <broonie@kernel.org>,
	Michal Simek <michal.simek@amd.com>, <linux-spi@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4] spi: xilinx: use device property accessors.
Date: Wed, 4 Feb 2026 09:51:41 +0000	[thread overview]
Message-ID: <20260204095141.0000479a@huawei.com> (raw)
In-Reply-To: <20260203-spi-xilinx-v4-1-42f7c326061b@nexthop.ai>

On Tue, 03 Feb 2026 01:55:12 +0000
Abdurrahman Hussain via B4 Relay <devnull+abdurrahman.nexthop.ai@kernel.org> 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.
> 
> 2.52.0
> 
> base-commit: 944aacb68baf7624ab8d277d0ebf07f025ca137c
> ---
> Changes in v4:
> - Removed patches making the irq optional.
> - Link to v3: https://lore.kernel.org/r/20260122-spi-xilinx-v3-1-8cea20e82f0b@nexthop.ai
> ---
>  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,

Nothing useful is done with ret after this point, so could simplify to
the pattern of setting the default then overriding it if the property
can be successfully read.

		bits_per_word = 8;
		device_property_read_u32(&pdev->dev,
					 "xlnx,num-transfer-bits",
					 &bits_per_word);

> +					       "xlnx,num-transfer-bits",
> +					       &bits_per_word);
>  		if (ret)
>  			bits_per_word = 8;
>  	}
> 
> ---
> base-commit: 944aacb68baf7624ab8d277d0ebf07f025ca137c
> change-id: 20260118-spi-xilinx-1b884d5b6519
> 
> Best regards,


  parent reply	other threads:[~2026-02-04  9:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-03  1:55 [PATCH v4] spi: xilinx: use device property accessors Abdurrahman Hussain via B4 Relay
2026-02-03 12:48 ` Mark Brown
2026-02-03 18:16   ` Abdurrahman Hussain
2026-02-03 18:19     ` Mark Brown
2026-02-04  9:51 ` Jonathan Cameron [this message]
2026-02-04 12:01 ` Mark Brown

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=20260204095141.0000479a@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=abdurrahman@nexthop.ai \
    --cc=broonie@kernel.org \
    --cc=devnull+abdurrahman.nexthop.ai@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=michal.simek@amd.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