aboutsummaryrefslogtreecommitdiffstats
path: root/sound/aoa/soundbus
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2015-01-03 16:55:54 -0500
committerTakashi Iwai <tiwai@suse.de>2015-01-04 09:13:45 -0500
commitff6defa6a8fae12205d64f55db395b1fcf35af8e (patch)
treea08b5c63a0c7e21f955e254178dc53ea0d7b6e3f /sound/aoa/soundbus
parentb76c0e95ab0f535e210df588b8ac42dd75b31c75 (diff)
ALSA: Deletion of checks before the function call "iounmap"
The iounmap() function performs also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/aoa/soundbus')
-rw-r--r--sound/aoa/soundbus/i2sbus/core.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c
index 837ba99a7524..b9737fae656a 100644
--- a/sound/aoa/soundbus/i2sbus/core.c
+++ b/sound/aoa/soundbus/i2sbus/core.c
@@ -74,10 +74,9 @@ static void i2sbus_release_dev(struct device *dev)
74 int i; 74 int i;
75 75
76 i2sdev = container_of(dev, struct i2sbus_dev, sound.ofdev.dev); 76 i2sdev = container_of(dev, struct i2sbus_dev, sound.ofdev.dev);
77 77 iounmap(i2sdev->intfregs);
78 if (i2sdev->intfregs) iounmap(i2sdev->intfregs); 78 iounmap(i2sdev->out.dbdma);
79 if (i2sdev->out.dbdma) iounmap(i2sdev->out.dbdma); 79 iounmap(i2sdev->in.dbdma);
80 if (i2sdev->in.dbdma) iounmap(i2sdev->in.dbdma);
81 for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) 80 for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++)
82 release_and_free_resource(i2sdev->allocated_resource[i]); 81 release_and_free_resource(i2sdev->allocated_resource[i]);
83 free_dbdma_descriptor_ring(i2sdev, &i2sdev->out.dbdma_ring); 82 free_dbdma_descriptor_ring(i2sdev, &i2sdev->out.dbdma_ring);
@@ -318,9 +317,9 @@ static int i2sbus_add_dev(struct macio_dev *macio,
318 free_irq(dev->interrupts[i], dev); 317 free_irq(dev->interrupts[i], dev);
319 free_dbdma_descriptor_ring(dev, &dev->out.dbdma_ring); 318 free_dbdma_descriptor_ring(dev, &dev->out.dbdma_ring);
320 free_dbdma_descriptor_ring(dev, &dev->in.dbdma_ring); 319 free_dbdma_descriptor_ring(dev, &dev->in.dbdma_ring);
321 if (dev->intfregs) iounmap(dev->intfregs); 320 iounmap(dev->intfregs);
322 if (dev->out.dbdma) iounmap(dev->out.dbdma); 321 iounmap(dev->out.dbdma);
323 if (dev->in.dbdma) iounmap(dev->in.dbdma); 322 iounmap(dev->in.dbdma);
324 for (i=0;i<3;i++) 323 for (i=0;i<3;i++)
325 release_and_free_resource(dev->allocated_resource[i]); 324 release_and_free_resource(dev->allocated_resource[i]);
326 mutex_destroy(&dev->lock); 325 mutex_destroy(&dev->lock);