Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1806624pxb; Mon, 20 Sep 2021 05:53:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+VeM9z9nu6ijqBSfEkr+NGnOOgjHUMBoK6yaysTbaH+vGSZrOyAMm4pASGdrSmzglDxyH X-Received: by 2002:a6b:2b97:: with SMTP id r145mr18153415ior.193.1632142435197; Mon, 20 Sep 2021 05:53:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632142435; cv=none; d=google.com; s=arc-20160816; b=c5XqO+8vRDW0JVWKWyVzPcPy3Zw8RYZKLwRnqutwiOtAnzJXXGTpOB2/wORx/bANEk AEv6pSxfRYQQxlvEXs7JLkuT5TZEcSDf9028UbjtDfKSWJi5NKW2in0cul3x1ZPkeV8H LPq0PrG9RTfd6qzBoNBi8qfcxE9vEpPn2srQR/Yos8/I8rI/toBfPj6BWPyueB9LEkUP GiDEEhhh2CcPzmqCIXFC2tIRKHDMdX+DF0koFVSx0ZF1Ro6ymO7+BG8xmApmLdACoHCp 8nEJXN9FbRnFAPNa/e0XkicFha7N6o0CfZtpP71YkXgCc+kO1UBPzF16YBSBF09QtQV7 yhJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PpnTf84R9vJcKOUIwKXEHrtpg/kmrBIDCZhEbVUX26w=; b=W2w9SNgVECeAtKTYO0aFsRGop5vgzyFjHxnu2olESbHzYqFmtjnQ4kl305LhSdc3yS /+45yern5AOSwtFN1sR9p4h4CStuf6bes519CS5sitmPbMLb2/Qp1IzRRwV9jH6Y2rGe grIhZ9l3MenMoEIR6NmOCPJ5VbbSZr3T0/28S18IKxQnxxh14Bv0++XGhIsPO1rMbozL t9/ECoUPyHpt4fb6LLSR6Bt6NS4dOUlTi2E13EWKt6058NsJoHp50Fk9m7KoGYtYtTrJ yHTlMQBVEIKNWiYZHZLtkFAI8pdCXOIKkmHlfT4EWysIXni1QAhNJ/OVjpXsb6xJns1N ilsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=lj832Axr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p8si16529801ilh.169.2021.09.20.05.53.43; Mon, 20 Sep 2021 05:53:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=lj832Axr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236377AbhITJIY (ORCPT + 99 others); Mon, 20 Sep 2021 05:08:24 -0400 Received: from www.zeus03.de ([194.117.254.33]:54406 "EHLO mail.zeus03.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236156AbhITJHX (ORCPT ); Mon, 20 Sep 2021 05:07:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=f/zxZRGlnJpbe6 H96Hzt8uxtwQGLc86qedocs3VWYGA=; b=lj832Axr2/AczctzUdmCMQrrBZaEpb sgQBzYMsw7XFq7QQHC62sWqHBwWEQKrB8V6+9dziQacstGjHZpmiejLLeEsQVijJ Mo3gDWHErBHl98DFkBDwrD6Wjsvs98/tGsOVbrWgOlyNz/4SAHebWKTK4ic810dk 3jLN634vo/uRw= Received: (qmail 2412762 invoked from network); 20 Sep 2021 11:05:27 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 20 Sep 2021 11:05:27 +0200 X-UD-Smtp-Session: l3s3148p1@D7kElWnMFosgAwDPXwlxANIWpbLKE1Uh From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Wolfram Sang , Benson Leung , Enric Balletbo i Serra , Guenter Roeck Subject: [PATCH 8/9] platform: chrome: cros_ec_sensorhub: simplify getting .driver_data Date: Mon, 20 Sep 2021 11:05:20 +0200 Message-Id: <20210920090522.23784-9-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210920090522.23784-1-wsa+renesas@sang-engineering.com> References: <20210920090522.23784-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We should get 'driver_data' 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. drivers/platform/chrome/cros_ec_sensorhub.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/chrome/cros_ec_sensorhub.c b/drivers/platform/chrome/cros_ec_sensorhub.c index 9c4af76a9956..31fb8bdaad5a 100644 --- a/drivers/platform/chrome/cros_ec_sensorhub.c +++ b/drivers/platform/chrome/cros_ec_sensorhub.c @@ -224,8 +224,7 @@ static int cros_ec_sensorhub_probe(struct platform_device *pdev) */ static int cros_ec_sensorhub_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct cros_ec_sensorhub *sensorhub = platform_get_drvdata(pdev); + struct cros_ec_sensorhub *sensorhub = dev_get_drvdata(dev); struct cros_ec_dev *ec = sensorhub->ec; if (cros_ec_check_features(ec, EC_FEATURE_MOTION_SENSE_FIFO)) @@ -235,8 +234,7 @@ static int cros_ec_sensorhub_suspend(struct device *dev) static int cros_ec_sensorhub_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct cros_ec_sensorhub *sensorhub = platform_get_drvdata(pdev); + struct cros_ec_sensorhub *sensorhub = dev_get_drvdata(dev); struct cros_ec_dev *ec = sensorhub->ec; if (cros_ec_check_features(ec, EC_FEATURE_MOTION_SENSE_FIFO)) -- 2.30.2