dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [09/61] dmaengine: qcom: simplify getting .drvdata
@ 2018-04-22  6:21 Vinod Koul
  0 siblings, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2018-04-22  6:21 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-kernel, linux-renesas-soc, kernel-janitors, Andy Gross,
	David Brown, Dan Williams, linux-arm-msm, linux-soc, dmaengine

On Thu, Apr 19, 2018 at 04:05:39PM +0200, Wolfram Sang wrote:
> We should get drvdata from struct device directly. Going via
> platform_device is an unneeded step back and forth.

Applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [09/61] dmaengine: qcom: simplify getting .drvdata
@ 2018-04-19 15:16 Sinan Kaya
  0 siblings, 0 replies; 3+ messages in thread
From: Sinan Kaya @ 2018-04-19 15:16 UTC (permalink / raw)
  To: Wolfram Sang, linux-kernel
  Cc: linux-renesas-soc, kernel-janitors, Andy Gross, David Brown,
	Vinod Koul, Dan Williams, linux-arm-msm, linux-soc, dmaengine

On 4/19/2018 10:05 AM, 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 <wsa+renesas@sang-engineering.com>
> ---
> 
> Build tested only. buildbot is happy. Please apply individually.
> 
>  drivers/dma/qcom/hidma.c          | 3 +--
>  drivers/dma/qcom/hidma_mgmt_sys.c | 6 ++----
>  2 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c
> index 963cc5228d05..43d4b00b8138 100644
> --- a/drivers/dma/qcom/hidma.c
> +++ b/drivers/dma/qcom/hidma.c
> @@ -616,8 +616,7 @@ static irqreturn_t hidma_chirq_handler_msi(int chirq, void *arg)
>  static ssize_t hidma_show_values(struct device *dev,
>  				 struct device_attribute *attr, char *buf)
>  {
> -	struct platform_device *pdev = to_platform_device(dev);
> -	struct hidma_dev *mdev = platform_get_drvdata(pdev);
> +	struct hidma_dev *mdev = dev_get_drvdata(dev);
>  
>  	buf[0] = 0;
>  
> diff --git a/drivers/dma/qcom/hidma_mgmt_sys.c b/drivers/dma/qcom/hidma_mgmt_sys.c
> index d61f1068a34b..cbb89eafd844 100644
> --- a/drivers/dma/qcom/hidma_mgmt_sys.c
> +++ b/drivers/dma/qcom/hidma_mgmt_sys.c
> @@ -107,8 +107,7 @@ static struct hidma_mgmt_fileinfo hidma_mgmt_files[] = {
>  static ssize_t show_values(struct device *dev, struct device_attribute *attr,
>  			   char *buf)
>  {
> -	struct platform_device *pdev = to_platform_device(dev);
> -	struct hidma_mgmt_dev *mdev = platform_get_drvdata(pdev);
> +	struct hidma_mgmt_dev *mdev = dev_get_drvdata(dev);
>  	unsigned int i;
>  
>  	buf[0] = 0;
> @@ -125,8 +124,7 @@ static ssize_t show_values(struct device *dev, struct device_attribute *attr,
>  static ssize_t set_values(struct device *dev, struct device_attribute *attr,
>  			  const char *buf, size_t count)
>  {
> -	struct platform_device *pdev = to_platform_device(dev);
> -	struct hidma_mgmt_dev *mdev = platform_get_drvdata(pdev);
> +	struct hidma_mgmt_dev *mdev = dev_get_drvdata(dev);
>  	unsigned long tmp;
>  	unsigned int i;
>  	int rc;
> 

Reviewed-by: Sinan Kaya <okaya@codeaurora.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [09/61] dmaengine: qcom: simplify getting .drvdata
@ 2018-04-19 14:05 Wolfram Sang
  0 siblings, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2018-04-19 14:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-renesas-soc, kernel-janitors, Wolfram Sang, Andy Gross,
	David Brown, Vinod Koul, Dan Williams, linux-arm-msm, linux-soc,
	dmaengine

We should get drvdata from struct device directly. Going via
platform_device is an unneeded step back and forth.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Build tested only. buildbot is happy. Please apply individually.

 drivers/dma/qcom/hidma.c          | 3 +--
 drivers/dma/qcom/hidma_mgmt_sys.c | 6 ++----
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c
index 963cc5228d05..43d4b00b8138 100644
--- a/drivers/dma/qcom/hidma.c
+++ b/drivers/dma/qcom/hidma.c
@@ -616,8 +616,7 @@ static irqreturn_t hidma_chirq_handler_msi(int chirq, void *arg)
 static ssize_t hidma_show_values(struct device *dev,
 				 struct device_attribute *attr, char *buf)
 {
-	struct platform_device *pdev = to_platform_device(dev);
-	struct hidma_dev *mdev = platform_get_drvdata(pdev);
+	struct hidma_dev *mdev = dev_get_drvdata(dev);
 
 	buf[0] = 0;
 
diff --git a/drivers/dma/qcom/hidma_mgmt_sys.c b/drivers/dma/qcom/hidma_mgmt_sys.c
index d61f1068a34b..cbb89eafd844 100644
--- a/drivers/dma/qcom/hidma_mgmt_sys.c
+++ b/drivers/dma/qcom/hidma_mgmt_sys.c
@@ -107,8 +107,7 @@ static struct hidma_mgmt_fileinfo hidma_mgmt_files[] = {
 static ssize_t show_values(struct device *dev, struct device_attribute *attr,
 			   char *buf)
 {
-	struct platform_device *pdev = to_platform_device(dev);
-	struct hidma_mgmt_dev *mdev = platform_get_drvdata(pdev);
+	struct hidma_mgmt_dev *mdev = dev_get_drvdata(dev);
 	unsigned int i;
 
 	buf[0] = 0;
@@ -125,8 +124,7 @@ static ssize_t show_values(struct device *dev, struct device_attribute *attr,
 static ssize_t set_values(struct device *dev, struct device_attribute *attr,
 			  const char *buf, size_t count)
 {
-	struct platform_device *pdev = to_platform_device(dev);
-	struct hidma_mgmt_dev *mdev = platform_get_drvdata(pdev);
+	struct hidma_mgmt_dev *mdev = dev_get_drvdata(dev);
 	unsigned long tmp;
 	unsigned int i;
 	int rc;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-22  6:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-22  6:21 [09/61] dmaengine: qcom: simplify getting .drvdata Vinod Koul
  -- strict thread matches above, loose matches on Subject: below --
2018-04-19 15:16 Sinan Kaya
2018-04-19 14:05 Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).