Received: by 10.192.165.148 with SMTP id m20csp1484056imm; Sat, 21 Apr 2018 09:12:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/xIOLOqUyNKCf7KnJ7UvhSuCuyjsOxmITKaaV6fbH0of6mmK7xuVqgW/UhPU5sJyHtgdn0 X-Received: by 10.99.115.4 with SMTP id o4mr11498071pgc.404.1524327158563; Sat, 21 Apr 2018 09:12:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524327158; cv=none; d=google.com; s=arc-20160816; b=kVjB77CiuaGKHTdU3IJIyO6k/OpD5lgfKiQo6c5iOIZ98Qr7sGCR3orFKgTO6eypR/ ml4YLmqH3YW2szc+j+GFijp9Q7eV2ixEQsY1dI5or9Uwgj1y4haS+OZeZcKNda71qH/8 PsaivR0o+b7mpdVKMlkE9YSAmQWAKFHpHCKMfSJFU1SxG6CmogJgttzuJBfUzRLipTqm j/7rmPmtajAEyDMR/b1qeMBa6uYtV6cI82LKjGRAGd2r9PJSnpXjDhAF1Ii/bwM59HqR oBbqKaj4FAiIbpWMicdymRoEltgLClWDFCg5vDjAyIxOGv4cU5y6qlPHcCJmhwM+zGqt JJBw== 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=CjDR6zdIQISvQoRb9wKR6JnyWoheprazFtxoPdCxbjE=; b=Mc9J8JUBASAcKunttC3NXg9a6Fg2fp2hQu0ebqKv7YhbbO34p9ZXVCE0hKuBdstiLh MALYKh+kbNlBom40ImmZGWPTKtUPyeD2D33Ncpcm3RyQLInPtgXK490FG2cRYt8hKrHw NhTnuRAhliIhOYYQ76udJ6+UsH9GyML6s+FQekavMzABEOSWNjoedyA3LzyWEc9Bpxwa cuOiW2B/D9gDMhAQFFu4c65XOUCd1+tbooP+tUjC+F4B3Mkig1KQZ6wqrKHm2V77bCjc F44jQ3YBpo0uFrS6sa6lIMBk42KG51YhiHEoKtuYE25f/56iMmpVq3zalIW+NppIksdH wPvA== 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 g76si7838621pfa.337.2018.04.21.09.12.01; Sat, 21 Apr 2018 09:12:38 -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 S1753077AbeDUQJX (ORCPT + 99 others); Sat, 21 Apr 2018 12:09:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:39128 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752819AbeDUQJV (ORCPT ); Sat, 21 Apr 2018 12:09:21 -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 9C1C320C09; Sat, 21 Apr 2018 16:09:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C1C320C09 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:09:16 +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 19/61] iio: common: hid-sensors: simplify getting .drvdata Message-ID: <20180421170916.6af36c05@archlinux> In-Reply-To: <20180419140641.27926-20-wsa+renesas@sang-engineering.com> References: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> <20180419140641.27926-20-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:49 +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/hid-sensors/hid-sensor-trigger.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c > index cfb6588565ba..2ce0efd98cc0 100644 > --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c > +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c > @@ -304,8 +304,7 @@ EXPORT_SYMBOL(hid_sensor_setup_trigger); > > static int __maybe_unused hid_sensor_suspend(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 hid_sensor_common *attrb = iio_device_get_drvdata(indio_dev); > > return _hid_sensor_power_state(attrb, false); > @@ -313,8 +312,7 @@ static int __maybe_unused hid_sensor_suspend(struct device *dev) > > static int __maybe_unused hid_sensor_resume(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 hid_sensor_common *attrb = iio_device_get_drvdata(indio_dev); > schedule_work(&attrb->work); > return 0; > @@ -322,8 +320,7 @@ static int __maybe_unused hid_sensor_resume(struct device *dev) > > static int __maybe_unused hid_sensor_runtime_resume(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 hid_sensor_common *attrb = iio_device_get_drvdata(indio_dev); > return _hid_sensor_power_state(attrb, true); > }