Here you look at both res and dev->phy_regs.
This seems inconsistent. Can devm_platform_get_and_ioremap_resource()
return success despite res being NULL?
Andrew
Here you look at both res and dev->phy_regs.
This seems inconsistent. Can devm_platform_get_and_ioremap_resource()
return success despite res being NULL?
No, if res is NULL, devm_platform_get_and_ioremap_resource() returns failed.
But, before this patch, if the internal phy res is NULL, it doesn't
return error
code, so I checked the res to make sure it doesn't change the origin
code logic.
Thanks,
Yang
Here you look at both res and dev->phy_regs.
This seems inconsistent. Can devm_platform_get_and_ioremap_resource()
return success despite res being NULL?
No, if res is NULL, devm_platform_get_and_ioremap_resource() returns failed.
But, before this patch, if the internal phy res is NULL, it doesn't return
error
code, so I checked the res to make sure it doesn't change the origin code
logic.
O.K, so IORESOURCE_MEM, 1 is optional. By making this change, i think
you have made this less clear. So i would say it is O.K. to change the
first platform_get_resource(pdev, IORESOURCE_MEM, 0) and
devm_ioremap_resource(&pdev->dev, res) to one call, but i would leave
the second pair alone.
Andrew