Received: by 10.192.165.156 with SMTP id m28csp769185imm; Thu, 19 Apr 2018 07:17:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx49vXlXd5HiCRq2JR8/fW8IBOC+SZOS4+feO+W+7qQL0LFF3MSMCFktJTYwfl+9UFIuUZDdK X-Received: by 10.101.99.22 with SMTP id g22mr5419885pgv.410.1524147443794; Thu, 19 Apr 2018 07:17:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147443; cv=none; d=google.com; s=arc-20160816; b=LXq/SD/EnRClEqQkywBQ0AzYqEAr+hTkIDRNCOl03FDY5fzG/haP0RkEZOw09B1uje hlkPxaRDiEJTnB34oP5hQPmuanNvnq1s14Vay/p7gp47pXMhnUIWGtpsEKK5kp4VtbHq 8vE9SsPdtxGzLZn8Bg/zrY1em1B5jywJ1nUBXUNnggUhUq0oyg0+e0GQ9GW8pmzGB6pX JyRkHLundAzOQJdcvMMuEk5bUoz8FlghG30B2Z+na2T15kM5FFYc1REP5PfHUdilyI0m 28NZVV6q27LWNk1t/rto/C/U3ebDe4dTqY5wqsdz40E2RoVlUHubaQBo7DdX4j/OovxA mcYA== 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=txjhvJ3La+AzZQWb+WAlAlGAG1+EgP+745/C5Y5H0CY=; b=G4zOZVhoEtwOiqTECrF/rPQjKqW9+EJirCU2oTF634ut3ReT+VOoOBmVH0iYXlFYd/ rgEfkPwEvEw/ZhYSgBx513eLNVg8Ax9hoqztciCjrjZ0wSaGrQ37ZrmLNPvc2TXwc/E1 yYAYhsDyKNd5fQ6qX88E0+Af+jZQqrLkpnMbdBuUV+z5XLPHppSTPwxUy2bSxjO13tC6 tb4Gclz8QoOXJWYlI322qqFmiSq0hLegchC+6XYa/1PsHgVSbvQY8tXhd8r2wjdNRSgK f8tFOXHmALbtm3OhhwVKoL1MEobCim9Q0Wcz0zG//Y4S3CxremAam+7qKcA+oo96gVsd KTmg== 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 u64si3185009pgc.136.2018.04.19.07.17.09; Thu, 19 Apr 2018 07:17:23 -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 S1753510AbeDSOHG (ORCPT + 99 others); Thu, 19 Apr 2018 10:07:06 -0400 Received: from sauhun.de ([88.99.104.3]:45280 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753331AbeDSOG5 (ORCPT ); Thu, 19 Apr 2018 10:06:57 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id 7EEA33139BE; Thu, 19 Apr 2018 16:06:55 +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 , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org Subject: [PATCH 18/61] iio: common: cros_ec_sensors: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:05:48 +0200 Message-Id: <20180419140641.27926-19-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/iio/common/cros_ec_sensors/cros_ec_sensors_core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c index a620eb5ce202..3df6c0e09832 100644 --- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c +++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c @@ -448,8 +448,7 @@ EXPORT_SYMBOL_GPL(cros_ec_sensors_core_write); static int __maybe_unused cros_ec_sensors_prepare(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct iio_dev *indio_dev = platform_get_drvdata(pdev); + struct iio_dev *indio_dev = dev_get_drvdata(dev); struct cros_ec_sensors_core_state *st = iio_priv(indio_dev); if (st->curr_sampl_freq == 0) @@ -471,8 +470,7 @@ static int __maybe_unused cros_ec_sensors_prepare(struct device *dev) static void __maybe_unused cros_ec_sensors_complete(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct iio_dev *indio_dev = platform_get_drvdata(pdev); + struct iio_dev *indio_dev = dev_get_drvdata(dev); struct cros_ec_sensors_core_state *st = iio_priv(indio_dev); if (st->curr_sampl_freq == 0) -- 2.11.0