aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-01-19 07:06:22 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 13:11:04 -0500
commit36bd883ef98ac6003ab6ec7b91f66d3fb2159318 (patch)
tree3bf3b5a05ffd3084df6ba18529810c3568c20ea2 /drivers/media
parent56d15cd313d0d0d7a16c1a2e2cc519f18ab4725a (diff)
V4L/DVB: uvcvideo: Use %pUl printk format specifier to print GUIDs
Replace the UVC_GUID_FORMAT and UVC_GUID_ARGS macros with the new %pUl printk format specifier. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/uvc/uvc_ctrl.c72
-rw-r--r--drivers/media/video/uvc/uvc_driver.c9
-rw-r--r--drivers/media/video/uvc/uvcvideo.h10
3 files changed, 36 insertions, 55 deletions
diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c
index ec8ef8c5560a..61576946329d 100644
--- a/drivers/media/video/uvc/uvc_ctrl.c
+++ b/drivers/media/video/uvc/uvc_ctrl.c
@@ -1080,10 +1080,8 @@ int uvc_xu_ctrl_query(struct uvc_video_chain *chain,
1080 } 1080 }
1081 1081
1082 if (!found) { 1082 if (!found) {
1083 uvc_trace(UVC_TRACE_CONTROL, 1083 uvc_trace(UVC_TRACE_CONTROL, "Control %pUl/%u not found.\n",
1084 "Control " UVC_GUID_FORMAT "/%u not found.\n", 1084 entity->extension.guidExtensionCode, xctrl->selector);
1085 UVC_GUID_ARGS(entity->extension.guidExtensionCode),
1086 xctrl->selector);
1087 return -EINVAL; 1085 return -EINVAL;
1088 } 1086 }
1089 1087
@@ -1159,9 +1157,9 @@ int uvc_ctrl_resume_device(struct uvc_device *dev)
1159 (ctrl->info->flags & UVC_CONTROL_RESTORE) == 0) 1157 (ctrl->info->flags & UVC_CONTROL_RESTORE) == 0)
1160 continue; 1158 continue;
1161 1159
1162 printk(KERN_INFO "restoring control " UVC_GUID_FORMAT 1160 printk(KERN_INFO "restoring control %pUl/%u/%u\n",
1163 "/%u/%u\n", UVC_GUID_ARGS(ctrl->info->entity), 1161 ctrl->info->entity, ctrl->info->index,
1164 ctrl->info->index, ctrl->info->selector); 1162 ctrl->info->selector);
1165 ctrl->dirty = 1; 1163 ctrl->dirty = 1;
1166 } 1164 }
1167 1165
@@ -1215,47 +1213,43 @@ static void uvc_ctrl_add_ctrl(struct uvc_device *dev,
1215 ret = uvc_query_ctrl(dev, UVC_GET_LEN, ctrl->entity->id, 1213 ret = uvc_query_ctrl(dev, UVC_GET_LEN, ctrl->entity->id,
1216 dev->intfnum, info->selector, (__u8 *)&size, 2); 1214 dev->intfnum, info->selector, (__u8 *)&size, 2);
1217 if (ret < 0) { 1215 if (ret < 0) {
1218 uvc_trace(UVC_TRACE_CONTROL, "GET_LEN failed on " 1216 uvc_trace(UVC_TRACE_CONTROL,
1219 "control " UVC_GUID_FORMAT "/%u (%d).\n", 1217 "GET_LEN failed on control %pUl/%u (%d).\n",
1220 UVC_GUID_ARGS(info->entity), info->selector, 1218 info->entity, info->selector, ret);
1221 ret);
1222 return; 1219 return;
1223 } 1220 }
1224 1221
1225 if (info->size != le16_to_cpu(size)) { 1222 if (info->size != le16_to_cpu(size)) {
1226 uvc_trace(UVC_TRACE_CONTROL, "Control " UVC_GUID_FORMAT 1223 uvc_trace(UVC_TRACE_CONTROL, "Control %pUl/%u size "
1227 "/%u size doesn't match user supplied " 1224 "doesn't match user supplied value.\n",
1228 "value.\n", UVC_GUID_ARGS(info->entity), 1225 info->entity, info->selector);
1229 info->selector);
1230 return; 1226 return;
1231 } 1227 }
1232 1228
1233 ret = uvc_query_ctrl(dev, UVC_GET_INFO, ctrl->entity->id, 1229 ret = uvc_query_ctrl(dev, UVC_GET_INFO, ctrl->entity->id,
1234 dev->intfnum, info->selector, &inf, 1); 1230 dev->intfnum, info->selector, &inf, 1);
1235 if (ret < 0) { 1231 if (ret < 0) {
1236 uvc_trace(UVC_TRACE_CONTROL, "GET_INFO failed on " 1232 uvc_trace(UVC_TRACE_CONTROL,
1237 "control " UVC_GUID_FORMAT "/%u (%d).\n", 1233 "GET_INFO failed on control %pUl/%u (%d).\n",
1238 UVC_GUID_ARGS(info->entity), info->selector, 1234 info->entity, info->selector, ret);
1239 ret);
1240 return; 1235 return;
1241 } 1236 }
1242 1237
1243 flags = info->flags; 1238 flags = info->flags;
1244 if (((flags & UVC_CONTROL_GET_CUR) && !(inf & (1 << 0))) || 1239 if (((flags & UVC_CONTROL_GET_CUR) && !(inf & (1 << 0))) ||
1245 ((flags & UVC_CONTROL_SET_CUR) && !(inf & (1 << 1)))) { 1240 ((flags & UVC_CONTROL_SET_CUR) && !(inf & (1 << 1)))) {
1246 uvc_trace(UVC_TRACE_CONTROL, "Control " 1241 uvc_trace(UVC_TRACE_CONTROL, "Control %pUl/%u flags "
1247 UVC_GUID_FORMAT "/%u flags don't match " 1242 "don't match supported operations.\n",
1248 "supported operations.\n", 1243 info->entity, info->selector);
1249 UVC_GUID_ARGS(info->entity), info->selector);
1250 return; 1244 return;
1251 } 1245 }
1252 } 1246 }
1253 1247
1254 ctrl->info = info; 1248 ctrl->info = info;
1255 ctrl->data = kmalloc(ctrl->info->size * UVC_CTRL_NDATA, GFP_KERNEL); 1249 ctrl->data = kmalloc(ctrl->info->size * UVC_CTRL_NDATA, GFP_KERNEL);
1256 uvc_trace(UVC_TRACE_CONTROL, "Added control " UVC_GUID_FORMAT "/%u " 1250 uvc_trace(UVC_TRACE_CONTROL, "Added control %pUl/%u to device %s "
1257 "to device %s entity %u\n", UVC_GUID_ARGS(ctrl->info->entity), 1251 "entity %u\n", ctrl->info->entity, ctrl->info->selector,
1258 ctrl->info->selector, dev->udev->devpath, entity->id); 1252 dev->udev->devpath, entity->id);
1259} 1253}
1260 1254
1261/* 1255/*
@@ -1281,17 +1275,16 @@ int uvc_ctrl_add_info(struct uvc_control_info *info)
1281 continue; 1275 continue;
1282 1276
1283 if (ctrl->selector == info->selector) { 1277 if (ctrl->selector == info->selector) {
1284 uvc_trace(UVC_TRACE_CONTROL, "Control " 1278 uvc_trace(UVC_TRACE_CONTROL,
1285 UVC_GUID_FORMAT "/%u is already defined.\n", 1279 "Control %pUl/%u is already defined.\n",
1286 UVC_GUID_ARGS(info->entity), info->selector); 1280 info->entity, info->selector);
1287 ret = -EEXIST; 1281 ret = -EEXIST;
1288 goto end; 1282 goto end;
1289 } 1283 }
1290 if (ctrl->index == info->index) { 1284 if (ctrl->index == info->index) {
1291 uvc_trace(UVC_TRACE_CONTROL, "Control " 1285 uvc_trace(UVC_TRACE_CONTROL,
1292 UVC_GUID_FORMAT "/%u would overwrite index " 1286 "Control %pUl/%u would overwrite index %d.\n",
1293 "%d.\n", UVC_GUID_ARGS(info->entity), 1287 info->entity, info->selector, info->index);
1294 info->selector, info->index);
1295 ret = -EEXIST; 1288 ret = -EEXIST;
1296 goto end; 1289 goto end;
1297 } 1290 }
@@ -1332,10 +1325,9 @@ int uvc_ctrl_add_mapping(struct uvc_control_mapping *mapping)
1332 continue; 1325 continue;
1333 1326
1334 if (info->size * 8 < mapping->size + mapping->offset) { 1327 if (info->size * 8 < mapping->size + mapping->offset) {
1335 uvc_trace(UVC_TRACE_CONTROL, "Mapping '%s' would " 1328 uvc_trace(UVC_TRACE_CONTROL,
1336 "overflow control " UVC_GUID_FORMAT "/%u\n", 1329 "Mapping '%s' would overflow control %pUl/%u\n",
1337 mapping->name, UVC_GUID_ARGS(info->entity), 1330 mapping->name, info->entity, info->selector);
1338 info->selector);
1339 ret = -EOVERFLOW; 1331 ret = -EOVERFLOW;
1340 goto end; 1332 goto end;
1341 } 1333 }
@@ -1354,9 +1346,9 @@ int uvc_ctrl_add_mapping(struct uvc_control_mapping *mapping)
1354 1346
1355 mapping->ctrl = info; 1347 mapping->ctrl = info;
1356 list_add_tail(&mapping->list, &info->mappings); 1348 list_add_tail(&mapping->list, &info->mappings);
1357 uvc_trace(UVC_TRACE_CONTROL, "Adding mapping %s to control " 1349 uvc_trace(UVC_TRACE_CONTROL,
1358 UVC_GUID_FORMAT "/%u.\n", mapping->name, 1350 "Adding mapping %s to control %pUl/%u.\n",
1359 UVC_GUID_ARGS(info->entity), info->selector); 1351 mapping->name, info->entity, info->selector);
1360 1352
1361 ret = 0; 1353 ret = 0;
1362 break; 1354 break;
diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c
index fc7db17afb29..a814820a3f6e 100644
--- a/drivers/media/video/uvc/uvc_driver.c
+++ b/drivers/media/video/uvc/uvc_driver.c
@@ -315,11 +315,10 @@ static int uvc_parse_format(struct uvc_device *dev,
315 sizeof format->name); 315 sizeof format->name);
316 format->fcc = fmtdesc->fcc; 316 format->fcc = fmtdesc->fcc;
317 } else { 317 } else {
318 uvc_printk(KERN_INFO, "Unknown video format " 318 uvc_printk(KERN_INFO, "Unknown video format %pUl\n",
319 UVC_GUID_FORMAT "\n", 319 &buffer[5]);
320 UVC_GUID_ARGS(&buffer[5])); 320 snprintf(format->name, sizeof(format->name), "%pUl\n",
321 snprintf(format->name, sizeof format->name, 321 &buffer[5]);
322 UVC_GUID_FORMAT, UVC_GUID_ARGS(&buffer[5]));
323 format->fcc = 0; 322 format->fcc = 0;
324 } 323 }
325 324
diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h
index d0d3e25e1c09..0c7966fdb83d 100644
--- a/drivers/media/video/uvc/uvcvideo.h
+++ b/drivers/media/video/uvc/uvcvideo.h
@@ -556,16 +556,6 @@ extern unsigned int uvc_timeout_param;
556#define uvc_printk(level, msg...) \ 556#define uvc_printk(level, msg...) \
557 printk(level "uvcvideo: " msg) 557 printk(level "uvcvideo: " msg)
558 558
559#define UVC_GUID_FORMAT "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-" \
560 "%02x%02x%02x%02x%02x%02x"
561#define UVC_GUID_ARGS(guid) \
562 (guid)[3], (guid)[2], (guid)[1], (guid)[0], \
563 (guid)[5], (guid)[4], \
564 (guid)[7], (guid)[6], \
565 (guid)[8], (guid)[9], \
566 (guid)[10], (guid)[11], (guid)[12], \
567 (guid)[13], (guid)[14], (guid)[15]
568
569/* -------------------------------------------------------------------------- 559/* --------------------------------------------------------------------------
570 * Internal functions. 560 * Internal functions.
571 */ 561 */