Received: by 10.192.165.156 with SMTP id m28csp765687imm; Thu, 19 Apr 2018 07:14:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx48kRoxwAi42eLCgP1XoULs50YxiZmh6IQy0J84+Qq+P++YsHupIouCoF9iWhksw9qfcsR48 X-Received: by 10.98.220.78 with SMTP id t75mr5366461pfg.139.1524147263348; Thu, 19 Apr 2018 07:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147263; cv=none; d=google.com; s=arc-20160816; b=Vtuy7Ml9TambYh+TYgLJkbqs9KKWs0jgCSkVXpxd1r2mLuzt+DEGRJD0/a+dvRyvX6 07h3Uddr0zlgOCliRNWKAz6N94IaJd7vrJYdjcqnpbB6wbRlLG2ClFMtIZ4UowVtEYTj Bqb/WbPon4Cq5d1GsicH5S4O02qD3JjCkVInVS+puLv8P5lEN2slAD0C18J4ht3HEk6W RVOickgaeuZ+tqRizIi7G9NCd/ONlSt2YCBbed2ucLjuFWbF9kU4NpGWh9VqRjKRN4Cc mJ2Mp7JzICZrW1qF2HvKlEiRIMFclgVGV/MoevvTAc2cPwSiwntzmHSEuUTjB91iSszd kD1A== 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=U/EJ0P/PE9xTzcKTwxgiNBekV0PImEMInsF3XTMuUrA=; b=OHkiN4PRWqZM6tfkeSB2LyvgA02NxKy4Yzgq63EocnqwLyPKsAYi3zeS9L4vTCiL1q xEBkVrGMhnCHCvkW8BMTqUyZxIg7yXAIRZ27alrD455BZLb4o864LZeZ1nreHNDYW++u jsw6aLn52cXrDfpnhNxr98SKVrNKLqAfQrX7zJRIUATOX1aiY9uMNeTG4YtkZsMUlwDf N4wcWB8nuJtQZujj8mb6upssymRPmqZsxzZ1xAp/fXcVb9XrTBONdE+/c/F5bQF2jF+6 RcLzSfRnuz5fTKpidHUrmCPACUmDlSvmkMbPv8W/4dekPS9H7qVzt+Dwf+FJctZ+5iUG Z2pA== 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 s11-v6si3577014plp.443.2018.04.19.07.14.08; Thu, 19 Apr 2018 07:14: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 S1753858AbeDSOMg (ORCPT + 99 others); Thu, 19 Apr 2018 10:12:36 -0400 Received: from sauhun.de ([88.99.104.3]:45342 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753544AbeDSOHL (ORCPT ); Thu, 19 Apr 2018 10:07:11 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id 0786C3139D5; Thu, 19 Apr 2018 16:07:10 +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 , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Hartmut Knaack , Peter Meerwald-Stadler , Greg Kroah-Hartman , linux-iio@vger.kernel.org, devel@driverdev.osuosl.org Subject: [PATCH 48/61] staging: iio: adc: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:06:18 +0200 Message-Id: <20180419140641.27926-49-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/staging/iio/adc/ad7606_par.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/iio/adc/ad7606_par.c b/drivers/staging/iio/adc/ad7606_par.c index 3eb6f8f312dd..a34c2a1d5373 100644 --- a/drivers/staging/iio/adc/ad7606_par.c +++ b/drivers/staging/iio/adc/ad7606_par.c @@ -18,8 +18,7 @@ static int ad7606_par16_read_block(struct device *dev, int count, void *buf) { - 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 ad7606_state *st = iio_priv(indio_dev); insw((unsigned long)st->base_address, buf, count); @@ -34,8 +33,7 @@ static const struct ad7606_bus_ops ad7606_par16_bops = { static int ad7606_par8_read_block(struct device *dev, int count, void *buf) { - 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 ad7606_state *st = iio_priv(indio_dev); insb((unsigned long)st->base_address, buf, count * 2); -- 2.11.0