Received: by 10.192.165.148 with SMTP id m20csp3047155imm; Sun, 22 Apr 2018 22:49:00 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/RjWYoEP58At6rdgs/eVULf7GsrJ7/xwNdv5SBnEVKfYdYxkLwQOrwk29xRvvwKu31UGie X-Received: by 2002:a17:902:24e:: with SMTP id 72-v6mr19130395plc.87.1524462540256; Sun, 22 Apr 2018 22:49:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524462540; cv=none; d=google.com; s=arc-20160816; b=mz4AzoTGeDf9c6zYemZiw7c7N+apHw+qdozd1941ZZtZLKmudcAqg14mflfxO+v+L9 ZJlrOPg0UrT1CE1vMZiv0hLCtKzz9fucnZ5LK/jFBmKYBTYMBwGwxKJVm3Dw9aSNKSvQ MIWGD9B5pPqjhmLKtBeU2meGTFm4gM5Ut+OodYQjTMeTWUDmvt81YXDF4lBxo3Ffft2q dMmRovEwEd/ZDq6y+MpvVIqDNWy/gv0NhW8PCIIX4tFxC6aAf7hZ7OeSK4NY0p5ugSYs US9+B8tq8TGqrZFwnuhDmJWXCwTaz0iOz98VN0E6QymJCtGaiJCILqDAVTowlAqJlqPt hylw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:arc-authentication-results; bh=9PjWwSoKABXO9fX0XPDJ39AzILRdcAsk5NtdoGwnpmg=; b=Ni+Uc7CyZmJ4wnkWyuENSZCG9icMMTRdbw2P37jN9PP9odNuGYdHR9yFTxEoh4WvaE MM6wqC8WpRVhtxsSz1gbVFmDnfzkRc6FzIEJEJbzlPmZw8kEnPznkLuBt8i4DUHfKUaY HwSCbwDJZDlb7xs45y6UOc5AFezVbBjka478fMIXaGqrJqzRJXMu1cBpjCA6PVAst9oN EdJEhKpzmU30GEQBvzp8k4lW6+4uHLhuum8cyfVAHcBHGNWfnXsMd3+VkNKM2P0sxEIu Mev4Cn3D4WdK5jwQmZcyHAqKY91QlHjIuyPWRAAD1DwHPocbcdX0+Wm9pavls0NxC12y yPjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t3si8488181pgp.194.2018.04.22.22.48.45; Sun, 22 Apr 2018 22:49:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751588AbeDWFrR (ORCPT + 99 others); Mon, 23 Apr 2018 01:47:17 -0400 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:39543 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750852AbeDWFrO (ORCPT ); Mon, 23 Apr 2018 01:47:14 -0400 X-IronPort-AV: E=Sophos;i="5.49,316,1520924400"; d="scan'208";a="14117867" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 22 Apr 2018 22:47:13 -0700 Received: from localhost (10.10.76.4) by CHN-SV-EXCH01.mchp-main.com (10.10.76.37) with Microsoft SMTP Server id 14.3.352.0; Sun, 22 Apr 2018 22:47:12 -0700 Date: Mon, 23 Apr 2018 07:46:31 +0200 From: Ludovic Desroches To: Wolfram Sang CC: , Ludovic Desroches , Vinod Koul , Dan Williams , , Subject: Re: [PATCH 2/6] dmaengine: at_xdmac: simplify getting .drvdata Message-ID: <20180423054631.GF13305@rfolt0960.corp.atmel.com> Mail-Followup-To: Wolfram Sang , dmaengine@vger.kernel.org, Vinod Koul , Dan Williams , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20180422091415.7587-1-wsa+renesas@sang-engineering.com> <20180422091415.7587-3-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180422091415.7587-3-wsa+renesas@sang-engineering.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 22, 2018 at 11:14:10AM +0200, Wolfram Sang wrote: > We should get drvdata from struct device directly. Going via > platform_device is an unneeded step back and forth. > > Signed-off-by: Wolfram Sang Acked-by: Ludovic Desroches Thanks > --- > > Build tested only. buildbot is happy. Please apply to your tree directly. > > drivers/dma/at_xdmac.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c > index 94236ec9d410..4bf72561667c 100644 > --- a/drivers/dma/at_xdmac.c > +++ b/drivers/dma/at_xdmac.c > @@ -1833,8 +1833,7 @@ static void at_xdmac_free_chan_resources(struct dma_chan *chan) > #ifdef CONFIG_PM > static int atmel_xdmac_prepare(struct device *dev) > { > - struct platform_device *pdev = to_platform_device(dev); > - struct at_xdmac *atxdmac = platform_get_drvdata(pdev); > + struct at_xdmac *atxdmac = dev_get_drvdata(dev); > struct dma_chan *chan, *_chan; > > list_for_each_entry_safe(chan, _chan, &atxdmac->dma.channels, device_node) { > @@ -1853,8 +1852,7 @@ static int atmel_xdmac_prepare(struct device *dev) > #ifdef CONFIG_PM_SLEEP > static int atmel_xdmac_suspend(struct device *dev) > { > - struct platform_device *pdev = to_platform_device(dev); > - struct at_xdmac *atxdmac = platform_get_drvdata(pdev); > + struct at_xdmac *atxdmac = dev_get_drvdata(dev); > struct dma_chan *chan, *_chan; > > list_for_each_entry_safe(chan, _chan, &atxdmac->dma.channels, device_node) { > @@ -1878,8 +1876,7 @@ static int atmel_xdmac_suspend(struct device *dev) > > static int atmel_xdmac_resume(struct device *dev) > { > - struct platform_device *pdev = to_platform_device(dev); > - struct at_xdmac *atxdmac = platform_get_drvdata(pdev); > + struct at_xdmac *atxdmac = dev_get_drvdata(dev); > struct at_xdmac_chan *atchan; > struct dma_chan *chan, *_chan; > int i; > -- > 2.11.0 >