* [PATCH -next] ptp: ptp_ines: convert to devm_platform_ioremap_resource
@ 2020-04-29 7:58 Wei Yongjun
2020-04-29 18:44 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2020-04-29 7:58 UTC (permalink / raw)
To: Richard Cochran; +Cc: Wei Yongjun, netdev, kernel-janitors
Use the helper function that wraps the calls to platform_get_resource()
and devm_ioremap_resource() together.
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/ptp/ptp_ines.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/ptp/ptp_ines.c b/drivers/ptp/ptp_ines.c
index 52d77db39829..7711651ff19e 100644
--- a/drivers/ptp/ptp_ines.c
+++ b/drivers/ptp/ptp_ines.c
@@ -783,16 +783,10 @@ static struct mii_timestamping_ctrl ines_ctrl = {
static int ines_ptp_ctrl_probe(struct platform_device *pld)
{
struct ines_clock *clock;
- struct resource *res;
void __iomem *addr;
int err = 0;
- res = platform_get_resource(pld, IORESOURCE_MEM, 0);
- if (!res) {
- dev_err(&pld->dev, "missing memory resource\n");
- return -EINVAL;
- }
- addr = devm_ioremap_resource(&pld->dev, res);
+ addr = devm_platform_ioremap_resource(pld, 0);
if (IS_ERR(addr)) {
err = PTR_ERR(addr);
goto out;
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-29 18:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29 7:58 [PATCH -next] ptp: ptp_ines: convert to devm_platform_ioremap_resource Wei Yongjun
2020-04-29 18:44 ` David Miller
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).