From patchwork Thu Jun 6 16:44:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10980075 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EAAA015E6 for ; Thu, 6 Jun 2019 16:45:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D66CB28942 for ; Thu, 6 Jun 2019 16:45:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C85A328972; Thu, 6 Jun 2019 16:45:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C02A28949 for ; Thu, 6 Jun 2019 16:45:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726744AbfFFQpE (ORCPT ); Thu, 6 Jun 2019 12:45:04 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:43310 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726379AbfFFQpD (ORCPT ); Thu, 6 Jun 2019 12:45:03 -0400 Received: by mail-qt1-f194.google.com with SMTP id z24so3398445qtj.10 for ; Thu, 06 Jun 2019 09:45:03 -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; bh=U+er66nDJidQ6nB58sEzOJg4BlXk/c0Ijq6UBsIMJXo=; b=m2F5WTYlWialE81j6D3Qz0KT8Jit3JmkXEp4BqfMfgBJabs0NMut76/ktVkaGIE2i1 emKGUhvIyW/SVhUGXgV0s35bkZqSE14FAvch5FtEx7O0Gm7DibMf4xs1wUyh5cK7Fyhh Pp4f8IvGxFJ5epz9nGbyZl8aejagrAS/dD50EoPC2augNwkHOISAHfDCfbp8f6q/avpi RXxxf4zY1BLw2n/VfwrZuZ3RoIwMm1I3KuLnIA68ulkwllaz8BfDcye7AemqGWzU15iv WaZF4NxvyPulX+EG0iyHvrrH0hoKYju9+5y8aLYSVFTNewr7S8/kAqXesUzhTqdJ28np +/oQ== 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; bh=U+er66nDJidQ6nB58sEzOJg4BlXk/c0Ijq6UBsIMJXo=; b=Z64wReNHTBM8v8CFHBerGTT/YGUV8y2m+svEEpLy94G+LQ2gfQy+TWJxHgi5A4CF1x W4crmae+11CszjC9Hf/yijksjXet8o/k7tZELR4CsEzLnWNOf53EnD4AaVEVejtoKQpQ /Of/O+hCix2XVFfK6GHQIk5Q4Pr57X0VzzMLvtI4sNX+SNo/gIEH2lQR9MrECyLHzUjs s6I6t1XHVQdwIlqXCd9rHB5XjZtlpdkmuVMF3UNAHWYKUbZYkiZb7L+LWkOPa8DBu4GX C9/ZC5T5q2hwp8/yDI3bGqaj9ZqeUrxJYXU7tp8GMaL4Gik79tFQiRohiUAqDyyVsSkJ 907g== X-Gm-Message-State: APjAAAXcBtNu0hmvSk12RbmxFHRcFe69sfuw3UJkhJr/1vckDsiZESQd YHiozMwBg5GQwMtygW1hlZM= X-Google-Smtp-Source: APXvYqzOnnoPWUYbQqkAxkW7m4Pc7gtv8y8PTip+tOvyvaM04rClF/axwk3VETImmzrr6i73nyiezA== X-Received: by 2002:a0c:d0b6:: with SMTP id z51mr26723234qvg.3.1559839502661; Thu, 06 Jun 2019 09:45:02 -0700 (PDT) Received: from fabio-Latitude-E5450.am.freescale.net ([177.221.114.206]) by smtp.gmail.com with ESMTPSA id y19sm1402144qty.43.2019.06.06.09.44.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Jun 2019 09:45:01 -0700 (PDT) From: Fabio Estevam To: sboyd@kernel.org Cc: shawnguo@kernel.org, linux-imx@nxp.com, linux-clk@vger.kernel.org, Fabio Estevam Subject: [PATCH] clk: imx8qxp: Use devm_platform_ioremap_resource() Date: Thu, 6 Jun 2019 13:44:43 -0300 Message-Id: <20190606164443.6991-1-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use devm_platform_ioremap_resource() to simplify the code a bit. Signed-off-by: Fabio Estevam Reviewed-by: Stephen Boyd --- drivers/clk/imx/clk-imx8qxp-lpcg.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/clk/imx/clk-imx8qxp-lpcg.c b/drivers/clk/imx/clk-imx8qxp-lpcg.c index fb6edf1b8aa2..716af92242d2 100644 --- a/drivers/clk/imx/clk-imx8qxp-lpcg.c +++ b/drivers/clk/imx/clk-imx8qxp-lpcg.c @@ -159,7 +159,6 @@ static int imx8qxp_lpcg_clk_probe(struct platform_device *pdev) struct clk_hw_onecell_data *clk_data; const struct imx8qxp_ss_lpcg *ss_lpcg; const struct imx8qxp_lpcg_data *lpcg; - struct resource *res; struct clk_hw **clks; void __iomem *base; int i; @@ -168,12 +167,9 @@ static int imx8qxp_lpcg_clk_probe(struct platform_device *pdev) if (!ss_lpcg) return -ENODEV; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -EINVAL; - base = devm_ioremap(dev, res->start, resource_size(res)); - if (!base) - return -ENOMEM; + base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(base)) + return PTR_ERR(base); clk_data = devm_kzalloc(&pdev->dev, struct_size(clk_data, hws, ss_lpcg->num_max), GFP_KERNEL);