Received: by 10.192.165.156 with SMTP id m28csp768243imm; Thu, 19 Apr 2018 07:16:34 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/BT+scb0mUXlX06OXsGtKyy1zBpw4esiUAnrHhpnqY6UPBYvFzOfyZdHUx8D9q4z+7bqlD X-Received: by 10.98.205.69 with SMTP id o66mr6081384pfg.34.1524147394775; Thu, 19 Apr 2018 07:16:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147394; cv=none; d=google.com; s=arc-20160816; b=nDuUO8EVRDIEgMaGRcVDlfFuu+VS0MUGvboIc0CH3NVOsVfoVm6xT4jH9xn6TTdMKj 5dOA1jf7sc+d+kVkC+RZ5/FFhuTpPjuEUYt+UmuXtToSZF+R2VDXhMlkIWe1c8teVLlm JnE/p0fYJW+UQYMy/7MdUhRPNZPaG5KHUDKheHLHUnVbaEhVBphDDb4hWHYJxzP/p+/q d/PseNUFHB2wSEkDwHHfQD1VlzpNH0rJlQjCqoyVuseUU/iuujyLhNkHosZnG1lO/igb zo/0yeK1wWgbznmZ+TzkcQe73R7F1TAu+CK56O3oe5iO+su1PYqaSfrl0P5+T9vpesRu GoIg== 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=GP0sqJ3Q6LZm94Qb5AvAP/wONuNM9Kg6P0aeYx6m0ww=; b=PVifl8CSYM2Tb37T5S9JMlmF12RFwXuhb1tfTpM2RXc46SQ/6Sp49oeTtHIiV8KccN eCsbNJzlVdf83+ozct/X2Wg7tZ9viumoPbR3txDFJ9OO66c74ogWNeFcLQaiLB8KA+KG kjKk4HsvWZbyPRGJuSvJtAL4GV3oesS+3i1XgFW6TEczBjYgdtxap7NH4TKvOsjzx90G 246hMngulF0HksTFCtKO7WC5FFv6DRa8hNSn0U66dO8mnYdqo0UZxR8EjmM+CpPHkvOV e2Cv+/W9QNkU6F/f/2KGcKhp49z5DNRD3FBF78ky1XcMhhvg7oIwVq2BICiCudh4GT0A n/dA== 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 s85si3305451pfi.32.2018.04.19.07.16.20; Thu, 19 Apr 2018 07:16:34 -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 S1753623AbeDSOPS (ORCPT + 99 others); Thu, 19 Apr 2018 10:15:18 -0400 Received: from sauhun.de ([88.99.104.3]:45448 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753515AbeDSOHH (ORCPT ); Thu, 19 Apr 2018 10:07:07 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id ED0C43139D1; Thu, 19 Apr 2018 16:07:05 +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 , Corentin Chary , Darren Hart , Andy Shevchenko , acpi4asus-user@lists.sourceforge.net, platform-driver-x86@vger.kernel.org Subject: [PATCH 40/61] platform: x86: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:06:10 +0200 Message-Id: <20180419140641.27926-41-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/platform/x86/asus-laptop.c | 3 +-- drivers/platform/x86/asus-wmi.c | 3 +-- drivers/platform/x86/samsung-laptop.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c index c4768be24ba9..700c48ddfa7c 100644 --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c @@ -1593,8 +1593,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, int idx) { struct device *dev = container_of(kobj, struct device, kobj); - struct platform_device *pdev = to_platform_device(dev); - struct asus_laptop *asus = platform_get_drvdata(pdev); + struct asus_laptop *asus = dev_get_drvdata(dev); acpi_handle handle = asus->handle; bool supported; diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index a32c5c00e0e7..ef87e78ca772 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -1862,8 +1862,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj, struct attribute *attr, int idx) { struct device *dev = container_of(kobj, struct device, kobj); - struct platform_device *pdev = to_platform_device(dev); - struct asus_wmi *asus = platform_get_drvdata(pdev); + struct asus_wmi *asus = dev_get_drvdata(dev); bool ok = true; int devid = -1; diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c index 03305e0b89ff..7b160ee98115 100644 --- a/drivers/platform/x86/samsung-laptop.c +++ b/drivers/platform/x86/samsung-laptop.c @@ -1216,8 +1216,7 @@ static umode_t samsung_sysfs_is_visible(struct kobject *kobj, struct attribute *attr, int idx) { struct device *dev = container_of(kobj, struct device, kobj); - struct platform_device *pdev = to_platform_device(dev); - struct samsung_laptop *samsung = platform_get_drvdata(pdev); + struct samsung_laptop *samsung = dev_get_drvdata(dev); bool ok = true; if (attr == &dev_attr_performance_level.attr) -- 2.11.0