From patchwork Thu Sep 10 00:48:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 250339 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.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 D4A4DC43461 for ; Thu, 10 Sep 2020 02:13:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8A4632080C for ; Thu, 10 Sep 2020 02:13:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ir+znU6x" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730449AbgIJCMl (ORCPT ); Wed, 9 Sep 2020 22:12:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730704AbgIJCLn (ORCPT ); Wed, 9 Sep 2020 22:11:43 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8D73C061364 for ; Wed, 9 Sep 2020 17:49:11 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id u3so2186352pjr.3 for ; Wed, 09 Sep 2020 17:49:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fo29UVf8/PljyIh0V7UDdyn+y8CbTVYNyc4tulVx7PI=; b=ir+znU6xL6b1OkCX7R39Z1qLqEWlZGR9wfyOiujIAKUzsKR5IoNbgrnqGkwrZxktmb gcICbKw2Zsumywc1HvqqXl6fBgjpDDAFn6XQV2p00uw2cqG14WvaQvXf7E2u15uA+Dbr PorV/Eu0oTnYnF62DFpJXiCS2bnEpBx2PKqpo= 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=fo29UVf8/PljyIh0V7UDdyn+y8CbTVYNyc4tulVx7PI=; b=UXUlkeNqxWJW73rUlLTh+vaS4HSP68ZI267qgc27YyOAhQgs3ZUhTyJC7O9twRiryH B7wXq0MFJLsCCGm83KNqbgg0ZoE5UHaziwvhBb5/wXBx1/F5NQwimrcByl6foKEm1hvA HcRbfGtJfY6YB2k+/DHRi67CWbz4q3KeDWMAvSg/Z0qheSxy9r91leyfWdEvpP2kfSAm GIMi03rJlQXLmUWLT1M37l59tV9jnKtxXm9RBCLMJ7y4ZkZe14p/wzByIx+0uwECsmcC SYyy/p9TB6iiFbEIeJ05BV6X0hg7/EqQL7+kF4geKWaFxa1IFC7RBqbHU0ghnaWSw3LS 9dcA== X-Gm-Message-State: AOAM532zdRaB43kTZyLR8DhDNVVX2r/E/MbU4QLQS3OalmpFS3bk3bHG NcDs28woXu3kkvNcmsFoVEg2Pg== X-Google-Smtp-Source: ABdhPJw1oxbn4IRJbY/MRML/Jli8FgJ/MJ0l59c4coFcCsIa5f7pOcW31SOyEPCKfDUGHY+rCf+lWg== X-Received: by 2002:a17:90a:8909:: with SMTP id u9mr3006045pjn.119.1599698951298; Wed, 09 Sep 2020 17:49:11 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:3e52:82ff:fe6c:83ab]) by smtp.gmail.com with ESMTPSA id c7sm3899050pfj.100.2020.09.09.17.49.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 17:49:10 -0700 (PDT) From: Stephen Boyd To: Kishon Vijay Abraham I , Vinod Koul Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Bjorn Andersson , Jeykumar Sankaran , Chandan Uddaraju , Vara Reddy , Tanmay Shah , Manu Gautam , Sandeep Maheswaram , Douglas Anderson , Sean Paul , Jonathan Marek , Dmitry Baryshkov , Rob Clark Subject: [PATCH v3 06/10] phy: qcom-qmp: Use devm_platform_ioremap_resource() to simplify Date: Wed, 9 Sep 2020 17:48:58 -0700 Message-Id: <20200910004902.2252694-7-swboyd@chromium.org> X-Mailer: git-send-email 2.28.0.526.ge36021eeef-goog In-Reply-To: <20200910004902.2252694-1-swboyd@chromium.org> References: <20200910004902.2252694-1-swboyd@chromium.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org We can use the wrapper API here to save some lines and remove the need for the 'base' and 'res' local variable. Suggested-by: Bjorn Andersson Cc: Jeykumar Sankaran Cc: Chandan Uddaraju Cc: Vara Reddy Cc: Tanmay Shah Cc: Bjorn Andersson Cc: Manu Gautam Cc: Sandeep Maheswaram Cc: Douglas Anderson Cc: Sean Paul Cc: Jonathan Marek Cc: Dmitry Baryshkov Cc: Rob Clark Signed-off-by: Stephen Boyd --- drivers/phy/qualcomm/phy-qcom-qmp.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c index 215abd179e74..ecfcc97277f9 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c @@ -3235,10 +3235,8 @@ static int qcom_qmp_phy_probe(struct platform_device *pdev) { struct qcom_qmp *qmp; struct device *dev = &pdev->dev; - struct resource *res; struct device_node *child; struct phy_provider *phy_provider; - void __iomem *base; void __iomem *serdes; const struct qmp_phy_cfg *cfg; int num, id; @@ -3256,13 +3254,10 @@ static int qcom_qmp_phy_probe(struct platform_device *pdev) if (!cfg) return -EINVAL; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - base = devm_ioremap_resource(dev, res); - if (IS_ERR(base)) - return PTR_ERR(base); - /* per PHY serdes; usually located at base address */ - serdes = base; + serdes = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(serdes)) + return PTR_ERR(serdes); /* per PHY dp_com; if PHY has dp_com control block */ if (cfg->has_phy_dp_com_ctrl) {