From: Heiko Stuebner <heiko@sntech.de>
To: Vinod Koul <vkoul@kernel.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Yangtao Li <frank.li@vivo.com>
Cc: Yangtao Li <frank.li@vivo.com>,
linux-phy@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] phy: rockchip: phy-rockchip-typec: Use devm_platform_get_and_ioremap_resource()
Date: Tue, 11 Jul 2023 15:39:28 +0200 [thread overview]
Message-ID: <4152701.ElGaqSPkdT@phil> (raw)
In-Reply-To: <20230705090126.26854-2-frank.li@vivo.com>
Am Mittwoch, 5. Juli 2023, 11:01:24 CEST schrieb Yangtao Li:
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Though I guess we should check if the res variable can be removed
too.
devm_platform_get_and_ioremap_resource() checks for its "res"
parameter to be not-NULL. So if nothing in the driver itself
is using the actual resource, res could be removed and get
replaced by "NULL" when calling devm_platform_get_and_ioremap_resource()
Heiko
> ---
> drivers/phy/rockchip/phy-rockchip-typec.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c
> index 8b1667be4915..4efcb78b0ab1 100644
> --- a/drivers/phy/rockchip/phy-rockchip-typec.c
> +++ b/drivers/phy/rockchip/phy-rockchip-typec.c
> @@ -1116,8 +1116,7 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
> return -EINVAL;
> }
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - tcphy->base = devm_ioremap_resource(dev, res);
> + tcphy->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
> if (IS_ERR(tcphy->base))
> return PTR_ERR(tcphy->base);
>
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-07-11 13:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230705090126.26854-1-frank.li@vivo.com>
2023-07-05 9:01 ` [PATCH 2/4] phy: rockchip: phy-rockchip-typec: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-11 13:39 ` Heiko Stuebner [this message]
2023-07-05 9:01 ` [PATCH 4/4] phy: mediatek: tphy: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-05 9:22 ` AngeloGioacchino Del Regno
2023-07-05 9:30 ` Yangtao Li
2023-07-05 10:00 ` AngeloGioacchino Del Regno
2023-07-11 5:07 ` Vinod Koul
2023-07-11 8:57 ` Chunfeng Yun (云春峰)
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=4152701.ElGaqSPkdT@phil \
--to=heiko@sntech.de \
--cc=frank.li@vivo.com \
--cc=kishon@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=vkoul@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;
as well as URLs for NNTP newsgroup(s).