From mboxrd@z Thu Jan 1 00:00:00 1970 From: Felipe Balbi Subject: [PATCH REBASE 1/6] i2c: omap: no need to access platform_device Date: Fri, 14 Dec 2012 18:34:04 +0200 Message-ID: <1355502849-9289-2-git-send-email-balbi@ti.com> References: <1355502849-9289-1-git-send-email-balbi@ti.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from devils.ext.ti.com ([198.47.26.153]:52984 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756659Ab2LNQlx (ORCPT ); Fri, 14 Dec 2012 11:41:53 -0500 In-Reply-To: <1355502849-9289-1-git-send-email-balbi@ti.com> Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, Linux OMAP Mailing List , Linux ARM Kernel Mailing List , Tony Lindgren , Felipe Balbi PM callbacks pass our device pointer as argument and we don't need to access the platform_device just to dereference that down to dev->drvdata. instead, just use dev_get_drvdata() directly. Signed-off-by: Felipe Balbi --- drivers/i2c/busses/i2c-omap.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 7a62acb..9a9cf7c 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -1289,8 +1289,7 @@ static int __devexit omap_i2c_remove(struct platform_device *pdev) #ifdef CONFIG_PM_RUNTIME static int omap_i2c_runtime_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct omap_i2c_dev *_dev = platform_get_drvdata(pdev); + struct omap_i2c_dev *_dev = dev_get_drvdata(dev); _dev->iestate = omap_i2c_read_reg(_dev, OMAP_I2C_IE_REG); @@ -1310,8 +1309,7 @@ static int omap_i2c_runtime_suspend(struct device *dev) static int omap_i2c_runtime_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct omap_i2c_dev *_dev = platform_get_drvdata(pdev); + struct omap_i2c_dev *_dev = dev_get_drvdata(dev); if (!_dev->regs) return 0; -- 1.8.1.rc1.5.g7e0651a