Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp543201pxu; Tue, 6 Oct 2020 12:35:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0cJ0qc/P4OQTGtMciyrN1Ajx3bCdpL2o9j5O00p9fSuealaS48++DRo78YhF1ekar8SrF X-Received: by 2002:a50:cd48:: with SMTP id d8mr7182473edj.286.1602012934988; Tue, 06 Oct 2020 12:35:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602012934; cv=none; d=google.com; s=arc-20160816; b=m+CgpDXChxRTnfE+VcnOZx7fBHWf0HxrP/s46CD28E/6RVscR8R1B29h4TsK/y+sEi fo+iQCe9FB0GC4NcFH952U8Dd0YmBsbJkr9skl5ptC5YsUHaIynETyWVt5HEeJnlbGtM tHr+gqXYAj4k8DdwYLxzeBUCAo01uDTRoVUFwRTJOpsCdbKAJ7mntERHUL4sNOGwXTvD NTsug3czenzuZeVb8nOKBf5IyUUlB98/4D4GkQvFkV6U3fxY722Tphc00RfWtmbRiRiY vxP7mVCh6rRpQw5ExpRKab97gPNB8AdCyt8eOuQRB9F6wNzfOSsvOgQSLsLC4AEpRGpb 9kaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=z1iSONtEJ6npa8TkuQqAElR95oxPfpBAqek5gQmx1jw=; b=NyvZvRuLMXZPHD0mv37/BlYEuT/ozeHM1lDG/Fj2uXLU87kF3jOAdPAy/WIxSYLLNC Xj3tiJaSu5bHvRv1CsgXbHYitAqw9QJCrHLd21aKG+tGMmerSX30JQuLPvTf5azuCULs tbN/Jir23jfjHpnOCwvfdePvSU46v/gdXozzzwhhsS155giB42jeDVneudCWZ5ITlAlu cjN/qzFqVKoYA0eYuVW2TpoRs7MAagyvporr+Mjwhewt5z0a+q5NbJ0OVcGzV3rLp1Bp VujfCY4sK0V7hE01+dg2ZDuic2Y4/FQ94Z59oXJm8MVkD5WggaJv5Sqz9kYyb5i3HZc5 EwQA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gg18si2846248ejb.184.2020.10.06.12.35.12; Tue, 06 Oct 2020 12:35:34 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727186AbgJFTde (ORCPT + 99 others); Tue, 6 Oct 2020 15:33:34 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:38208 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727163AbgJFTdb (ORCPT ); Tue, 6 Oct 2020 15:33:31 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id C497229BD86 From: Enric Balletbo i Serra To: linux-kernel@vger.kernel.org Cc: Collabora Kernel ML , yongqiang.niu@mediatek.com, matthias.bgg@gmail.com, drinkcat@chromium.org, hsinyi@chromium.org, chunkuang.hu@kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 2/4] soc: mediatek: mmsys: Use devm_platform_ioremap_resource() Date: Tue, 6 Oct 2020 21:33:18 +0200 Message-Id: <20201006193320.405529-3-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201006193320.405529-1-enric.balletbo@collabora.com> References: <20201006193320.405529-1-enric.balletbo@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For the common platform_get_resource()+devm_platform_ioremap() combination, there is a helper, so use it and make the code a bit more compact. Signed-off-by: Enric Balletbo i Serra --- drivers/soc/mediatek/mtk-mmsys.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c index 36ad66bb221b..18f93979e14a 100644 --- a/drivers/soc/mediatek/mtk-mmsys.c +++ b/drivers/soc/mediatek/mtk-mmsys.c @@ -306,15 +306,12 @@ static int mtk_mmsys_probe(struct platform_device *pdev) struct platform_device *clks; struct platform_device *drm; void __iomem *config_regs; - struct resource *mem; int ret; - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - config_regs = devm_ioremap_resource(dev, mem); + config_regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(config_regs)) { ret = PTR_ERR(config_regs); - dev_err(dev, "Failed to ioremap mmsys-config resource: %d\n", - ret); + dev_err(dev, "Failed to ioremap mmsys registers: %d\n", ret); return ret; } -- 2.28.0