Skip to content

Commit 938fc64

Browse files
jonhuntergregkh
authored andcommitted
usb: gadget: u_ether: Convert prints to device prints
The USB ethernet gadget driver implements its own print macros which call printk. Device drivers should use the device prints that print the device name. Fortunately, the same macro names are defined in the header file 'linux/usb/composite.h' and these use the device prints. Therefore, remove the local definitions in the USB ethernet gadget driver and use those in 'linux/usb/composite.h'. The only difference is that now the device name is printed instead of the ethernet interface name. Tested using ethernet gadget on Jetson AGX Orin. Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/20230209125319.18589-1-jonathanh@nvidia.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5ec63fd commit 938fc64

1 file changed

Lines changed: 1 addition & 35 deletions

File tree

drivers/usb/gadget/function/u_ether.c

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/etherdevice.h>
1818
#include <linux/ethtool.h>
1919
#include <linux/if_vlan.h>
20+
#include <linux/usb/composite.h>
2021

2122
#include "u_ether.h"
2223

@@ -103,41 +104,6 @@ static inline int qlen(struct usb_gadget *gadget, unsigned qmult)
103104

104105
/*-------------------------------------------------------------------------*/
105106

106-
/* REVISIT there must be a better way than having two sets
107-
* of debug calls ...
108-
*/
109-
110-
#undef DBG
111-
#undef VDBG
112-
#undef ERROR
113-
#undef INFO
114-
115-
#define xprintk(d, level, fmt, args...) \
116-
printk(level "%s: " fmt , (d)->net->name , ## args)
117-
118-
#ifdef DEBUG
119-
#undef DEBUG
120-
#define DBG(dev, fmt, args...) \
121-
xprintk(dev , KERN_DEBUG , fmt , ## args)
122-
#else
123-
#define DBG(dev, fmt, args...) \
124-
do { } while (0)
125-
#endif /* DEBUG */
126-
127-
#ifdef VERBOSE_DEBUG
128-
#define VDBG DBG
129-
#else
130-
#define VDBG(dev, fmt, args...) \
131-
do { } while (0)
132-
#endif /* DEBUG */
133-
134-
#define ERROR(dev, fmt, args...) \
135-
xprintk(dev , KERN_ERR , fmt , ## args)
136-
#define INFO(dev, fmt, args...) \
137-
xprintk(dev , KERN_INFO , fmt , ## args)
138-
139-
/*-------------------------------------------------------------------------*/
140-
141107
/* NETWORK DRIVER HOOKUP (to the layer above this driver) */
142108

143109
static void eth_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *p)

0 commit comments

Comments
 (0)