Skip to content

Commit

Permalink
USB: media: redrat3: remove unneeded tracing macro
Browse files Browse the repository at this point in the history
The rr3_ftr function duplicates the in-kernel tracing logic, so remove
it.

This is step 1 of of removing the CONFIG_USB_DEBUG depandancy in this
driver.

Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Sean Young <[email protected]>
Cc: Hans Verkuil <[email protected]>
Cc: Jonathan McCrohan <[email protected]>
Cc: James Hogan <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
gregkh committed May 29, 2014
1 parent 0ce5fb5 commit a36d5b6
Showing 1 changed file with 2 additions and 37 deletions.
39 changes: 2 additions & 37 deletions drivers/media/rc/redrat3.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ static int debug;
dev_info(dev, fmt, ## __VA_ARGS__); \
} while (0)

#define rr3_ftr(dev, fmt, ...) \
do { \
if (debug & RR3_DEBUG_FUNCTION_TRACE) \
dev_info(dev, fmt, ## __VA_ARGS__); \
} while (0)

/* bulk data transfer types */
#define RR3_ERROR 0x01
#define RR3_MOD_SIGNAL_IN 0x20
Expand Down Expand Up @@ -237,8 +231,6 @@ static void redrat3_issue_async(struct redrat3_dev *rr3)
{
int res;

rr3_ftr(rr3->dev, "Entering %s\n", __func__);

res = usb_submit_urb(rr3->read_urb, GFP_ATOMIC);
if (res)
rr3_dbg(rr3->dev, "%s: receive request FAILED! "
Expand Down Expand Up @@ -377,8 +369,6 @@ static void redrat3_process_ir_data(struct redrat3_dev *rr3)
return;
}

rr3_ftr(rr3->dev, "Entered %s\n", __func__);

dev = rr3->dev;

/* Make sure we reset the IR kfifo after a bit of inactivity */
Expand Down Expand Up @@ -464,8 +454,6 @@ static int redrat3_enable_detector(struct redrat3_dev *rr3)
struct device *dev = rr3->dev;
u8 ret;

rr3_ftr(dev, "Entering %s\n", __func__);

ret = redrat3_send_cmd(RR3_RC_DET_ENABLE, rr3);
if (ret != 0)
dev_dbg(dev, "%s: unexpected ret of %d\n",
Expand All @@ -486,7 +474,6 @@ static int redrat3_enable_detector(struct redrat3_dev *rr3)
static inline void redrat3_delete(struct redrat3_dev *rr3,
struct usb_device *udev)
{
rr3_ftr(rr3->dev, "%s cleaning up\n", __func__);
usb_kill_urb(rr3->read_urb);
usb_kill_urb(rr3->flash_urb);
usb_free_urb(rr3->read_urb);
Expand Down Expand Up @@ -535,8 +522,6 @@ static void redrat3_reset(struct redrat3_dev *rr3)
u8 *val;
int len = sizeof(u8);

rr3_ftr(dev, "Entering %s\n", __func__);

rxpipe = usb_rcvctrlpipe(udev, 0);
txpipe = usb_sndctrlpipe(udev, 0);

Expand Down Expand Up @@ -572,8 +557,6 @@ static void redrat3_get_firmware_rev(struct redrat3_dev *rr3)
int rc = 0;
char *buffer;

rr3_ftr(rr3->dev, "Entering %s\n", __func__);

buffer = kzalloc(sizeof(char) * (RR3_FW_VERSION_LEN + 1), GFP_KERNEL);
if (!buffer) {
dev_err(rr3->dev, "Memory allocation failure\n");
Expand All @@ -591,16 +574,13 @@ static void redrat3_get_firmware_rev(struct redrat3_dev *rr3)
dev_err(rr3->dev, "Problem fetching firmware ID\n");

kfree(buffer);
rr3_ftr(rr3->dev, "Exiting %s\n", __func__);
}

static void redrat3_read_packet_start(struct redrat3_dev *rr3, unsigned len)
{
struct redrat3_header *header = rr3->bulk_in_buf;
unsigned pktlen, pkttype;

rr3_ftr(rr3->dev, "Entering %s\n", __func__);

/* grab the Length and type of transfer */
pktlen = be16_to_cpu(header->length);
pkttype = be16_to_cpu(header->transfer_type);
Expand Down Expand Up @@ -637,8 +617,6 @@ static void redrat3_read_packet_continue(struct redrat3_dev *rr3, unsigned len)
{
void *irdata = &rr3->irdata;

rr3_ftr(rr3->dev, "Entering %s\n", __func__);

if (len + rr3->bytes_read > sizeof(rr3->irdata)) {
dev_warn(rr3->dev, "too much data for packet\n");
rr3->bytes_read = 0;
Expand All @@ -659,8 +637,6 @@ static int redrat3_get_ir_data(struct redrat3_dev *rr3, unsigned len)
unsigned pkttype;
int ret = 0;

rr3_ftr(dev, "Entering %s\n", __func__);

if (rr3->bytes_read == 0 && len >= sizeof(struct redrat3_header)) {
redrat3_read_packet_start(rr3, len);
} else if (rr3->bytes_read != 0) {
Expand Down Expand Up @@ -705,8 +681,6 @@ static void redrat3_handle_async(struct urb *urb)
return;
}

rr3_ftr(rr3->dev, "Entering %s\n", __func__);

switch (urb->status) {
case 0:
ret = redrat3_get_ir_data(rr3, urb->actual_length);
Expand Down Expand Up @@ -764,8 +738,6 @@ static int redrat3_transmit_ir(struct rc_dev *rcdev, unsigned *txbuf,
u8 curlencheck = 0;
unsigned i, sendbuf_len;

rr3_ftr(dev, "Entering %s\n", __func__);

if (rr3->transmitting) {
dev_warn(dev, "%s: transmitter already in use\n", __func__);
return -EAGAIN;
Expand Down Expand Up @@ -957,8 +929,6 @@ static int redrat3_dev_probe(struct usb_interface *intf,
int pipe, i;
int retval = -ENOMEM;

rr3_ftr(dev, "%s called\n", __func__);

uhi = intf->cur_altsetting;

/* find our bulk-in and bulk-out endpoints */
Expand Down Expand Up @@ -1074,7 +1044,6 @@ static int redrat3_dev_probe(struct usb_interface *intf,
/* we can register the device now, as it is ready */
usb_set_intfdata(intf, rr3);

rr3_ftr(dev, "Exiting %s\n", __func__);
return 0;

led_free_error:
Expand All @@ -1093,8 +1062,6 @@ static void redrat3_dev_disconnect(struct usb_interface *intf)
struct usb_device *udev = interface_to_usbdev(intf);
struct redrat3_dev *rr3 = usb_get_intfdata(intf);

rr3_ftr(&intf->dev, "Entering %s\n", __func__);

if (!rr3)
return;

Expand All @@ -1103,14 +1070,12 @@ static void redrat3_dev_disconnect(struct usb_interface *intf)
led_classdev_unregister(&rr3->led);
del_timer_sync(&rr3->rx_timeout);
redrat3_delete(rr3, udev);

rr3_ftr(&intf->dev, "RedRat3 IR Transceiver now disconnected\n");
}

static int redrat3_dev_suspend(struct usb_interface *intf, pm_message_t message)
{
struct redrat3_dev *rr3 = usb_get_intfdata(intf);
rr3_ftr(rr3->dev, "suspend\n");

led_classdev_suspend(&rr3->led);
usb_kill_urb(rr3->read_urb);
usb_kill_urb(rr3->flash_urb);
Expand All @@ -1120,7 +1085,7 @@ static int redrat3_dev_suspend(struct usb_interface *intf, pm_message_t message)
static int redrat3_dev_resume(struct usb_interface *intf)
{
struct redrat3_dev *rr3 = usb_get_intfdata(intf);
rr3_ftr(rr3->dev, "resume\n");

if (usb_submit_urb(rr3->read_urb, GFP_ATOMIC))
return -EIO;
led_classdev_resume(&rr3->led);
Expand Down

0 comments on commit a36d5b6

Please sign in to comment.