From patchwork Wed Sep 2 23:02:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 11752021 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CCDD7109A for ; Wed, 2 Sep 2020 23:03:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A868020E65 for ; Wed, 2 Sep 2020 23:03:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="HDg7f1G5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727944AbgIBXDJ (ORCPT ); Wed, 2 Sep 2020 19:03:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727867AbgIBXCZ (ORCPT ); Wed, 2 Sep 2020 19:02:25 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E992C061251 for ; Wed, 2 Sep 2020 16:02:25 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id u128so603459pfb.6 for ; Wed, 02 Sep 2020 16:02:25 -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=HDg7f1G5aO4bdVrUsKV65hlrChf4DEJoiAQKM72+sfHccEtiSaoo0TpUruopFki4I8 5pnYD1GT+UG8DL6N9MixoVeMQfyJfnwRYP5rw7uQa/Qvxfcs/uuqk4+1gACXywtLfIvq WwPBP+NiY+dJufBivyw3Oyiloc9Ebtgxfs9Yg= 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=tZ2pEHeNsPXsidkNOm9sBP/NlORCCum/iUFueonE57ClPaU/y5Gpll0+bZwc1Wy2JK SHPEi+1GBEJT8r97tkqTq+Kqqby+ITs4UhRnHa2dI4xYSQ/lND2TlGHoDoBcYqqo1BNa gA5O+M4Agkwp9R6IDtdE7/yW8alQOMJ3tc+5GpF7QfQXPld5d/59RDkeGHqdfd4fl5W1 Ji/TPEWakFKTtcjZbUGUhh6BGaTFpIpJlJWPBGBNhP7uxGHOPJNfCj+zRNhbM6JP3QQI lfqj05sSZQ1x1C5hJqD0oRw98XkRXmbX+RnLPwVX211N+V8aSYE53qMre7TXgmzdwXkn PcTw== X-Gm-Message-State: AOAM5300YsWlYiEeCgyWXsIJd4rrS2VszLzVECT2gWyvqBht4INBTC9i bX+faVf8LOrvnNmqsMD+Q4s6dA== X-Google-Smtp-Source: ABdhPJwju4TDd3bk4ZVsTie2kudOhcLdJ2xkXNuB5Q0DlANdCq9I04Dh+KPA+Wgv76q/d/ItqxKDKg== X-Received: by 2002:a63:6782:: with SMTP id b124mr201237pgc.308.1599087745106; Wed, 02 Sep 2020 16:02:25 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:3e52:82ff:fe6c:83ab]) by smtp.gmail.com with ESMTPSA id x12sm410277pjq.43.2020.09.02.16.02.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 16:02:24 -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 v2 06/10] phy: qcom-qmp: Use devm_platform_ioremap_resource() to simplify Date: Wed, 2 Sep 2020 16:02:11 -0700 Message-Id: <20200902230215.3452712-7-swboyd@chromium.org> X-Mailer: git-send-email 2.28.0.402.g5ffc5be6b7-goog In-Reply-To: <20200902230215.3452712-1-swboyd@chromium.org> References: <20200902230215.3452712-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) {