@@ -695,8 +695,7 @@ static struct mbox_chan *omap_mbox_of_xlate(struct mbox_controller *controller,
static int omap_mbox_probe(struct platform_device *pdev)
{
- struct resource *mem;
- int ret;
+ int ret, i;
struct mbox_chan *chnls;
struct omap_mbox **list, *mbox, *mboxblk;
struct omap_mbox_fifo_info *finfo, *finfoblk;
@@ -709,7 +708,6 @@ static int omap_mbox_probe(struct platform_device *pdev)
u32 num_users, num_fifos;
u32 tmp[3];
u32 l;
- int i;
if (!node) {
pr_err("%s: only DT-based devices are supported\n", __func__);
@@ -772,8 +770,7 @@ static int omap_mbox_probe(struct platform_device *pdev)
if (!mdev)
return -ENOMEM;
- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- mdev->mbox_base = devm_ioremap_resource(&pdev->dev, mem);
+ mdev->mbox_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(mdev->mbox_base))
return PTR_ERR(mdev->mbox_base);
Use devm_platform_ioremap_resource() to simplify code. 'i' and 'ret' are variables of the same type and there is no need to use two lines. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> --- drivers/mailbox/omap-mailbox.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)