linux/drivers/net/ethernet/ibm
Himangi Saraogi 09b38aa1e7 ehea: Introduce the use of the managed version of kzalloc
This patch moves data allocated using kzalloc to managed data allocated
using devm_kzalloc and cleans now unnecessary kfrees in probe and remove
functions. Also, linux/device.h is added to make sure the devm_*()
routine declarations are unambiguously available.

The following Coccinelle semantic patch was used for making the change:

@platform@
identifier p, probefn, removefn;
@@
struct platform_driver p = {
  .probe = probefn,
  .remove = removefn,
};

@prb@
identifier platform.probefn, pdev;
expression e, e1, e2;
@@
probefn(struct platform_device *pdev, ...) {
  <+...
- e = kzalloc(e1, e2)
+ e = devm_kzalloc(&pdev->dev, e1, e2)
  ...
?-kfree(e);
  ...+>
}

@rem depends on prb@
identifier platform.removefn;
expression e;
@@
removefn(...) {
  <...
- kfree(e);
  ...>
}

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Compile-Tested-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-05-30 15:40:29 -07:00
..
ehea ehea: Introduce the use of the managed version of kzalloc 2014-05-30 15:40:29 -07:00
emac net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
ibmveth.c ibmveth: Call dev_consume_skb_any instead of dev_kfree_skb. 2014-03-24 21:19:03 -07:00
ibmveth.h ibmveth: Fix endian issues with MAC addresses 2014-03-06 16:26:41 -05:00
Kconfig ibm-ethernet: delete stale MCA and duplicate PSERIES dependency 2013-06-03 00:24:31 -07:00
Makefile