Received: by 10.192.165.156 with SMTP id m28csp767518imm; Thu, 19 Apr 2018 07:15:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/VBwpw7j6aHfeD0yVEVP9IEKja38iymXJfO1zwKiKAJIjEgydyyfnprKpF5bmVlG0vVOOa X-Received: by 10.167.130.76 with SMTP id e12mr6020895pfn.192.1524147357455; Thu, 19 Apr 2018 07:15:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147357; cv=none; d=google.com; s=arc-20160816; b=SC+o7zhEqSc02DqU+TzVFLcKsvGiITp2dheuGZ1G2fYaiY/V1OdvN2cIgs8mR1aVRi dDpoWGCPE6RATKUYcYsZu/1gLo4Mj/NwwHBXZt/HaWMAMml+Co6i8otVz1Em9wl5d2Cf sJIUOa77SQHj+NZFA3tZAKfiebO+nYulOOje/EjAuNvDbwTDosi9GgCifACGS3ESU9RE 79zkjGmuxLILjUwGjwZPbjXkbb7o0YPspiK9LlWeONlLCb9ZzpcQTjOIkEo5ROAwYqCU UfpuzIDKt5J9Gm64ZtjvtGWZgpDbZ4S/p8CASzprrU6DfPfnAegZ2lGROS5qEJHcLBFz t/zQ== 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=Rnm3feJfxu3cPBgf9Pzq/9v0SRNUv1HEDJ6inDl8VWg=; b=g4sJJSi5Rp1ilpMMruvYsyIKFWpM664rgLSZzl1UeEzDVhj2CKdHSrILlPfbzSKamy sYk8J17ACRAyiOYzKbA+3GUjgwVhy6QhTTyMb4muSc7ax3xi2PLqw7zZySnisZYDOys/ 1LOqgisiXk88sjci68cfNpCI1f/YrXUHddSmVyFDRzdXl0AiJK/PkjjA+s+kzUONDhUE wShpcM3vtBKp0LqOOud9txwJB1ZKgu5umKME+744t9rebyei3Xsh77JFMsOkCglmRvYE mTXTwxrj1A8qOw+enTjSEU/H4jQw3smkMQ6ThCi6Ih7VAykOgEk/hMitXq4RONlOLdqD RM6A== 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.15.43; Thu, 19 Apr 2018 07:15:57 -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 S1753538AbeDSOOm (ORCPT + 99 others); Thu, 19 Apr 2018 10:14:42 -0400 Received: from sauhun.de ([88.99.104.3]:45350 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753516AbeDSOHH (ORCPT ); Thu, 19 Apr 2018 10:07:07 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id 670123139B0; Thu, 19 Apr 2018 16:07:06 +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 , Sebastian Reichel , linux-pm@vger.kernel.org Subject: [PATCH 41/61] power: supply: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:06:11 +0200 Message-Id: <20180419140641.27926-42-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/power/supply/gpio-charger.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/power/supply/gpio-charger.c b/drivers/power/supply/gpio-charger.c index bd2468ca6b63..c3f2a9479468 100644 --- a/drivers/power/supply/gpio-charger.c +++ b/drivers/power/supply/gpio-charger.c @@ -212,8 +212,7 @@ static int gpio_charger_suspend(struct device *dev) static int gpio_charger_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct gpio_charger *gpio_charger = platform_get_drvdata(pdev); + struct gpio_charger *gpio_charger = dev_get_drvdata(dev); if (device_may_wakeup(dev) && gpio_charger->wakeup_enabled) disable_irq_wake(gpio_charger->irq); -- 2.11.0