Received: by 10.192.165.156 with SMTP id m28csp777393imm; Thu, 19 Apr 2018 07:25:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+fffqdk2szdnlKhk0SZvEwVkajcFMpYAMwosCom6aob9uM925OWtslmpBIEB0OE0UFhfuW X-Received: by 10.99.106.7 with SMTP id f7mr5375299pgc.363.1524147903894; Thu, 19 Apr 2018 07:25:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147903; cv=none; d=google.com; s=arc-20160816; b=gf72xa+kvNopaEPEb5n1Gwsz9a5/7REvTodhXdKApsM1OjP7lhDKHyYp3+iMN0eEQk FQvp3TVYd2wfUPRSxo5MdFUgkCBxdW63brbL0Cbf3+YPoyRMir26P5Aqs32wOmD4e+yM LUKiIwYjOtWaH+V8v0wmSfDiBj68TvahkMDbN0f5nQqR3lU6a1Rqu9ZEJ7suctFDk43Y ycZLpmR7lUG50FrRvqtrMDwdayy12r8EDXWTMSdIXdjDA5H0Ph8Ng5idZI9tVqTDxkXl ujjxROORsWvzwwhiWM5x+7fBVWgSOwpJkLdw1tjVR4H0BLnXc5o7nD2WdqVirme736U0 vqeg== 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=XFr3jtlgtREveuzDIuzea11BkmB0CJy+ZAZDzQ/91bI=; b=Im/4t741q3clYei3D8tJ1uEp64WTwcQdgELk++TnlJYxLEab5A1bPEZ367i5EkEARO ThyKB8psm6Rar9oNdkN9ZtPWChtjUPWbKahDYrneGKGnorjeQ3ymNSYQHh1h9SfRKiH1 B4GCnHad5c4wc4goHuN/sozokphG8O2NZiWM6ud8vN3H0mSIrfZD+RIRnnMpWco2dklF 4/as3tfY4wXdlAibpp3B36Vb7e137b6DcIyFIshDDo/PUmJzfIpSen0l0F3M3kM37Pgk Asa16eVYcaAZTQVVcE2tq3j+3YQLQ0JGySkwGxB9VfvjNj0pVAeVMHEIyRpB7Tir4Xth kf7A== 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 x30si3142636pgc.309.2018.04.19.07.24.49; Thu, 19 Apr 2018 07:25:03 -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 S1753359AbeDSOG5 (ORCPT + 99 others); Thu, 19 Apr 2018 10:06:57 -0400 Received: from sauhun.de ([88.99.104.3]:45234 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752731AbeDSOGu (ORCPT ); Thu, 19 Apr 2018 10:06:50 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id ED8923139B0; Thu, 19 Apr 2018 16:06:48 +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 , Brian Norris , Gregory Fong , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH 04/61] bus: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:05:34 +0200 Message-Id: <20180419140641.27926-5-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/bus/brcmstb_gisb.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/bus/brcmstb_gisb.c b/drivers/bus/brcmstb_gisb.c index 68ac3e93b600..f58ff67e97ac 100644 --- a/drivers/bus/brcmstb_gisb.c +++ b/drivers/bus/brcmstb_gisb.c @@ -150,8 +150,7 @@ static ssize_t gisb_arb_get_timeout(struct device *dev, struct device_attribute *attr, char *buf) { - struct platform_device *pdev = to_platform_device(dev); - struct brcmstb_gisb_arb_device *gdev = platform_get_drvdata(pdev); + struct brcmstb_gisb_arb_device *gdev = dev_get_drvdata(dev); u32 timeout; mutex_lock(&gdev->lock); @@ -165,8 +164,7 @@ static ssize_t gisb_arb_set_timeout(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct platform_device *pdev = to_platform_device(dev); - struct brcmstb_gisb_arb_device *gdev = platform_get_drvdata(pdev); + struct brcmstb_gisb_arb_device *gdev = dev_get_drvdata(dev); int val, ret; ret = kstrtoint(buf, 10, &val); @@ -418,8 +416,7 @@ static int __init brcmstb_gisb_arb_probe(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int brcmstb_gisb_arb_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct brcmstb_gisb_arb_device *gdev = platform_get_drvdata(pdev); + struct brcmstb_gisb_arb_device *gdev = dev_get_drvdata(dev); gdev->saved_timeout = gisb_read(gdev, ARB_TIMER); @@ -431,8 +428,7 @@ static int brcmstb_gisb_arb_suspend(struct device *dev) */ static int brcmstb_gisb_arb_resume_noirq(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct brcmstb_gisb_arb_device *gdev = platform_get_drvdata(pdev); + struct brcmstb_gisb_arb_device *gdev = dev_get_drvdata(dev); gisb_write(gdev, gdev->saved_timeout, ARB_TIMER); -- 2.11.0