soc: imx: gpcv2: Use kemdup() function
Fabio Estevam
reviewerPATCH 1/1 soc: imx: gpcv2: Use kemdup() function
From: Fabio Estevam <[email protected]>
Use kmemdup() rather than duplicating its implementation.
Detected with Coccinelle script.
Signed-off-by Fabio Estevam <[email protected]>
--- drivers/soc/imx/gpcv2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/soc/imx/gpcv2.c +2 -3
@@ -322,13 +322,12 @@ static int imx_gpcv2_probe(struct platform_device *pdev)continue ; } - domain =kmalloc (sizeof (*domain),GFP_KERNEL ); + domain =kmemdup (&imx7_pgc_domains[domain_index], +sizeof (*domain),GFP_KERNEL );if (!domain) {of_node_put (np);return -ENOMEM ; } -memcpy (domain, &imx7_pgc_domains[domain_index], -sizeof (*domain)); domain->regmap = regmap; domain->genpd.power_on = imx7_gpc_pu_pgc_sw_pup_req;
Signature · 1 line
2.7.4