From patchwork Wed Jul 22 07:51:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 11677637 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 8084013B6 for ; Wed, 22 Jul 2020 07:52:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 63BAE20792 for ; Wed, 22 Jul 2020 07:52:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="LkDOlyLS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726317AbgGVHwn (ORCPT ); Wed, 22 Jul 2020 03:52:43 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:22530 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726147AbgGVHwn (ORCPT ); Wed, 22 Jul 2020 03:52:43 -0400 X-UUID: 9e51686874a141e4bd91569b9cc8aec6-20200722 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=bsR4oIGCIYaOleiklZSpqTGoJRJab0JcJpe1Y+wzSDc=; b=LkDOlyLSWi+7ZU9UhdFQ9j8xni92/9uUfhAfXtTT2PfPS/fuoVUuX/e6rKPibFmya0scX5n3gWkNZgvG78qpAzdGsuYw36a+Yf/TFSayU6PBpQ2CZwiXA/N/aQx2/rNK1/Av2FUis8V+pfqUuZjEtV6ni7XXk6tpv9ljw49u9qs=; X-UUID: 9e51686874a141e4bd91569b9cc8aec6-20200722 Received: from mtkcas32.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 3796830; Wed, 22 Jul 2020 15:52:38 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by MTKMBS31N2.mediatek.inc (172.27.4.87) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 22 Jul 2020 15:52:35 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 22 Jul 2020 15:52:35 +0800 From: Chunfeng Yun To: Felipe Balbi , Greg Kroah-Hartman CC: Matthias Brugger , Chunfeng Yun , , , , Subject: [PATCH 2/7] usb: phy: am335x: convert to devm_platform_ioremap_resource_byname Date: Wed, 22 Jul 2020 15:51:10 +0800 Message-ID: <1595404275-8449-2-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1595404275-8449-1-git-send-email-chunfeng.yun@mediatek.com> References: <1595404275-8449-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 9DB988DD4C58F5E8BA918A198B50C04108DA7A734B2DAD79509251980A3C6FA22000:8 X-MTK: N Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Use devm_platform_ioremap_resource_byname() to simplify code Signed-off-by: Chunfeng Yun --- drivers/usb/phy/phy-am335x-control.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/usb/phy/phy-am335x-control.c b/drivers/usb/phy/phy-am335x-control.c index d16dfc3..97e6603 100644 --- a/drivers/usb/phy/phy-am335x-control.c +++ b/drivers/usb/phy/phy-am335x-control.c @@ -149,7 +149,6 @@ struct phy_control *am335x_get_phy_control(struct device *dev) static int am335x_control_usb_probe(struct platform_device *pdev) { - struct resource *res; struct am335x_control_usb *ctrl_usb; const struct of_device_id *of_id; const struct phy_control *phy_ctrl; @@ -166,13 +165,11 @@ static int am335x_control_usb_probe(struct platform_device *pdev) ctrl_usb->dev = &pdev->dev; - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy_ctrl"); - ctrl_usb->phy_reg = devm_ioremap_resource(&pdev->dev, res); + ctrl_usb->phy_reg = devm_platform_ioremap_resource_byname(pdev, "phy_ctrl"); if (IS_ERR(ctrl_usb->phy_reg)) return PTR_ERR(ctrl_usb->phy_reg); - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "wakeup"); - ctrl_usb->wkup = devm_ioremap_resource(&pdev->dev, res); + ctrl_usb->wkup = devm_platform_ioremap_resource_byname(pdev, "wakeup"); if (IS_ERR(ctrl_usb->wkup)) return PTR_ERR(ctrl_usb->wkup);