Received: by 10.192.165.156 with SMTP id m28csp768955imm; Thu, 19 Apr 2018 07:17:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+h110nUCIcYwxbo8DQ6dFTO+5An8LPquH4ldLQwmw8bYxEszM22Zap5lytM1VbWTWAnBPE X-Received: by 2002:a17:902:5c6:: with SMTP id f64-v6mr6294574plf.77.1524147433435; Thu, 19 Apr 2018 07:17:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147433; cv=none; d=google.com; s=arc-20160816; b=nqBC/1+uJ2YeI/T2wONyJny1X8Wp/75YgCvvGYJnyqBigasKHrX78IIMrpV41DMRWY wbCOEPt0z1HmitnPBY+oKM1QMQuKPFRqWRX3/PxEHi/Ft4rWcn0e73dXsFH5SU+lhC/0 1uXJVzRjH9RzMmDroNyvDN9L5aIKUjef20pjAC37Ej6XwyzvKgqd6qa8u8AWMx6/Ahao kdRModGA+FlxhdykCyFPfQoI/6fxImZy8if+Gq3px+cgq/XmR6Q/r98rrsRy2Ck7zEc9 OP0/JUSdBZl4mJEKBQ6lGl22F5SDSjXU3EtPtk+WYnl2t0VXl7MysjtrtRabEYr14eKJ Z6UA== 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=imoUk1xJc1yw77K7+yjSJHqquO0dvvd2Q695eFR8r+M=; b=y+nmT+fLG3HFWTRIsjBr/M8GZQ6bcoesTcQN/IlBWpHtVZT7JG9c9xa+Xj6WctKQcv E12HQVY5aYAqzy7h1/s5CMjAAbDLj/i2o5a/oxbAraBbyklUMl0FVuU8TzdS8t+HL/Km hK6+Xo2IppJhJbnPcELlsTxjbvvJUrU/mjTiQKh2VFjbzTrkWpcq/h764Lvdrf5p/ui1 KPsNmkUNJhwbuPreYpGIBexJr7NZv3Gz/z0PRrtJnnyyME+0v1SGXeELnlMu3FdMO5E2 2wnYfIC+lkA0V6sY/XSfReabGmaKsmpLgDWaINKAx7wVBwqUCG8nnILXGx8kbXvlaPoB 8gyA== 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 m4si3158336pgs.291.2018.04.19.07.16.59; Thu, 19 Apr 2018 07:17:13 -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 S1753670AbeDSOPw (ORCPT + 99 others); Thu, 19 Apr 2018 10:15:52 -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 S1752765AbeDSOHG (ORCPT ); Thu, 19 Apr 2018 10:07:06 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id E07A13139D0; Thu, 19 Apr 2018 16:07:04 +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 , Linus Walleij , Ludovic Desroches , Nicolas Ferre , Alexandre Belloni , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 38/61] pinctrl: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:06:08 +0200 Message-Id: <20180419140641.27926-39-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/pinctrl/pinctrl-amd.c | 6 ++---- drivers/pinctrl/pinctrl-at91-pio4.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c index 04ae139671c8..c2c7067b0660 100644 --- a/drivers/pinctrl/pinctrl-amd.c +++ b/drivers/pinctrl/pinctrl-amd.c @@ -777,8 +777,7 @@ static bool amd_gpio_should_save(struct amd_gpio *gpio_dev, unsigned int pin) static int amd_gpio_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct amd_gpio *gpio_dev = platform_get_drvdata(pdev); + struct amd_gpio *gpio_dev = dev_get_drvdata(dev); struct pinctrl_desc *desc = gpio_dev->pctrl->desc; int i; @@ -796,8 +795,7 @@ static int amd_gpio_suspend(struct device *dev) static int amd_gpio_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct amd_gpio *gpio_dev = platform_get_drvdata(pdev); + struct amd_gpio *gpio_dev = dev_get_drvdata(dev); struct pinctrl_desc *desc = gpio_dev->pctrl->desc; int i; diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c index 4b57a13758a4..7065068f73f5 100644 --- a/drivers/pinctrl/pinctrl-at91-pio4.c +++ b/drivers/pinctrl/pinctrl-at91-pio4.c @@ -831,8 +831,7 @@ static struct pinctrl_desc atmel_pinctrl_desc = { static int __maybe_unused atmel_pctrl_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct atmel_pioctrl *atmel_pioctrl = platform_get_drvdata(pdev); + struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(dev); int i, j; /* @@ -860,8 +859,7 @@ static int __maybe_unused atmel_pctrl_suspend(struct device *dev) static int __maybe_unused atmel_pctrl_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct atmel_pioctrl *atmel_pioctrl = platform_get_drvdata(pdev); + struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(dev); int i, j; for (i = 0; i < atmel_pioctrl->nbanks; i++) { -- 2.11.0