Received: by 10.192.165.148 with SMTP id m20csp1487593imm; Sat, 21 Apr 2018 09:16:50 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+3AxPNPezyD0YtHolrMZkuDpGfh+dxJWqzm2mi+pb97mP0llYD56M5K3+Ug68abzZ2q6mo X-Received: by 2002:a17:902:2c83:: with SMTP id n3-v6mr14127834plb.140.1524327410702; Sat, 21 Apr 2018 09:16:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524327410; cv=none; d=google.com; s=arc-20160816; b=bUPL/7CU92tDRE3yPFMk9AcHxFUOsh5WRWQ+Ntqhl3HGnqcPYf1kHIgSCDwdLx3oMs sxihxQf9a8tX10aaecGyH3y1ZgEj14UnQpCUTXgp8NyQ17vu+UNHp+SuYwDT/bWqJPAo GP/mO3QoCN51eztcpJSGZmm79fdIslASprs5409TxJNVkexe58E3IH630jGOnfCnCaog XZAZZbovntnGOv64c8q0dG14lvnjT5wpAbeb85IMBUgqFItsq6+dY3CPXxxH+vJqPszp 1FciekpyohXSPt0UKCsSzoKp0016Vd+8dx56oHtsaMZrS9kiwqhiUm6SuwXt7m3QwTDY zOZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=Jse/O8FDZkWpwJxZ+ZgRUR0Aynx6wDjRDIzzkNu+NvU=; b=IrIFUVceOep1gN1kb4dSTZMkjUWvGU6aEi6xZsWIekdX7YxNoyMaYaX5W+vPNIPMMG kY5CJ5cHqRzt6uXZbgCWddowVKzg1a2J6iJTZGHMrikMoX2Wi4sitLxZ52srg7ZFiWgc Z4hEd7ZKlRVkrbNA0e4WEOIRs/7LGzZRJ/2h1X1aX5Yr048TMH5dJ+47TU7LtsNbJpW4 QOqXjEestFofuZ0pmDj+rGV8/HfP6TSmJ0Ysyg0wOnNVxSuklGTO+0BiloeSY85/+HTB edbJafWWUcE3JUzwr7lzC41lJl6rWH6+k2Buf/xIH2Z8oqf9HDPGoJqORh/KR2J7jcbN YX5Q== 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 v2si6623871pgf.354.2018.04.21.09.16.13; Sat, 21 Apr 2018 09:16:50 -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 S1753177AbeDUQKU (ORCPT + 99 others); Sat, 21 Apr 2018 12:10:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:39242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752880AbeDUQKS (ORCPT ); Sat, 21 Apr 2018 12:10:18 -0400 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 04ADE20C09; Sat, 21 Apr 2018 16:10:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 04ADE20C09 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jic23@kernel.org Date: Sat, 21 Apr 2018 17:07:54 +0100 From: Jonathan Cameron To: Wolfram Sang Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel-janitors@vger.kernel.org, Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org Subject: Re: [PATCH 18/61] iio: common: cros_ec_sensors: simplify getting .drvdata Message-ID: <20180421170754.4f3ab554@archlinux> In-Reply-To: <20180419140641.27926-19-wsa+renesas@sang-engineering.com> References: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> <20180419140641.27926-19-wsa+renesas@sang-engineering.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 19 Apr 2018 16:05:48 +0200 Wolfram Sang wrote: > We should get drvdata from struct device directly. Going via > platform_device is an unneeded step back and forth. > > Signed-off-by: Wolfram Sang Applied, thanks. Jonathan > --- > > 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)