From patchwork Tue Jun 14 15:07:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 70040 Delivered-To: patches@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2098905qgf; Tue, 14 Jun 2016 08:08:25 -0700 (PDT) X-Received: by 10.25.169.17 with SMTP id s17mr2127449lfe.57.1465916879868; Tue, 14 Jun 2016 08:07:59 -0700 (PDT) Return-Path: Received: from mail-lf0-x22e.google.com (mail-lf0-x22e.google.com. [2a00:1450:4010:c07::22e]) by mx.google.com with ESMTPS id n128si14658674lfb.206.2016.06.14.08.07.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jun 2016 08:07:59 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22e as permitted sender) client-ip=2a00:1450:4010:c07::22e; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22e as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x22e.google.com with SMTP id u74so106496609lff.2 for ; Tue, 14 Jun 2016 08:07:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CNoxcTGBwlvUaZQYLvl3Aa2m8IMsxVH9L7xTzGUr3c0=; b=YCQ+dR2KMc/skoUtUum3yntm0SrH0hRQUWTFxXlpq0RNkE9+tubMprv+u9XyYMtA1l mLpq/+GY9VsOuoWCpK6wPVpU1q0XuKCrksPFtHXKn68b3lj+mdx9WZOLOCiqcjbYJqli aRjWRF9BvB0Iz9FY7wscjWHi1SVlREFJ7xx0E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CNoxcTGBwlvUaZQYLvl3Aa2m8IMsxVH9L7xTzGUr3c0=; b=hkXPWr6iRu7ZKzq+eL88j3NMUTXYUYnk+ZFroYKyKRtEOr30h+9OyoCIhCosMAaL8F TmwfzqskDxAkOk9W2CpnIGyINpnoIyi3awg/RvWGk7Hs8jX8bF3hYq0WIK91kQ2f8Fey lJLoEWld08eG2LNEvau93nuIdLO9O7rG7dTJOf7Abz7BXv0fQIHuIjgfQ2J8HVVH52j6 VjJlMhRp8Z7/dLXe9PJOdduoVsQEc7vudJHZVGvrFYmAgLj7utQnNeYSOP47YI1Rg31H 2BUP+LE3Z2fXY/USxpFo2A6/L4kh1Q5Bl3sRVty+otgkNaCv2lz4Qzvp5NH05ARsWoTs rImw== X-Gm-Message-State: ALyK8tKSz+fFnsdIJI0+kxmsYxTkwYR22niWRZlWC9lsq6g5+NScg34gxovQi4+ecvyKcQ8HWA4= X-Received: by 10.25.73.136 with SMTP id w130mr1586793lfa.172.1465916879549; Tue, 14 Jun 2016 08:07:59 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-155-4-128-67.na.cust.bahnhof.se. [155.4.128.67]) by smtp.gmail.com with ESMTPSA id f195sm3477060lfb.47.2016.06.14.08.07.57 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 14 Jun 2016 08:07:58 -0700 (PDT) From: Ulf Hansson To: Wolfram Sang , linux-i2c@vger.kernel.org Cc: Jarkko Nikula , Andy Shevchenko , Mika Westerberg , John Stultz , Guodong Xu , linux-arm-kernel@lists.infradead.org, Ulf Hansson Subject: [PATCH 09/10] i2c: designware-platdrv: Simplify code by using dev_get_drvdata() Date: Tue, 14 Jun 2016 17:07:27 +0200 Message-Id: <1465916848-8207-10-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465916848-8207-1-git-send-email-ulf.hansson@linaro.org> References: <1465916848-8207-1-git-send-email-ulf.hansson@linaro.org> Signed-off-by: Ulf Hansson --- drivers/i2c/busses/i2c-designware-platdrv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 1.9.1 diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 2b91af3..b2c6037 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -310,8 +310,7 @@ static void dw_i2c_plat_complete(struct device *dev) #ifdef CONFIG_PM static int dw_i2c_plat_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct dw_i2c_dev *i_dev = platform_get_drvdata(pdev); + struct dw_i2c_dev *i_dev = dev_get_drvdata(dev); i2c_dw_disable(i_dev); @@ -323,8 +322,7 @@ static int dw_i2c_plat_suspend(struct device *dev) static int dw_i2c_plat_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct dw_i2c_dev *i_dev = platform_get_drvdata(pdev); + struct dw_i2c_dev *i_dev = dev_get_drvdata(dev); int ret; if (!IS_ERR(i_dev->clk)) {