mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
i2c: imx-lpi2c: use devm_platform_ioremap_resource() to simplify code
Use the new helper devm_platform_ioremap_resource() which wraps the platform_get_resource() and devm_ioremap_resource() together, to simplify the code. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Acked-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
parent
b17e6d19dc
commit
5667b5b59f
1 changed files with 1 additions and 3 deletions
|
@ -545,7 +545,6 @@ MODULE_DEVICE_TABLE(of, lpi2c_imx_of_match);
|
|||
static int lpi2c_imx_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct lpi2c_imx_struct *lpi2c_imx;
|
||||
struct resource *res;
|
||||
unsigned int temp;
|
||||
int irq, ret;
|
||||
|
||||
|
@ -553,8 +552,7 @@ static int lpi2c_imx_probe(struct platform_device *pdev)
|
|||
if (!lpi2c_imx)
|
||||
return -ENOMEM;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
lpi2c_imx->base = devm_ioremap_resource(&pdev->dev, res);
|
||||
lpi2c_imx->base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(lpi2c_imx->base))
|
||||
return PTR_ERR(lpi2c_imx->base);
|
||||
|
||||
|
|
Loading…
Reference in a new issue