From patchwork Fri Jan 1 12:29:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 7939021 Return-Path: X-Original-To: patchwork-linux-spi@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 8E2219F32E for ; Fri, 1 Jan 2016 12:31:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B750B20561 for ; Fri, 1 Jan 2016 12:31:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DC5392055C for ; Fri, 1 Jan 2016 12:30:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751737AbcAAMa7 (ORCPT ); Fri, 1 Jan 2016 07:30:59 -0500 Received: from m50-134.163.com ([123.125.50.134]:48758 "EHLO m50-134.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751689AbcAAMa6 (ORCPT ); Fri, 1 Jan 2016 07:30:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=TTWOFIrFoiAB3g+xnx ZDRmAzYT5i7tHcx4NpUda2syo=; b=eizITbOnQf4gBGi/xurrs5/Dx3z1c85Gge CAH8PfIV0GKsFcUJNGkUoUsws83LgDnKVRxFNFZ2gu5BfVx/pgtNVwcajDKzznqh h1IENGk3ibNFgl9dhhXdsrPey9uyfpy09yR5rG4h5Zvg98VqGMdKL1Upf1Pg1YG6 VrK8DMM5A= Received: from localhost (unknown [116.77.129.183]) by smtp4 (Coremail) with SMTP id DtGowEA5lkMbcYZWsUsKAA--.7313S3; Fri, 01 Jan 2016 20:29:15 +0800 (CST) From: Geliang Tang To: Mark Brown , Michal Simek , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= , Moritz Fischer Cc: Geliang Tang , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2 v2] spi: zynq: use to_platform_device() Date: Fri, 1 Jan 2016 20:29:00 +0800 Message-Id: X-Mailer: git-send-email 2.5.0 In-Reply-To: <80986828f7ac394fef839514fbbc78ce0b18a675.1451650817.git.geliangtang@163.com> References: <80986828f7ac394fef839514fbbc78ce0b18a675.1451650817.git.geliangtang@163.com> In-Reply-To: <80986828f7ac394fef839514fbbc78ce0b18a675.1451650817.git.geliangtang@163.com> References: <80986828f7ac394fef839514fbbc78ce0b18a675.1451650817.git.geliangtang@163.com> X-CM-TRANSID: DtGowEA5lkMbcYZWsUsKAA--.7313S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7KFWxJrWfGrW8Kry7ZrWDurg_yoW8Gw4rpF 4DJayrKrW8WFy09w12gw4DZFyayF1fK348tw18tws3K34Dtr95XFyrtFyrJr43GFWkCF40 qF17t3y8Wa15Zr7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07Uw_-9UUUUU= X-Originating-IP: [116.77.129.183] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbivxzimVWBPXJDJgAAsm Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Use to_platform_device() instead of open-coding it. Signed-off-by: Geliang Tang Reviewed-by: Moritz Fischer --- Changes in v2: - split from 'spi: cadence, zynq: use to_platform_device()' --- drivers/spi/spi-zynqmp-gqspi.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c index f23f36e..aab9b49 100644 --- a/drivers/spi/spi-zynqmp-gqspi.c +++ b/drivers/spi/spi-zynqmp-gqspi.c @@ -917,9 +917,7 @@ static int zynqmp_qspi_start_transfer(struct spi_master *master, */ static int __maybe_unused zynqmp_qspi_suspend(struct device *dev) { - struct platform_device *pdev = container_of(dev, - struct platform_device, - dev); + struct platform_device *pdev = to_platform_device(dev); struct spi_master *master = platform_get_drvdata(pdev); spi_master_suspend(master); @@ -940,9 +938,7 @@ static int __maybe_unused zynqmp_qspi_suspend(struct device *dev) */ static int __maybe_unused zynqmp_qspi_resume(struct device *dev) { - struct platform_device *pdev = container_of(dev, - struct platform_device, - dev); + struct platform_device *pdev = to_platform_device(dev); struct spi_master *master = platform_get_drvdata(pdev); struct zynqmp_qspi *xqspi = spi_master_get_devdata(master); int ret = 0;