Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932079AbbL0NSi (ORCPT ); Sun, 27 Dec 2015 08:18:38 -0500 Received: from m50-132.163.com ([123.125.50.132]:54717 "EHLO m50-132.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752295AbbL0NSg (ORCPT ); Sun, 27 Dec 2015 08:18:36 -0500 From: Geliang Tang To: Srinivas Kandagatla , Maxime Coquelin , Patrice Chotard , Wolfram Sang Cc: Geliang Tang , linux-arm-kernel@lists.infradead.org, kernel@stlinux.com, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/10] i2c: st: use to_platform_device() Date: Sun, 27 Dec 2015 21:15:42 +0800 Message-Id: <18b3804a2b8d7c682f3f25951309e1503d8ab6d0.1451221174.git.geliangtang@163.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: References: In-Reply-To: References: X-CM-TRANSID: DNGowEBZ5Umj5H9W2d0fAA--.8696S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7Gw1xAF48Gw1DGw13AFWUArb_yoW3CrX_Cr 1kuan7Wr18C3Z5tF15JwnxZryDKFZYgFWkZrn7KFWSy34Yqw15ZrWDZr97Cr4Uuw47GF1j gw1qgF4fAr47GjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUbCPfJUUUUU== X-Originating-IP: [116.77.145.148] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/xtbBygXdmVO+g0gM5wAAsG Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 990 Lines: 30 Use to_platform_device() instead of open-coding it. Signed-off-by: Geliang Tang --- drivers/i2c/busses/i2c-st.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-st.c b/drivers/i2c/busses/i2c-st.c index 25020ec..6ee7715 100644 --- a/drivers/i2c/busses/i2c-st.c +++ b/drivers/i2c/busses/i2c-st.c @@ -708,8 +708,7 @@ static int st_i2c_xfer(struct i2c_adapter *i2c_adap, #ifdef CONFIG_PM_SLEEP static int st_i2c_suspend(struct device *dev) { - struct platform_device *pdev = - container_of(dev, struct platform_device, dev); + struct platform_device *pdev = to_platform_device(dev); struct st_i2c_dev *i2c_dev = platform_get_drvdata(pdev); if (i2c_dev->busy) -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/