regulator: stm32-vrefbuf: use devm_platform_ioremap_resource() to simplify code
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20191009150138.11640-1-yuehaibing@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
be446f183a
commit
73511a90b7
|
@ -181,7 +181,6 @@ static const struct regulator_desc stm32_vrefbuf_regu = {
|
||||||
|
|
||||||
static int stm32_vrefbuf_probe(struct platform_device *pdev)
|
static int stm32_vrefbuf_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct resource *res;
|
|
||||||
struct stm32_vrefbuf *priv;
|
struct stm32_vrefbuf *priv;
|
||||||
struct regulator_config config = { };
|
struct regulator_config config = { };
|
||||||
struct regulator_dev *rdev;
|
struct regulator_dev *rdev;
|
||||||
|
@ -192,8 +191,7 @@ static int stm32_vrefbuf_probe(struct platform_device *pdev)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
priv->dev = &pdev->dev;
|
priv->dev = &pdev->dev;
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
priv->base = devm_platform_ioremap_resource(pdev, 0);
|
||||||
priv->base = devm_ioremap_resource(&pdev->dev, res);
|
|
||||||
if (IS_ERR(priv->base))
|
if (IS_ERR(priv->base))
|
||||||
return PTR_ERR(priv->base);
|
return PTR_ERR(priv->base);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue