diff options
Diffstat (limited to 'drivers/base/core.c')
-rw-r--r-- | drivers/base/core.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index 3dff5037943e..704ba73e1459 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -17,7 +17,6 @@ #include <linux/kstrtox.h> #include <linux/module.h> #include <linux/slab.h> -#include <linux/string.h> #include <linux/kdev_t.h> #include <linux/notifier.h> #include <linux/of.h> @@ -28,6 +27,7 @@ #include <linux/netdevice.h> #include <linux/sched/signal.h> #include <linux/sched/mm.h> +#include <linux/string_helpers.h> #include <linux/swiotlb.h> #include <linux/sysfs.h> #include <linux/dma-map-ops.h> /* for dma_default_coherent */ @@ -3108,9 +3108,7 @@ void device_initialize(struct device *dev) defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL) dev->dma_coherent = dma_default_coherent; #endif -#ifdef CONFIG_SWIOTLB - dev->dma_io_tlb_mem = &io_tlb_default_mem; -#endif + swiotlb_dev_init(dev); } EXPORT_SYMBOL_GPL(device_initialize); @@ -3910,10 +3908,9 @@ const char *device_get_devnode(const struct device *dev, return dev_name(dev); /* replace '!' in the name with '/' */ - s = kstrdup(dev_name(dev), GFP_KERNEL); + s = kstrdup_and_replace(dev_name(dev), '!', '/', GFP_KERNEL); if (!s) return NULL; - strreplace(s, '!', '/'); return *tmp = s; } |