mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>
Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND 3/3] iommu: omap: Use syscon_regmap_lookup_by_phandle_args
Date: Thu, 13 Feb 2025 11:40:32 +0000	[thread overview]
Message-ID: <e8d2b014-499c-4cbc-95b6-6ed227c4c920@arm.com> (raw)
In-Reply-To: <20250212-syscon-phandle-args-iommu-v1-3-c3fab486b426@linaro.org>

On 2025-02-12 8:19 pm, Krzysztof Kozlowski wrote:
> Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
> syscon_regmap_lookup_by_phandle() combined with getting the syscon
> argument.  Except simpler code this annotates within one line that given
> phandle has arguments, so grepping for code would be easier.
> 
> There is also no real benefit in printing errors on missing syscon
> argument, because this is done just too late: runtime check on
> static/build-time data.  Dtschema and Devicetree bindings offer the
> static/build-time check for this already.

With my suggestion for capturing a more useful general error in the 
other change, I agree with this one.

Reviewed-by: Robin Murphy <robin.murphy@arm.com>

> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>   drivers/iommu/omap-iommu.c | 10 ++--------
>   1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
> index bce27805805010ae473aa8dbd9e0cb903dd79bba..f12812d3f828ad382c7a84f6ecd604c8f35a6d10 100644
> --- a/drivers/iommu/omap-iommu.c
> +++ b/drivers/iommu/omap-iommu.c
> @@ -1127,19 +1127,13 @@ static int omap_iommu_dra7_get_dsp_system_cfg(struct platform_device *pdev,
>   	if (!of_device_is_compatible(np, "ti,dra7-dsp-iommu"))
>   		return 0;
>   
> -	obj->syscfg =
> -		syscon_regmap_lookup_by_phandle(np, "ti,syscon-mmuconfig");
> +	obj->syscfg = syscon_regmap_lookup_by_phandle_args(np, "ti,syscon-mmuconfig",
> +							   1, &obj->id);
>   	if (IS_ERR(obj->syscfg)) {
>   		/* can fail with -EPROBE_DEFER */
>   		return PTR_ERR(obj->syscfg);
>   	}
>   
> -	if (of_property_read_u32_index(np, "ti,syscon-mmuconfig", 1,
> -				       &obj->id)) {
> -		dev_err(&pdev->dev, "couldn't get the IOMMU instance id within subsystem\n");
> -		return -EINVAL;
> -	}
> -
>   	if (obj->id != 0 && obj->id != 1) {
>   		dev_err(&pdev->dev, "invalid IOMMU instance id\n");
>   		return -EINVAL;
> 


      reply	other threads:[~2025-02-13 11:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-12 20:19 [PATCH RESEND 0/3] iommu: omap: Simplify few things Krzysztof Kozlowski
2025-02-12 20:19 ` [PATCH RESEND 1/3] iommu: omap: Drop redundant check if ti,syscon-mmuconfig exists Krzysztof Kozlowski
2025-02-12 20:19 ` [PATCH RESEND 2/3] iommu: omap: Simplify returning syscon PTR_ERR Krzysztof Kozlowski
2025-02-13 11:30   ` Robin Murphy
2025-02-14  7:27     ` Krzysztof Kozlowski
2025-02-12 20:19 ` [PATCH RESEND 3/3] iommu: omap: Use syscon_regmap_lookup_by_phandle_args Krzysztof Kozlowski
2025-02-13 11:40   ` Robin Murphy [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=e8d2b014-499c-4cbc-95b6-6ed227c4c920@arm.com \
    --to=robin.murphy@arm.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=will@kernel.org \
    /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®