From patchwork Fri Jan 1 12:28:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 7939001 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 90CEC9F32E for ; Fri, 1 Jan 2016 12:29:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BA0E520557 for ; Fri, 1 Jan 2016 12:29:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C925E2054D for ; Fri, 1 Jan 2016 12:29:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751750AbcAAM3e (ORCPT ); Fri, 1 Jan 2016 07:29:34 -0500 Received: from m50-135.163.com ([123.125.50.135]:59785 "EHLO m50-135.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751726AbcAAM3d (ORCPT ); Fri, 1 Jan 2016 07:29:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=UlwYLY6RH7uMLVlTs4 UdljY6OrsGCTwucrqVrogfnmg=; b=R8d4IQN7I2r1rCjQf0ORvGYt4DdzhWZyqu fslrsPou3J4uI+OccB5Z0+hO6Xx0n05sCrTfjcnmYFYwFyDF0vfq5R8x6PuKbctV Jmjold3GoP66BlYKvKNsl4LfB1WGtaNX3RD5kNFQRaPg43XiOoPPX5D0mRPJIvfG ajy6poJ2c= Received: from localhost (unknown [116.77.129.183]) by smtp5 (Coremail) with SMTP id D9GowADX3K0TcYZWCq3fCQ--.37487S3; Fri, 01 Jan 2016 20:29:09 +0800 (CST) From: Geliang Tang To: Mark Brown , Moritz Fischer Cc: Geliang Tang , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2 v2] spi: cadence: use to_platform_device() Date: Fri, 1 Jan 2016 20:28:59 +0800 Message-Id: <80986828f7ac394fef839514fbbc78ce0b18a675.1451650817.git.geliangtang@163.com> X-Mailer: git-send-email 2.5.0 X-CM-TRANSID: D9GowADX3K0TcYZWCq3fCQ--.37487S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7KFWxJrWfGrW8KF4fCrW7urg_yoW8GFyfpF 1UJayrG3yxWFW0k3WfJw1DZF13A34Sq348KF10k39ak3s0qr95GFyrJFyrAr43JFWkCF47 Xasrt3ykZa15Zr7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UonQUUUUUU= X-Originating-IP: [116.77.129.183] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbiNRXimVSILKUMEQAAsT 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-cadence.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-cadence.c b/drivers/spi/spi-cadence.c index 5a67498..121a413 100644 --- a/drivers/spi/spi-cadence.c +++ b/drivers/spi/spi-cadence.c @@ -617,8 +617,7 @@ static int cdns_spi_remove(struct platform_device *pdev) */ static int __maybe_unused cdns_spi_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); struct cdns_spi *xspi = spi_master_get_devdata(master); @@ -641,8 +640,7 @@ static int __maybe_unused cdns_spi_suspend(struct device *dev) */ static int __maybe_unused cdns_spi_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 cdns_spi *xspi = spi_master_get_devdata(master); int ret = 0;