Received: by 10.192.165.156 with SMTP id m28csp762949imm; Thu, 19 Apr 2018 07:12:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/L9ph0DI1RLyxy8PcB6po/P8ygs6Ks7ln+ExBLMD70n6HO5mSAojKd9Crv+kMIV07VkdGZ X-Received: by 10.98.204.8 with SMTP id a8mr5260901pfg.219.1524147122837; Thu, 19 Apr 2018 07:12:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147122; cv=none; d=google.com; s=arc-20160816; b=BuopBumhm//wyCRvznUiiPOLsKXDUckY0SGutEcf/YhzeAx5AhnmOpLwg+amZSOLKT 4p1/Km9Id5v9dK5Ll7tfsxa7Zo1h4NLPGOoBAyxO7mM9R9s8nUqPIyVvvr4RnMHhsLaH JCgjd7pXdljMci0Z9nmnH52gJRxbeA9hIO/Rb06ZQlVY7gjkw13PAM9ss7rF6eG7QRJU FIm8jH9VRqwytM2JOsrv1QBnzwZEKCxSmfgTRPmrWXt/5O4eeYA9AZey1UyKPUEinJPh 95q10xk1eJc32ougDBW+Qm0Jb6VAg627pQX6DVgJ6alLO6yshCSWf7iD4C+ERyFlXdLQ s7Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=XGbliaMmQdPb9czs24liOEdjlANF57JMGMY+hBR6uro=; b=gQIdBnQfj/hXou60H+vgXvirvdQuUnW6Q8Ev6sUXzkOddYeHbBTtbJ9f/qDrDCXe4I 5LWKMwN3ernJ4j84ptKLb3juuC2BjAMFtukJzjEwUYrw1aBNiVwu8BI+/x48TC1O9Vf4 qaDzdgDk5jYHgqTp+rEHR/Vt5ngvNJUJw8AZ5//HNYSNyOJ93HLm6xuyrjRXZlBsP3pc 7ZTcUobra+tn+pehfd3P91e1bqHpe3kqjuTaYg2lg9z3Y/hU2GYKN7ZBaTnbzhdf3Kb6 DRqe38kziUQL411AvNU7EhjLXlB+jfVD+0Oh0bSkHZvWbFDRdD//DtZ/Tbn6j+dK0ho4 ziDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a100-v6si3692296pli.20.2018.04.19.07.11.48; Thu, 19 Apr 2018 07:12:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753806AbeDSOJ4 (ORCPT + 99 others); Thu, 19 Apr 2018 10:09:56 -0400 Received: from sauhun.de ([88.99.104.3]:45608 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753542AbeDSOHP (ORCPT ); Thu, 19 Apr 2018 10:07:15 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id A6DF13139DD; Thu, 19 Apr 2018 16:07:13 +0200 (CEST) From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel-janitors@vger.kernel.org, Wolfram Sang , Felipe Balbi , Greg Kroah-Hartman , linux-usb@vger.kernel.org Subject: [PATCH 56/61] usb: phy: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:06:26 +0200 Message-Id: <20180419140641.27926-57-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> References: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang --- Build tested only. buildbot is happy. Please apply individually. drivers/usb/phy/phy-am335x.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/phy/phy-am335x.c b/drivers/usb/phy/phy-am335x.c index b36fa8b953d0..27bdb7222527 100644 --- a/drivers/usb/phy/phy-am335x.c +++ b/drivers/usb/phy/phy-am335x.c @@ -96,8 +96,7 @@ static int am335x_phy_remove(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int am335x_phy_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct am335x_phy *am_phy = platform_get_drvdata(pdev); + struct am335x_phy *am_phy = dev_get_drvdata(dev); /* * Enable phy wakeup only if dev->power.can_wakeup is true. @@ -117,8 +116,7 @@ static int am335x_phy_suspend(struct device *dev) static int am335x_phy_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct am335x_phy *am_phy = platform_get_drvdata(pdev); + struct am335x_phy *am_phy = dev_get_drvdata(dev); phy_ctrl_power(am_phy->phy_ctrl, am_phy->id, am_phy->dr_mode, true); -- 2.11.0