Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1735594 > unrolled thread
| Started by | Corentin Labbe <clabbe.montjoie@gmail.com> |
|---|---|
| First post | 2017-09-20 09:30 +0200 |
| Last post | 2017-09-21 19:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH v2] dmaengine: sun6i: use of_device_get_match_data Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-09-20 09:30 +0200
Re: [PATCH v2] dmaengine: sun6i: use of_device_get_match_data Vinod Koul <vinod.koul@intel.com> - 2017-09-21 19:30 +0200
| From | Corentin Labbe <clabbe.montjoie@gmail.com> |
|---|---|
| Date | 2017-09-20 09:30 +0200 |
| Subject | [PATCH v2] dmaengine: sun6i: use of_device_get_match_data |
| Message-ID | <urHCi-8iH-17@gated-at.bofh.it> |
The usage of of_device_get_match_data reduce the code size a bit.
Furthermore, it prevents an improbable dereference when
of_match_device() return NULL.
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
Changes since v1:
- fixed commit title
drivers/dma/sun6i-dma.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c
index bcd496edc70f..584f4e82a9be 100644
--- a/drivers/dma/sun6i-dma.c
+++ b/drivers/dma/sun6i-dma.c
@@ -1064,7 +1064,6 @@ MODULE_DEVICE_TABLE(of, sun6i_dma_match);
static int sun6i_dma_probe(struct platform_device *pdev)
{
- const struct of_device_id *device;
struct sun6i_dma_dev *sdc;
struct resource *res;
int ret, i;
@@ -1073,10 +1072,9 @@ static int sun6i_dma_probe(struct platform_device *pdev)
if (!sdc)
return -ENOMEM;
- device = of_match_device(sun6i_dma_match, &pdev->dev);
- if (!device)
+ sdc->cfg = of_device_get_match_data(&pdev->dev);
+ if (!sdc->cfg)
return -ENODEV;
- sdc->cfg = device->data;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
sdc->base = devm_ioremap_resource(&pdev->dev, res);
--
2.13.5
[toc] | [next] | [standalone]
| From | Vinod Koul <vinod.koul@intel.com> |
|---|---|
| Date | 2017-09-21 19:30 +0200 |
| Message-ID | <usdst-3Vx-9@gated-at.bofh.it> |
| In reply to | #1735594 |
On Wed, Sep 20, 2017 at 09:24:02AM +0200, Corentin Labbe wrote: > The usage of of_device_get_match_data reduce the code size a bit. > Furthermore, it prevents an improbable dereference when > of_match_device() return NULL. Applied, thanks -- ~Vinod
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web