linux/drivers/net/ethernet/ibm/ehea
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_ethtool.c net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
ehea_hw.h drivers/net: fix up stale paths from driver reorg 2012-01-30 12:54:40 -05:00
ehea_main.c ehea: Introduce the use of the managed version of kzalloc 2014-05-30 15:40:29 -07:00
ehea_phyp.c ehea: Remove uses of virt_to_abs() and abs_to_virt() 2012-09-05 15:18:46 +10:00
ehea_phyp.h powerpc: Move get_longbusy_msecs into hvcall.h and remove duplicate function 2012-11-15 15:08:07 +11:00
ehea_qmr.c net: ethernet: ibm: ehea: ehea_qmr.c: Fix for possible null pointer dereference 2014-05-18 21:26:02 -04:00
ehea_qmr.h drivers/net: fix up stale paths from driver reorg 2012-01-30 12:54:40 -05:00
ehea.h ehea: Remove uses of virt_to_abs() and abs_to_virt() 2012-09-05 15:18:46 +10:00
Makefile