Skip to content

Commit

Permalink
drivers: usb: dwc3: remove devm_zalloc from linux_compact
Browse files Browse the repository at this point in the history
devm_zalloc() is already defined in dm/device.h header, so
devm_zalloc can be removed from linux_compact.h beader file.

Signed-off-by: Mugunthan V N <[email protected]>
  • Loading branch information
mugunthanvnm authored and Michal Simek committed Jan 11, 2017
1 parent 68607fc commit 3e55f76
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
7 changes: 5 additions & 2 deletions drivers/usb/dwc3/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <dwc3-uboot.h>
#include <asm/dma-mapping.h>
#include <linux/ioport.h>
#include <dm.h>

#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
Expand Down Expand Up @@ -111,7 +112,8 @@ static struct dwc3_event_buffer *dwc3_alloc_one_event_buffer(struct dwc3 *dwc,
{
struct dwc3_event_buffer *evt;

evt = devm_kzalloc(dwc->dev, sizeof(*evt), GFP_KERNEL);
evt = devm_kzalloc((struct udevice *)dwc->dev, sizeof(*evt),
GFP_KERNEL);
if (!evt)
return ERR_PTR(-ENOMEM);

Expand Down Expand Up @@ -622,7 +624,8 @@ int dwc3_uboot_init(struct dwc3_device *dwc3_dev)

void *mem;

mem = devm_kzalloc(dev, sizeof(*dwc) + DWC3_ALIGN_MASK, GFP_KERNEL);
mem = devm_kzalloc((struct udevice *)dev,
sizeof(*dwc) + DWC3_ALIGN_MASK, GFP_KERNEL);
if (!mem)
return -ENOMEM;

Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/dwc3/dwc3-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ int dwc3_omap_uboot_init(struct dwc3_omap_device *omap_dev)
struct device *dev = NULL;
struct dwc3_omap *omap;

omap = devm_kzalloc(dev, sizeof(*omap), GFP_KERNEL);
omap = devm_kzalloc((struct udevice *)dev, sizeof(*omap), GFP_KERNEL);
if (!omap)
return -ENOMEM;

Expand Down
5 changes: 0 additions & 5 deletions drivers/usb/dwc3/linux-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,4 @@ static inline size_t strlcat(char *dest, const char *src, size_t n)
return strlen(dest) + strlen(src);
}

static inline void *devm_kzalloc(struct device *dev, unsigned int size,
unsigned int flags)
{
return kzalloc(size, flags);
}
#endif
1 change: 1 addition & 0 deletions drivers/usb/dwc3/ti_usb_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <linux/ioport.h>
#include <asm/io.h>
#include <asm/arch/sys_proto.h>
#include <dm.h>

#include "linux-compat.h"

Expand Down

0 comments on commit 3e55f76

Please sign in to comment.