soc: fsl: guts: Make use of the helper function devm_platform_ioremap_resource()
Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately Signed-off-by: Cai Huoqing <caihuoqing@baidu.com> Signed-off-by: Li Yang <leoyang.li@nxp.com>
This commit is contained in:
parent
6880fa6c56
commit
e0162129c6
@ -140,7 +140,6 @@ static int fsl_guts_probe(struct platform_device *pdev)
|
|||||||
{
|
{
|
||||||
struct device_node *np = pdev->dev.of_node;
|
struct device_node *np = pdev->dev.of_node;
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct resource *res;
|
|
||||||
const struct fsl_soc_die_attr *soc_die;
|
const struct fsl_soc_die_attr *soc_die;
|
||||||
const char *machine;
|
const char *machine;
|
||||||
u32 svr;
|
u32 svr;
|
||||||
@ -152,8 +151,7 @@ static int fsl_guts_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
guts->little_endian = of_property_read_bool(np, "little-endian");
|
guts->little_endian = of_property_read_bool(np, "little-endian");
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
guts->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||||
guts->regs = devm_ioremap_resource(dev, res);
|
|
||||||
if (IS_ERR(guts->regs))
|
if (IS_ERR(guts->regs))
|
||||||
return PTR_ERR(guts->regs);
|
return PTR_ERR(guts->regs);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user