aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-04 21:36:12 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-04 21:36:12 -0400
commit53ee983378ff23e8f3ff95ecf99dea7c6c221900 (patch)
tree85e09b2bf6317a155f1405be0d45c69051b6e041 /drivers/base
parent29b88e23a9212136d39b0161a39afe587d0170a5 (diff)
parentb9aaea39f65e242303103b5283abeaefd8e538a4 (diff)
Merge tag 'staging-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver updates from Greg KH: "Here's the big pull request for the staging driver tree for 3.17-rc1. Lots of things in here, over 2000 patches, but the best part is this: 1480 files changed, 39070 insertions(+), 254659 deletions(-) Thanks to the great work of Kristina Martšenko, 14 different staging drivers have been removed from the tree as they were obsolete and no one was willing to work on cleaning them up. Other than the driver removals, loads of cleanups are in here (comedi, lustre, etc.) as well as the usual IIO driver updates and additions. All of this has been in the linux-next tree for a while" * tag 'staging-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (2199 commits) staging: comedi: addi_apci_1564: remove diagnostic interrupt support code staging: comedi: addi_apci_1564: add subdevice to check diagnostic status staging: wlan-ng: coding style problem fix staging: wlan-ng: fixing coding style problems staging: comedi: ii_pci20kc: request and ioremap memory staging: lustre: bitwise vs logical typo staging: dgnc: Remove unneeded dgnc_trace.c and dgnc_trace.h staging: dgnc: rephrase comment staging: comedi: ni_tio: remove some dead code staging: rtl8723au: Fix static symbol sparse warning staging: rtl8723au: usb_dvobj_init(): Remove unused variable 'pdev_desc' staging: rtl8723au: Do not duplicate kernel provided USB macros staging: rtl8723au: Remove never set struct pwrctrl_priv.bHWPowerdown staging: rtl8723au: Remove two never set variables staging: rtl8723au: RSSI_test is never set staging:r8190: coding style: Fixed checkpatch reported Error staging:r8180: coding style: Fixed too long lines staging:r8180: coding style: Fixed commenting style staging: lustre: ptlrpc: lproc_ptlrpc.c - fix dereferenceing user space buffer staging: lustre: ldlm: ldlm_resource.c - fix dereferenceing user space buffer ...
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/devres.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/drivers/base/devres.c b/drivers/base/devres.c
index 52302946770f..69d9b0c89a01 100644
--- a/drivers/base/devres.c
+++ b/drivers/base/devres.c
@@ -817,6 +817,61 @@ char *devm_kstrdup(struct device *dev, const char *s, gfp_t gfp)
817EXPORT_SYMBOL_GPL(devm_kstrdup); 817EXPORT_SYMBOL_GPL(devm_kstrdup);
818 818
819/** 819/**
820 * devm_kvasprintf - Allocate resource managed space
821 * for the formatted string.
822 * @dev: Device to allocate memory for
823 * @gfp: the GFP mask used in the devm_kmalloc() call when
824 * allocating memory
825 * @fmt: the formatted string to duplicate
826 * @ap: the list of tokens to be placed in the formatted string
827 * RETURNS:
828 * Pointer to allocated string on success, NULL on failure.
829 */
830char *devm_kvasprintf(struct device *dev, gfp_t gfp, const char *fmt,
831 va_list ap)
832{
833 unsigned int len;
834 char *p;
835 va_list aq;
836
837 va_copy(aq, ap);
838 len = vsnprintf(NULL, 0, fmt, aq);
839 va_end(aq);
840
841 p = devm_kmalloc(dev, len+1, gfp);
842 if (!p)
843 return NULL;
844
845 vsnprintf(p, len+1, fmt, ap);
846
847 return p;
848}
849EXPORT_SYMBOL(devm_kvasprintf);
850
851/**
852 * devm_kasprintf - Allocate resource managed space
853 * and copy an existing formatted string into that
854 * @dev: Device to allocate memory for
855 * @gfp: the GFP mask used in the devm_kmalloc() call when
856 * allocating memory
857 * @fmt: the string to duplicate
858 * RETURNS:
859 * Pointer to allocated string on success, NULL on failure.
860 */
861char *devm_kasprintf(struct device *dev, gfp_t gfp, const char *fmt, ...)
862{
863 va_list ap;
864 char *p;
865
866 va_start(ap, fmt);
867 p = devm_kvasprintf(dev, gfp, fmt, ap);
868 va_end(ap);
869
870 return p;
871}
872EXPORT_SYMBOL_GPL(devm_kasprintf);
873
874/**
820 * devm_kfree - Resource-managed kfree 875 * devm_kfree - Resource-managed kfree
821 * @dev: Device this memory belongs to 876 * @dev: Device this memory belongs to
822 * @p: Memory to free 877 * @p: Memory to free