From patchwork Mon Jul 13 20:38:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 6781521 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6A2C09F2F0 for ; Mon, 13 Jul 2015 20:38:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 70CD3204C9 for ; Mon, 13 Jul 2015 20:38:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AC7E020534 for ; Mon, 13 Jul 2015 20:38:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752839AbbGMUid (ORCPT ); Mon, 13 Jul 2015 16:38:33 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:54857 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751951AbbGMUib (ORCPT ); Mon, 13 Jul 2015 16:38:31 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id t6DKc6IK025069; Mon, 13 Jul 2015 15:38:06 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t6DKc6wY019696; Mon, 13 Jul 2015 15:38:06 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Mon, 13 Jul 2015 15:37:44 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t6DKc5X6004731; Mon, 13 Jul 2015 15:38:05 -0500 From: Felipe Balbi To: CC: Linux OMAP Mailing List , , Linux ARM Kernel Mailing List , Felipe Balbi Subject: [PATCH 1/3] i2c: omap: switch to dev_get_drvdata() Date: Mon, 13 Jul 2015 15:38:02 -0500 Message-ID: <1436819884-1614-1-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.4.4 In-Reply-To: <20150710172701.GB20408@saruman.tx.rr.com> References: <20150710172701.GB20408@saruman.tx.rr.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP there's no need to fetch the platform_device in order to dereference it back to the dev pointer to access drvdata, we can use dev_get_drvdata() instead. 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 d1c22e3fdd14..2dcf4cac663d 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -1465,8 +1465,7 @@ static int omap_i2c_remove(struct platform_device *pdev) #ifdef CONFIG_PM 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); @@ -1492,8 +1491,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); pinctrl_pm_select_default_state(dev);