Received: by 10.192.165.156 with SMTP id m28csp770761imm; Thu, 19 Apr 2018 07:18:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+neofpoqHfEJW55AP+lDBALwyfJU8tfXlU4CufvZu/2QQzS+Amo5RxzZEncgurj2l3zz5s X-Received: by 2002:a17:902:a9c2:: with SMTP id b2-v6mr6488730plr.181.1524147524212; Thu, 19 Apr 2018 07:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147524; cv=none; d=google.com; s=arc-20160816; b=fEgtP1r9uauunyxzqLzWbc3BJmE0xXPmEKERt9cM5qAkej7Baxm+bvPBjwFVtevmDo gUxKm8MAc3HB0eANHOu536AkB+fU2xOGaVy550Rfooceg2v9F4Nwb2x3MxF5XgDvVvPU TYcV+5YTHINxzDudoJV3iJs/2BUMGkg6+rhZQ4FkZtFz8/wdHriseIiEUVQxJvVPkfc9 aMK9BiYUe+iPkyX6F5FzhnnWZCTqq2US3vXhOIVW78URHsVX2koQoohU6b2BOohLdBFX X5evjgH0xsoifm1ZFH+ZJEmvtGcutNkIpKHW+VH1bq8lH0GiSQR9gnK37xJKbuZGAhiu NKLg== 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=YZaFcjxvdINP+fBdPqIpUYVD+4eTM6a0+QR9z+wCXnw=; b=YgXLJkb5+tOpxCN+oQ3an/mj68lEPdz2IM7OnbQrgqP1UWCOtiXgVH5k0fiSraBxFw Bj75ovyPm/qrRNcTy1KUbXjuPlW+8fbmR1T5LIiqNZosb+RH/4WLZtMXuEJnH748PLKF DIVFb6M6UgmK7QIjyTua9fqR9Gv0pBPoHHVTcW6VlmJFbd3pvx5Uq3F2QY95OYhbTo7i RosV293akDeacfrqFj2OwEcHgDSWSHjzXYhEC5gJrgnXEAiCnM6G7dtwhR7vRpuq8i5G v3ncybrk/O5ElX+AZEZuv6n8mXeHOHWfbiz24gbn5VMaAsRUO/fkrxEAiTBf1ciYun/p OefQ== 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 r59-v6si3584433plb.218.2018.04.19.07.18.30; Thu, 19 Apr 2018 07:18:44 -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 S1753593AbeDSOQP (ORCPT + 99 others); Thu, 19 Apr 2018 10:16:15 -0400 Received: from sauhun.de ([88.99.104.3]:45270 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753491AbeDSOHF (ORCPT ); Thu, 19 Apr 2018 10:07:05 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id 6D9663139CA; Thu, 19 Apr 2018 16:07:04 +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 , Will Deacon , Mark Rutland , linux-arm-kernel@lists.infradead.org Subject: [PATCH 37/61] perf: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:06:07 +0200 Message-Id: <20180419140641.27926-38-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/perf/arm_spe_pmu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c index 28bb642af18b..54ec278d2fc4 100644 --- a/drivers/perf/arm_spe_pmu.c +++ b/drivers/perf/arm_spe_pmu.c @@ -131,8 +131,7 @@ static ssize_t arm_spe_pmu_cap_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct platform_device *pdev = to_platform_device(dev); - struct arm_spe_pmu *spe_pmu = platform_get_drvdata(pdev); + struct arm_spe_pmu *spe_pmu = dev_get_drvdata(dev); struct dev_ext_attribute *ea = container_of(attr, struct dev_ext_attribute, attr); int cap = (long)ea->var; @@ -247,8 +246,7 @@ static ssize_t arm_spe_pmu_get_attr_cpumask(struct device *dev, struct device_attribute *attr, char *buf) { - struct platform_device *pdev = to_platform_device(dev); - struct arm_spe_pmu *spe_pmu = platform_get_drvdata(pdev); + struct arm_spe_pmu *spe_pmu = dev_get_drvdata(dev); return cpumap_print_to_pagebuf(true, buf, &spe_pmu->supported_cpus); } -- 2.11.0