Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1019490pxk; Fri, 18 Sep 2020 01:23:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOPSaAk9szltGK2mCBi9DYI4OQac651ZolynJTjRnr+wf1fsF18YEgDR90tJMQ7bGRBPbI X-Received: by 2002:a50:c8cd:: with SMTP id k13mr37727362edh.387.1600417421699; Fri, 18 Sep 2020 01:23:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600417421; cv=none; d=google.com; s=arc-20160816; b=smsi+TiyTbQEhSLwOlc9zMpD7WYHVnN/w6b49gf9hMrpYu4O3yfDBGpJRueZv+ydoC e+NdgjZ7Zflq3qsAPZ10Z+0GjtmtVuaORnTEFBxv32thpLjyYfMqUrD+LWiU6ioSs92t 9rC9wVc1vBwSD+BZT6MwD/CTk47WmUbGEyeUvXBKo3JYZqVoGs490MZrwOGBAbIWIPAp NaFHNHcJFJhItYM3N4DOFyUi5BfmUhn3IPJp7JER9WWlCaeZI/K5l3vsgnsbTgvPAoiv 2P+nj2sg6w/igkdbh+e1DvY5fl0TGX55OMgoESzQYmc4ybU3Hw3I6zK1Z5pwgnFomSij kVkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:mime-version:message-id:date:subject:cc:from; bh=sC9dAKvAHeoYPEAZcly6xwsngji6p8B8kuWvoP9MUw4=; b=cnXQFSHYMRxVacHCy3FPYmAW/pxodRbykKIa3+rQPqxPnBj22zDKjq0Jfw7z43vEiy /gHOCrg6tAW3a81CtPV3fG7Pl0t9T1qD8nBonLTv+Q9fZr0Tb/5q1ng0HpjxiN2YA9Zy vG5dcF4LJJQ1Mt4OYLAK/hY7AdGD1oL07pEwRHB7GlI/5jGp0OYo29H5UqNa8DD4USH5 5pQPYDhY5lHxbK70k5uyoUpyQod+X24TlIlxiKuhA+r6iA/GG2MwcuqFdI7q9/fLm+Bp Qf8SsnFSIJek0L6A6Dak51DSETr/OfGh2aV3Ij8uqvDAYDRU+XtsHdEA+AKqeBDdORwN 4y2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ng5si1703849ejb.532.2020.09.18.01.23.18; Fri, 18 Sep 2020 01:23:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726154AbgIRIWY (ORCPT + 99 others); Fri, 18 Sep 2020 04:22:24 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:45948 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726064AbgIRIWY (ORCPT ); Fri, 18 Sep 2020 04:22:24 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 5695AB154419F3BBBE38; Fri, 18 Sep 2020 16:22:21 +0800 (CST) Received: from huawei.com (10.175.124.27) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Fri, 18 Sep 2020 16:22:13 +0800 From: Wang ShaoBo CC: , , , , , , Subject: [PATCH -next] i2c: at91: Use devm_platform_get_and_ioremap_resource() Date: Fri, 18 Sep 2020 16:21:40 +0800 Message-ID: <20200918082140.32258-1-bobo.shaobowang@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.124.27] X-CFilter-Loop: Reflected To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make use of devm_platform_get_and_ioremap_resource() provided by driver core platform instead of duplicated analogue. Signed-off-by: Wang ShaoBo --- drivers/i2c/busses/i2c-at91-core.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/i2c/busses/i2c-at91-core.c b/drivers/i2c/busses/i2c-at91-core.c index e14edd236108..5b7781302852 100644 --- a/drivers/i2c/busses/i2c-at91-core.c +++ b/drivers/i2c/busses/i2c-at91-core.c @@ -207,19 +207,16 @@ static int at91_twi_probe(struct platform_device *pdev) dev->dev = &pdev->dev; - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!mem) - return -ENODEV; + dev->base = devm_platform_get_and_ioremap_resource(pdev, 0, &mem); + if (IS_ERR(dev->base)) + return PTR_ERR(dev->base); + phy_addr = mem->start; dev->pdata = at91_twi_get_driver_data(pdev); if (!dev->pdata) return -ENODEV; - dev->base = devm_ioremap_resource(&pdev->dev, mem); - if (IS_ERR(dev->base)) - return PTR_ERR(dev->base); - dev->irq = platform_get_irq(pdev, 0); if (dev->irq < 0) return dev->irq; -- 2.17.1