diff options
| author | Himangi Saraogi <himangi774@gmail.com> | 2014-08-02 10:52:46 -0400 |
|---|---|---|
| committer | John W. Linville <linville@tuxdriver.com> | 2014-08-25 16:00:43 -0400 |
| commit | 26c0604628f85d435a664f52fd2ca30aab812266 (patch) | |
| tree | ebfb93a7fb09f805b97d23fdfb1d1e62ead57d63 /drivers/net/wireless/cw1200 | |
| parent | 6040aa70c30276e6cd2aacd1f428c3f05462a7f1 (diff) | |
cw1200: Introduce the use of devm_kzalloc
This patch introduces the use of devm_kzalloc and does away with the
kfrees in the probe and remove functions.
Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/cw1200')
| -rw-r--r-- | drivers/net/wireless/cw1200/cw1200_spi.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/wireless/cw1200/cw1200_spi.c b/drivers/net/wireless/cw1200/cw1200_spi.c index 40078f5f932e..964b64ab7fe3 100644 --- a/drivers/net/wireless/cw1200/cw1200_spi.c +++ b/drivers/net/wireless/cw1200/cw1200_spi.c | |||
| @@ -398,7 +398,7 @@ static int cw1200_spi_probe(struct spi_device *func) | |||
| 398 | return -1; | 398 | return -1; |
| 399 | } | 399 | } |
| 400 | 400 | ||
| 401 | self = kzalloc(sizeof(*self), GFP_KERNEL); | 401 | self = devm_kzalloc(&func->dev, sizeof(*self), GFP_KERNEL); |
| 402 | if (!self) { | 402 | if (!self) { |
| 403 | pr_err("Can't allocate SPI hwbus_priv."); | 403 | pr_err("Can't allocate SPI hwbus_priv."); |
| 404 | return -ENOMEM; | 404 | return -ENOMEM; |
| @@ -424,7 +424,6 @@ static int cw1200_spi_probe(struct spi_device *func) | |||
| 424 | if (status) { | 424 | if (status) { |
| 425 | cw1200_spi_irq_unsubscribe(self); | 425 | cw1200_spi_irq_unsubscribe(self); |
| 426 | cw1200_spi_off(plat_data); | 426 | cw1200_spi_off(plat_data); |
| 427 | kfree(self); | ||
| 428 | } | 427 | } |
| 429 | 428 | ||
| 430 | return status; | 429 | return status; |
| @@ -441,7 +440,6 @@ static int cw1200_spi_disconnect(struct spi_device *func) | |||
| 441 | cw1200_core_release(self->core); | 440 | cw1200_core_release(self->core); |
| 442 | self->core = NULL; | 441 | self->core = NULL; |
| 443 | } | 442 | } |
| 444 | kfree(self); | ||
| 445 | } | 443 | } |
| 446 | cw1200_spi_off(dev_get_platdata(&func->dev)); | 444 | cw1200_spi_off(dev_get_platdata(&func->dev)); |
| 447 | 445 | ||
