pwm: clps711x: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
This commit is contained in:
Родитель
6e0301e7df
Коммит
3151b13017
|
@ -113,14 +113,12 @@ static struct pwm_device *clps711x_pwm_xlate(struct pwm_chip *chip,
|
|||
static int clps711x_pwm_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct clps711x_chip *priv;
|
||||
struct resource *res;
|
||||
|
||||
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
|
||||
if (!priv)
|
||||
return -ENOMEM;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
priv->pmpcon = devm_ioremap_resource(&pdev->dev, res);
|
||||
priv->pmpcon = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(priv->pmpcon))
|
||||
return PTR_ERR(priv->pmpcon);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче