Skip to content

Commit

Permalink
i2c: riic: Use devm_platform_ioremap_resource()
Browse files Browse the repository at this point in the history
Use the devm_platform_ioremap_resource() helper instead of calling
platform_get_resource() and devm_ioremap_resource() separately.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
  • Loading branch information
Lad Prabhakar authored and Wolfram Sang committed Sep 17, 2022
1 parent 92be2c1 commit e05e470
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/i2c/busses/i2c-riic.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@ static int riic_i2c_probe(struct platform_device *pdev)
{
struct riic_dev *riic;
struct i2c_adapter *adap;
struct resource *res;
struct i2c_timings i2c_t;
struct reset_control *rstc;
int i, ret;
Expand All @@ -409,8 +408,7 @@ static int riic_i2c_probe(struct platform_device *pdev)
if (!riic)
return -ENOMEM;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
riic->base = devm_ioremap_resource(&pdev->dev, res);
riic->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(riic->base))
return PTR_ERR(riic->base);

Expand Down

0 comments on commit e05e470

Please sign in to comment.