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-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
WARNING: multiple messages have this Message-ID (diff)
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-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
WARNING: multiple messages have this Message-ID (diff)
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
WARNING: multiple messages have this Message-ID (diff)
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);
>
>
next prev parent reply other threads:[~2023-07-11 13:39 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-05 9:01 [PATCH 1/4] phy: marvell: phy-mvebu-cp110-comphy: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-05 9:01 ` Yangtao Li
2023-07-05 9:01 ` [PATCH 2/4] phy: rockchip: phy-rockchip-typec: " Yangtao Li
2023-07-05 9:01 ` Yangtao Li
2023-07-05 9:01 ` Yangtao Li
2023-07-05 9:01 ` Yangtao Li
2023-07-11 13:39 ` Heiko Stuebner [this message]
2023-07-11 13:39 ` Heiko Stuebner
2023-07-11 13:39 ` Heiko Stuebner
2023-07-11 13:39 ` Heiko Stuebner
2023-07-05 9:01 ` [PATCH 3/4] phy: renesas: r8a779f0-ether-serdes: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-05 9:01 ` Yangtao Li
2023-07-05 9:01 ` [PATCH 4/4] phy: mediatek: tphy: " Yangtao Li
2023-07-05 9:01 ` Yangtao Li
2023-07-05 9:01 ` Yangtao Li
2023-07-05 9:22 ` AngeloGioacchino Del Regno
2023-07-05 9:22 ` AngeloGioacchino Del Regno
2023-07-05 9:22 ` AngeloGioacchino Del Regno
2023-07-05 9:30 ` Yangtao Li
2023-07-05 9:30 ` Yangtao Li
2023-07-05 9:30 ` Yangtao Li
2023-07-05 10:00 ` AngeloGioacchino Del Regno
2023-07-05 10:00 ` AngeloGioacchino Del Regno
2023-07-05 10:00 ` AngeloGioacchino Del Regno
2023-07-11 5:07 ` Vinod Koul
2023-07-11 5:07 ` Vinod Koul
2023-07-11 5:07 ` Vinod Koul
2023-07-11 8:57 ` Chunfeng Yun (云春峰)
2023-07-11 8:57 ` Chunfeng Yun (云春峰)
2023-07-11 8:57 ` Chunfeng Yun (云春峰)
2023-07-11 5:11 ` (subset) [PATCH 1/4] phy: marvell: phy-mvebu-cp110-comphy: Use devm_platform_get_and_ioremap_resource() Vinod Koul
2023-07-11 5:11 ` Vinod Koul
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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.