From patchwork Tue Sep 29 22:18:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 285755 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D6B5C4727C for ; Tue, 29 Sep 2020 22:20:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1AC0320789 for ; Tue, 29 Sep 2020 22:20:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Yg/frGn/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729127AbgI2WU4 (ORCPT ); Tue, 29 Sep 2020 18:20:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729021AbgI2WUs (ORCPT ); Tue, 29 Sep 2020 18:20:48 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD2CBC0613D0; Tue, 29 Sep 2020 15:20:47 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id w11so7450428lfn.2; Tue, 29 Sep 2020 15:20:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iPlFi2S/cmjUsxvBwkanO4MpIWrGtYus5a2EcdQgd70=; b=Yg/frGn/rolI9XzUB7nA8Kchw6CrRy6HPtDENkvRX69krrlbkvWIDnuFqt7ALUvfkG wAxBYqXJ7fehtVyBVqgND8LYRLQTZM2+fiNof0czdOSYzvzsnnuyNPExtOXHfbLAYVED LZndfRsG1ggzynA1BxEVtfd0cZX0l90Xv3O4p/EEtIvgxhuyzT48WNlAMJPaZ2wLbef0 BNni6DtyC9Of2zt5wOcniaOXWTKFOiM8Dxlx9TExoQtUwA1uAZH5050gv5r+P14Ddhlu ZWOlKNHWKSS80IzBGN/8wwreuiIIGrZkRx3DPWueV6ZeT8YNVB899xtZ0kEkJgxP1ZYI YasQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iPlFi2S/cmjUsxvBwkanO4MpIWrGtYus5a2EcdQgd70=; b=kd/y9nywgPdDHrCfbYwF3go0hHTQQFhF7KkXjI8WNH3sNoE0n20Jb1znAGpu5MVq7O P5qpYwHqa0t2vOo6DToCDdcin3+c4PvFd/6/SAUsnadLpRpQg8RZjt/JiHj7TmjXHqj7 mwADYisQBJsvhZM9GfPtKpPP3qDPBGwdT22dYUV/SVmqpKVpUHqOnmNUqVdMo54svbxl Sra7jSUJ6gaz5fz0nbgFGa41FC3PPEb1bwgRlIiyHh77do6DnBdyoOhbg14bmj5LqThn iCfHZ+6hEmu2aS4/zMmxsnrmHwfZ1ZZZpBiX0V/7Xjy2aDwmV8rI9lOqUloTBRIpmVlI t3LA== X-Gm-Message-State: AOAM531XEHcEFBd1TRUqTRPUXsJ06YLvFYZVkkGQ/6k53wOgokytK7li zeuD15VsgYecUdSnsBS0Zrw= X-Google-Smtp-Source: ABdhPJw3I4PdLWyPn+X8fzoJYF2T5+EFlPJiADrmAoSXd63bQL+FU9WXb3IP0bzLS7gwSl1377tSIg== X-Received: by 2002:a19:5e4a:: with SMTP id z10mr1820526lfi.380.1601418046145; Tue, 29 Sep 2020 15:20:46 -0700 (PDT) Received: from localhost.localdomain (109-252-170-211.dynamic.spd-mgts.ru. [109.252.170.211]) by smtp.gmail.com with ESMTPSA id q18sm3379750lfr.138.2020.09.29.15.20.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Sep 2020 15:20:45 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Laxman Dewangan , Wolfram Sang , =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= , Andy Shevchenko Cc: linux-i2c@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v9 10/32] i2c: tegra: Use devm_platform_get_and_ioremap_resource() Date: Wed, 30 Sep 2020 01:18:53 +0300 Message-Id: <20200929221915.10979-11-digetx@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200929221915.10979-1-digetx@gmail.com> References: <20200929221915.10979-1-digetx@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Driver now uses devm_platform_get_and_ioremap_resource() which replaces the typical boilerplate code and makes code cleaner. Reviewed-by: Michał Mirosław Reviewed-by: Andy Shevchenko Acked-by: Thierry Reding Tested-by: Thierry Reding Signed-off-by: Dmitry Osipenko --- drivers/i2c/busses/i2c-tegra.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index 90ba2f5327c5..c2bbdf92b11f 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -1678,12 +1678,12 @@ static int tegra_i2c_probe(struct platform_device *pdev) int irq; int ret; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - base_phys = res->start; - base = devm_ioremap_resource(&pdev->dev, res); + base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(base)) return PTR_ERR(base); + base_phys = res->start; + res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!res) { dev_err(&pdev->dev, "no irq resource\n");