dma: sh: remove unnecessary platform_set_drvdata()
PATCH 1/1 dma: sh: remove unnecessary platform_set_drvdata()
The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/dma/sh/shdma.c | 3 --- drivers/dma/sh/sudmac.c | 2 -- 2 files changed, 5 deletions(-)
drivers/dma/sh/shdma.c +0 -3
@@ -873,7 +873,6 @@ rst_err:pm_runtime_put (&pdev->dev);pm_runtime_disable (&pdev->dev); -platform_set_drvdata (pdev,NULL );shdma_cleanup (&shdev->shdma_dev); eshdma:if (dmars)
@@ -917,8 +916,6 @@ static int sh_dmae_remove(struct platform_device *pdev)iounmap (shdev->dmars);iounmap (shdev->chan_reg); -platform_set_drvdata (pdev,NULL ); -synchronize_rcu ();kfree (shdev);
drivers/dma/sh/sudmac.c +0 -2
@@ -393,7 +393,6 @@ static int sudmac_probe(struct platform_device *pdev) chan_probe_err:sudmac_chan_remove (su_dev); -platform_set_drvdata (pdev,NULL );shdma_cleanup (&su_dev->shdma_dev);return err;
@@ -407,7 +406,6 @@ static int sudmac_remove(struct platform_device *pdev)dma_async_device_unregister (dma_dev);sudmac_chan_remove (su_dev);shdma_cleanup (&su_dev->shdma_dev); -platform_set_drvdata (pdev,NULL );return 0 ; }
Signature · 1 line
1.7.10.4
Quoted 3 lines · Jingoo Han
The driver core clears the driver data to NULL after
device_releaseor on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
Vinod, could you take this?
Quoted 52 lines
Signed-off-by Jingoo Han <[email protected]>--- drivers/dma/sh/shdma.c | 3 --- drivers/dma/sh/sudmac.c | 2 -- 2 files changed, 5 deletions(-)drivers/dma/sh/shdma.c +0
-3@@ -873,7 +873,6 @@ rst_err:pm_runtime_put (&pdev->dev);pm_runtime_disable (&pdev->dev); -platform_set_drvdata (pdev,NULL );shdma_cleanup (&shdev->shdma_dev); eshdma:if (dmars)@@ -917,8 +916,6 @@ static int sh_dmae_remove(struct platform_device *pdev)iounmap (shdev->dmars);iounmap (shdev->chan_reg); -platform_set_drvdata (pdev,NULL ); -synchronize_rcu ();kfree (shdev);drivers/dma/sh/sudmac.c +0
-2@@ -393,7 +393,6 @@ static int sudmac_probe(struct platform_device *pdev) chan_probe_err:sudmac_chan_remove (su_dev); -platform_set_drvdata (pdev,NULL );shdma_cleanup (&su_dev->shdma_dev);return err;@@ -407,7 +406,6 @@ static int sudmac_remove(struct platform_device *pdev)dma_async_device_unregister (dma_dev);sudmac_chan_remove (su_dev);shdma_cleanup (&su_dev->shdma_dev); -platform_set_drvdata (pdev,NULL );return 0 ; }Signature · 1 line
1.7.10.4
Quoted 5 lines · Jingoo Han
The driver core clears the driver data to NULL after
device_releaseor on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.Signed-off-by Jingoo Han <[email protected]>
This has to be updated on top of current
http://git.infradead.org/users/vkoul/slave-dma.git next branch, there it will patch the drivers/dma/sh/shdmac.c file, not drivers/dma/sh/shdma.c. After that feel free to add my
Thanks
Guennadi
Quoted 50 lines
--- drivers/dma/sh/shdma.c | 3 --- drivers/dma/sh/sudmac.c | 2 -- 2 files changed, 5 deletions(-)drivers/dma/sh/shdma.c +0
-3@@ -873,7 +873,6 @@ rst_err:pm_runtime_put (&pdev->dev);pm_runtime_disable (&pdev->dev); -platform_set_drvdata (pdev,NULL );shdma_cleanup (&shdev->shdma_dev); eshdma:if (dmars)@@ -917,8 +916,6 @@ static int sh_dmae_remove(struct platform_device *pdev)iounmap (shdev->dmars);iounmap (shdev->chan_reg); -platform_set_drvdata (pdev,NULL ); -synchronize_rcu ();kfree (shdev);drivers/dma/sh/sudmac.c +0
-2@@ -393,7 +393,6 @@ static int sudmac_probe(struct platform_device *pdev) chan_probe_err:sudmac_chan_remove (su_dev); -platform_set_drvdata (pdev,NULL );shdma_cleanup (&su_dev->shdma_dev);return err;@@ -407,7 +406,6 @@ static int sudmac_remove(struct platform_device *pdev)dma_async_device_unregister (dma_dev);sudmac_chan_remove (su_dev);shdma_cleanup (&su_dev->shdma_dev); -platform_set_drvdata (pdev,NULL );return 0 ; }Signature · 1 line
1.7.10.4
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
Quoted 6 lines · Guennadi Liakhovetski
Quoted 4 lines · Jingoo Han
The driver core clears the driver data to NULL after
device_releaseor on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
Quoted 6 lines
Quoted 1 line
Signed-off-by Jingoo Han <[email protected]>This has to be updated on top of current
http://git.infradead.org/users/vkoul/slave-dma.git next branch, there it will patch thedrivers/dma/sh/shdmac.cfile, notdrivers/dma/sh/shdma.c. After that feel free to add my
He already updated & i have applied...
Quoted 2 lines
added...
~Vinod