diff options
Diffstat (limited to 'drivers/media/usb/hdpvr/hdpvr-core.c')
-rw-r--r-- | drivers/media/usb/hdpvr/hdpvr-core.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c index c5638964c3f2..42b4cdf28cfd 100644 --- a/drivers/media/usb/hdpvr/hdpvr-core.c +++ b/drivers/media/usb/hdpvr/hdpvr-core.c | |||
@@ -124,14 +124,6 @@ static int device_authorization(struct hdpvr_device *dev) | |||
124 | int ret, retval = -ENOMEM; | 124 | int ret, retval = -ENOMEM; |
125 | char request_type = 0x38, rcv_request = 0x81; | 125 | char request_type = 0x38, rcv_request = 0x81; |
126 | char *response; | 126 | char *response; |
127 | #ifdef HDPVR_DEBUG | ||
128 | size_t buf_size = 46; | ||
129 | char *print_buf = kzalloc(5*buf_size+1, GFP_KERNEL); | ||
130 | if (!print_buf) { | ||
131 | v4l2_err(&dev->v4l2_dev, "Out of memory\n"); | ||
132 | return retval; | ||
133 | } | ||
134 | #endif | ||
135 | 127 | ||
136 | mutex_lock(&dev->usbc_mutex); | 128 | mutex_lock(&dev->usbc_mutex); |
137 | ret = usb_control_msg(dev->udev, | 129 | ret = usb_control_msg(dev->udev, |
@@ -147,11 +139,9 @@ static int device_authorization(struct hdpvr_device *dev) | |||
147 | } | 139 | } |
148 | #ifdef HDPVR_DEBUG | 140 | #ifdef HDPVR_DEBUG |
149 | else { | 141 | else { |
150 | hex_dump_to_buffer(dev->usbc_buf, 46, 16, 1, print_buf, | ||
151 | 5*buf_size+1, 0); | ||
152 | v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev, | 142 | v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev, |
153 | "Status request returned, len %d: %s\n", | 143 | "Status request returned, len %d: %46ph\n", |
154 | ret, print_buf); | 144 | ret, dev->usbc_buf); |
155 | } | 145 | } |
156 | #endif | 146 | #endif |
157 | 147 | ||
@@ -189,15 +179,13 @@ static int device_authorization(struct hdpvr_device *dev) | |||
189 | 179 | ||
190 | response = dev->usbc_buf+38; | 180 | response = dev->usbc_buf+38; |
191 | #ifdef HDPVR_DEBUG | 181 | #ifdef HDPVR_DEBUG |
192 | hex_dump_to_buffer(response, 8, 16, 1, print_buf, 5*buf_size+1, 0); | 182 | v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev, "challenge: %8ph\n", |
193 | v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev, "challenge: %s\n", | 183 | response); |
194 | print_buf); | ||
195 | #endif | 184 | #endif |
196 | challenge(response); | 185 | challenge(response); |
197 | #ifdef HDPVR_DEBUG | 186 | #ifdef HDPVR_DEBUG |
198 | hex_dump_to_buffer(response, 8, 16, 1, print_buf, 5*buf_size+1, 0); | 187 | v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev, " response: %8ph\n", |
199 | v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev, " response: %s\n", | 188 | response); |
200 | print_buf); | ||
201 | #endif | 189 | #endif |
202 | 190 | ||
203 | msleep(100); | 191 | msleep(100); |
@@ -213,9 +201,6 @@ static int device_authorization(struct hdpvr_device *dev) | |||
213 | retval = ret != 8; | 201 | retval = ret != 8; |
214 | unlock: | 202 | unlock: |
215 | mutex_unlock(&dev->usbc_mutex); | 203 | mutex_unlock(&dev->usbc_mutex); |
216 | #ifdef HDPVR_DEBUG | ||
217 | kfree(print_buf); | ||
218 | #endif | ||
219 | return retval; | 204 | return retval; |
220 | } | 205 | } |
221 | 206 | ||