Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: gpib: Replace custom debug with dev_dbg

Remove GPIB_KERNEL_DEBUG config option
Remove GPIB_DEBUG reference
Replace GPIB_DPRINTK with dev_dbg
Change pr_alert to dev_alert

Signed-off-by: Dave Penkler <dpenkler@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20241104175014.12317-3-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dave Penkler and committed by
Greg Kroah-Hartman
a836d4ec 8023618a

+147 -158
-10
drivers/staging/gpib/Kconfig
··· 12 12 13 13 if GPIB 14 14 15 - config GPIB_KERNEL_DEBUG 16 - bool "GPIB debugging" 17 - depends on BROKEN 18 - help 19 - This is an option for use by developers; most people should 20 - say N here. 21 - 22 - It enables gpib core and driver debugging 23 - messages to be printed on the console. 24 - 25 15 config GPIB_COMMON 26 16 tristate "GPIB core" 27 17 help
-1
drivers/staging/gpib/Makefile
··· 1 1 2 - subdir-ccflags-$(CONFIG_GPIB_KERNEL_DEBUG) := -DGPIB_DEBUG 3 2 subdir-ccflags-y += -I$(src)/include -I$(src)/uapi 4 3 5 4 obj-$(CONFIG_GPIB_AGILENT_82350B) += agilent_82350b/
+1 -1
drivers/staging/gpib/cb7210/cb7210.c
··· 479 479 status2 = read_byte(nec_priv, ISR2); 480 480 nec7210_interrupt_have_status(board, nec_priv, status1, status2); 481 481 482 - GPIB_DPRINTK("cb7210: status 0x%x, mode 0x%x\n", hs_status, priv->hs_mode_bits); 482 + dev_dbg(board->gpib_dev, "cb7210: status 0x%x, mode 0x%x\n", hs_status, priv->hs_mode_bits); 483 483 484 484 clear_bits = 0; 485 485
+73 -65
drivers/staging/gpib/common/gpib_os.c
··· 69 69 70 70 static int cleanup_open_devices(gpib_file_private_t *file_priv, gpib_board_t *board); 71 71 72 - static int pop_gpib_event_nolock(gpib_event_queue_t *queue, short *event_type); 72 + static int pop_gpib_event_nolock(gpib_board_t *board, gpib_event_queue_t *queue, short *event_type); 73 73 74 74 /* 75 75 * Timer functions ··· 225 225 } 226 226 227 227 // push status byte onto back of status byte fifo 228 - int push_status_byte(gpib_status_queue_t *device, u8 poll_byte) 228 + int push_status_byte(gpib_board_t *board, gpib_status_queue_t *device, u8 poll_byte) 229 229 { 230 230 struct list_head *head = &device->status_bytes; 231 231 status_byte_t *status; ··· 236 236 u8 lost_byte; 237 237 238 238 device->dropped_byte = 1; 239 - retval = pop_status_byte(device, &lost_byte); 239 + retval = pop_status_byte(board, device, &lost_byte); 240 240 if (retval < 0) 241 241 return retval; 242 242 } ··· 252 252 253 253 device->num_status_bytes++; 254 254 255 - GPIB_DPRINTK("pushed status byte 0x%x, %i in queue\n", 256 - (int)poll_byte, num_status_bytes(device)); 255 + dev_dbg(board->gpib_dev, "pushed status byte 0x%x, %i in queue\n", 256 + (int)poll_byte, num_status_bytes(device)); 257 257 258 258 return 0; 259 259 } 260 260 261 261 // pop status byte from front of status byte fifo 262 - int pop_status_byte(gpib_status_queue_t *device, u8 *poll_byte) 262 + int pop_status_byte(gpib_board_t *board, gpib_status_queue_t *device, u8 *poll_byte) 263 263 { 264 264 struct list_head *head = &device->status_bytes; 265 265 struct list_head *front = head->next; ··· 284 284 285 285 device->num_status_bytes--; 286 286 287 - GPIB_DPRINTK("popped status byte 0x%x, %i in queue\n", 288 - (int)*poll_byte, num_status_bytes(device)); 287 + dev_dbg(board->gpib_dev, "popped status byte 0x%x, %i in queue\n", 288 + (int)*poll_byte, num_status_bytes(device)); 289 289 290 290 return 0; 291 291 } ··· 310 310 { 311 311 gpib_status_queue_t *device; 312 312 313 - GPIB_DPRINTK("%s:()\n", __func__); 313 + dev_dbg(board->gpib_dev, "%s:()\n", __func__); 314 314 315 315 device = get_gpib_status_queue(board, pad, sad); 316 316 if (num_status_bytes(device)) 317 - return pop_status_byte(device, poll_byte); 317 + return pop_status_byte(board, device, poll_byte); 318 318 else 319 319 return dvrsp(board, pad, sad, usec_timeout, poll_byte); 320 320 } ··· 323 323 { 324 324 int retval; 325 325 326 - GPIB_DPRINTK("entering %s()\n", __func__); 326 + dev_dbg(board->gpib_dev, "entering %s()\n", __func__); 327 327 if (mutex_lock_interruptible(&board->user_mutex)) 328 328 return -ERESTARTSYS; 329 329 if (mutex_lock_interruptible(&board->big_gpib_mutex)) { ··· 331 331 return -ERESTARTSYS; 332 332 } 333 333 334 - GPIB_DPRINTK("autopoll has board lock\n"); 334 + dev_dbg(board->gpib_dev, "autopoll has board lock\n"); 335 335 336 336 retval = serial_poll_all(board, serial_timeout); 337 337 if (retval < 0) { ··· 340 340 return retval; 341 341 } 342 342 343 - GPIB_DPRINTK("%s complete\n", __func__); 343 + dev_dbg(board->gpib_dev, "%s complete\n", __func__); 344 344 /* need to wake wait queue in case someone is 345 345 * waiting on RQS 346 346 */ ··· 358 358 size_t bytes_written; 359 359 int ret; 360 360 361 - GPIB_DPRINTK("entering %s()\n", __func__); 361 + dev_dbg(board->gpib_dev, "entering %s()\n", __func__); 362 362 363 363 os_start_timer(board, usec_timeout); 364 364 ret = ibcac(board, 1, 1); ··· 394 394 int i; 395 395 size_t nbytes; 396 396 397 - GPIB_DPRINTK("entering %s(), pad=%i sad=%i\n", __func__, pad, sad); 397 + dev_dbg(board->gpib_dev, "entering %s(), pad=%i sad=%i\n", __func__, pad, sad); 398 398 399 399 os_start_timer(board, usec_timeout); 400 400 ret = ibcac(board, 1, 1); ··· 436 436 int ret; 437 437 size_t bytes_written; 438 438 439 - GPIB_DPRINTK("entering %s()\n", __func__); 439 + dev_dbg(board->gpib_dev, "entering %s()\n", __func__); 440 440 441 441 os_start_timer(board, usec_timeout); 442 442 ret = ibcac(board, 1, 1); ··· 485 485 u8 result; 486 486 unsigned int num_bytes = 0; 487 487 488 - GPIB_DPRINTK("entering %s()\n", __func__); 488 + dev_dbg(board->gpib_dev, "entering %s()\n", __func__); 489 489 490 490 head = &board->device_list; 491 491 if (head->next == head) ··· 502 502 if (retval < 0) 503 503 continue; 504 504 if (result & request_service_bit) { 505 - retval = push_status_byte(device, result); 505 + retval = push_status_byte(board, device, result); 506 506 if (retval < 0) 507 507 continue; 508 508 num_bytes++; ··· 596 596 priv = filep->private_data; 597 597 init_gpib_file_private((gpib_file_private_t *)filep->private_data); 598 598 599 - GPIB_DPRINTK("pid %i, gpib: opening minor %d\n", current->pid, minor); 599 + dev_dbg(board->gpib_dev, "pid %i, gpib: opening minor %d\n", current->pid, minor); 600 600 601 601 if (board->use_count == 0) { 602 602 int retval; 603 603 604 604 retval = request_module("gpib%i", minor); 605 605 if (retval) { 606 - GPIB_DPRINTK("pid %i, gpib: request module returned %i\n", 607 - current->pid, retval); 606 + dev_dbg(board->gpib_dev, "pid %i, gpib: request module returned %i\n", 607 + current->pid, retval); 608 608 } 609 609 } 610 610 if (board->interface) { ··· 630 630 return -ENODEV; 631 631 } 632 632 633 - GPIB_DPRINTK("pid %i, gpib: closing minor %d\n", current->pid, minor); 634 - 635 633 board = &board_array[minor]; 634 + 635 + dev_dbg(board->gpib_dev, "pid %i, closing minor %d\n", current->pid, minor); 636 636 637 637 if (priv) { 638 638 desc = handle_to_descriptor(priv, 0); 639 639 if (desc) { 640 640 if (desc->autopoll_enabled) { 641 - GPIB_DPRINTK("pid %i, gpib: decrementing autospollers\n", 642 - current->pid); 641 + dev_dbg(board->gpib_dev, "pid %i, decrementing autospollers\n", 642 + current->pid); 643 643 if (board->autospollers > 0) 644 644 board->autospollers--; 645 645 else ··· 682 682 if (mutex_lock_interruptible(&board->big_gpib_mutex)) 683 683 return -ERESTARTSYS; 684 684 685 - GPIB_DPRINTK("pid %i, minor %i, ioctl %d, interface=%s, use=%d, onl=%d\n", 686 - current->pid, minor, cmd & 0xff, 687 - board->interface ? board->interface->name : "", 688 - board->use_count, 689 - board->online); 685 + dev_dbg(board->gpib_dev, "pid %i, ioctl %d, interface=%s, use=%d, onl=%d\n", 686 + current->pid, cmd & 0xff, 687 + board->interface ? board->interface->name : "", 688 + board->use_count, 689 + board->online); 690 690 691 691 switch (cmd) { 692 692 case CFCBOARDTYPE: ··· 870 870 871 871 done: 872 872 mutex_unlock(&board->big_gpib_mutex); 873 - GPIB_DPRINTK("ioctl done status = 0x%lx\n", board->status); 873 + dev_dbg(board->gpib_dev, "ioctl done status = 0x%lx\n", board->status); 874 874 return retval; 875 875 } 876 876 ··· 1180 1180 return 0; 1181 1181 } 1182 1182 1183 - static int increment_open_device_count(struct list_head *head, unsigned int pad, int sad) 1183 + static int increment_open_device_count(gpib_board_t *board, struct list_head *head, 1184 + unsigned int pad, int sad) 1184 1185 { 1185 1186 struct list_head *list_ptr; 1186 1187 gpib_status_queue_t *device; ··· 1192 1191 for (list_ptr = head->next; list_ptr != head; list_ptr = list_ptr->next) { 1193 1192 device = list_entry(list_ptr, gpib_status_queue_t, list); 1194 1193 if (gpib_address_equal(device->pad, device->sad, pad, sad)) { 1195 - GPIB_DPRINTK("pid %i, incrementing open count for pad %i, sad %i\n", 1196 - current->pid, device->pad, device->sad); 1194 + dev_dbg(board->gpib_dev, "pid %i, incrementing open count for pad %i, sad %i\n", 1195 + current->pid, device->pad, device->sad); 1197 1196 device->reference_count++; 1198 1197 return 0; 1199 1198 } ··· 1210 1209 1211 1210 list_add(&device->list, head); 1212 1211 1213 - GPIB_DPRINTK("pid %i, opened pad %i, sad %i\n", 1214 - current->pid, device->pad, device->sad); 1212 + dev_dbg(board->gpib_dev, "pid %i, opened pad %i, sad %i\n", 1213 + current->pid, device->pad, device->sad); 1215 1214 1216 1215 return 0; 1217 1216 } 1218 1217 1219 - static int subtract_open_device_count(struct list_head *head, unsigned int pad, int sad, 1220 - unsigned int count) 1218 + static int subtract_open_device_count(gpib_board_t *board, struct list_head *head, 1219 + unsigned int pad, int sad, unsigned int count) 1221 1220 { 1222 1221 gpib_status_queue_t *device; 1223 1222 struct list_head *list_ptr; ··· 1225 1224 for (list_ptr = head->next; list_ptr != head; list_ptr = list_ptr->next) { 1226 1225 device = list_entry(list_ptr, gpib_status_queue_t, list); 1227 1226 if (gpib_address_equal(device->pad, device->sad, pad, sad)) { 1228 - GPIB_DPRINTK("pid %i, decrementing open count for pad %i, sad %i\n", 1229 - current->pid, device->pad, device->sad); 1227 + dev_dbg(board->gpib_dev, "pid %i, decrementing open count for pad %i, sad %i\n", 1228 + current->pid, device->pad, device->sad); 1230 1229 if (count > device->reference_count) { 1231 1230 pr_err("gpib: bug! in %s()\n", __func__); 1232 1231 return -EINVAL; 1233 1232 } 1234 1233 device->reference_count -= count; 1235 1234 if (device->reference_count == 0) { 1236 - GPIB_DPRINTK("pid %i, closing pad %i, sad %i\n", 1237 - current->pid, device->pad, device->sad); 1235 + dev_dbg(board->gpib_dev, "pid %i, closing pad %i, sad %i\n", 1236 + current->pid, device->pad, device->sad); 1238 1237 list_del(list_ptr); 1239 1238 kfree(device); 1240 1239 } ··· 1245 1244 return -EINVAL; 1246 1245 } 1247 1246 1248 - static inline int decrement_open_device_count(struct list_head *head, unsigned int pad, int sad) 1247 + static inline int decrement_open_device_count(gpib_board_t *board, struct list_head *head, 1248 + unsigned int pad, int sad) 1249 1249 { 1250 - return subtract_open_device_count(head, pad, sad, 1); 1250 + return subtract_open_device_count(board, head, pad, sad, 1); 1251 1251 } 1252 1252 1253 1253 static int cleanup_open_devices(gpib_file_private_t *file_priv, gpib_board_t *board) ··· 1264 1262 continue; 1265 1263 1266 1264 if (desc->is_board == 0) { 1267 - retval = decrement_open_device_count(&board->device_list, desc->pad, 1265 + retval = decrement_open_device_count(board, &board->device_list, desc->pad, 1268 1266 desc->sad); 1269 1267 if (retval < 0) 1270 1268 return retval; ··· 1308 1306 file_priv->descriptors[i]->is_board = open_dev_cmd.is_board; 1309 1307 mutex_unlock(&file_priv->descriptors_mutex); 1310 1308 1311 - retval = increment_open_device_count(&board->device_list, open_dev_cmd.pad, 1309 + retval = increment_open_device_count(board, &board->device_list, open_dev_cmd.pad, 1312 1310 open_dev_cmd.sad); 1313 1311 if (retval < 0) 1314 1312 return retval; ··· 1341 1339 if (!file_priv->descriptors[cmd.handle]) 1342 1340 return -EINVAL; 1343 1341 1344 - retval = decrement_open_device_count(&board->device_list, 1342 + retval = decrement_open_device_count(board, &board->device_list, 1345 1343 file_priv->descriptors[cmd.handle]->pad, 1346 1344 file_priv->descriptors[cmd.handle]->sad); 1347 1345 if (retval < 0) ··· 1358 1356 serial_poll_ioctl_t serial_cmd; 1359 1357 int retval; 1360 1358 1361 - GPIB_DPRINTK("pid %i, entering %s()\n", __func__, current->pid); 1359 + dev_dbg(board->gpib_dev, "pid %i, entering %s()\n", current->pid, __func__); 1362 1360 1363 1361 retval = copy_from_user(&serial_cmd, (void *)arg, sizeof(serial_cmd)); 1364 1362 if (retval) ··· 1523 1521 if (retval < 0) 1524 1522 return retval; 1525 1523 } else { 1526 - retval = decrement_open_device_count(&board->device_list, desc->pad, desc->sad); 1524 + retval = decrement_open_device_count(board, &board->device_list, desc->pad, 1525 + desc->sad); 1527 1526 if (retval < 0) 1528 1527 return retval; 1529 1528 1530 1529 desc->pad = cmd.pad; 1531 1530 1532 - retval = increment_open_device_count(&board->device_list, desc->pad, desc->sad); 1531 + retval = increment_open_device_count(board, &board->device_list, desc->pad, 1532 + desc->sad); 1533 1533 if (retval < 0) 1534 1534 return retval; 1535 1535 } ··· 1559 1555 if (retval < 0) 1560 1556 return retval; 1561 1557 } else { 1562 - retval = decrement_open_device_count(&board->device_list, desc->pad, desc->sad); 1558 + retval = decrement_open_device_count(board, &board->device_list, desc->pad, 1559 + desc->sad); 1563 1560 if (retval < 0) 1564 1561 return retval; 1565 1562 1566 1563 desc->sad = cmd.sad; 1567 1564 1568 - retval = increment_open_device_count(&board->device_list, desc->pad, desc->sad); 1565 + retval = increment_open_device_count(board, &board->device_list, desc->pad, 1566 + desc->sad); 1569 1567 if (retval < 0) 1570 1568 return retval; 1571 1569 } ··· 1723 1717 1724 1718 atomic_set(&file_priv->holding_mutex, 1); 1725 1719 1726 - GPIB_DPRINTK("pid %i, locked board %d mutex\n", current->pid, board->minor); 1720 + dev_dbg(board->gpib_dev, "pid %i, locked board %d mutex\n", 1721 + current->pid, board->minor); 1727 1722 } else { 1728 1723 spin_lock(&board->locking_pid_spinlock); 1729 1724 if (current->pid != board->locking_pid) { ··· 1739 1732 atomic_set(&file_priv->holding_mutex, 0); 1740 1733 1741 1734 mutex_unlock(&board->user_mutex); 1742 - GPIB_DPRINTK("pid %i, unlocked board %i mutex\n", current->pid, board->minor); 1735 + dev_dbg(board->gpib_dev, "pid %i, unlocked board %i mutex\n", 1736 + current->pid, board->minor); 1743 1737 } 1744 1738 return 0; 1745 1739 } ··· 1755 1747 return -EFAULT; 1756 1748 1757 1749 board->usec_timeout = timeout; 1758 - GPIB_DPRINTK("pid %i, timeout set to %i usec\n", current->pid, timeout); 1750 + dev_dbg(board->gpib_dev, "pid %i, timeout set to %i usec\n", current->pid, timeout); 1759 1751 1760 1752 return 0; 1761 1753 } ··· 1930 1922 short lost_event; 1931 1923 1932 1924 queue->dropped_event = 1; 1933 - retval = pop_gpib_event_nolock(queue, &lost_event); 1925 + retval = pop_gpib_event_nolock(board, queue, &lost_event); 1934 1926 if (retval < 0) 1935 1927 return retval; 1936 1928 } ··· 1949 1941 1950 1942 queue->num_events++; 1951 1943 1952 - GPIB_DPRINTK("pushed event %i, %i in queue\n", 1953 - (int)event_type, num_gpib_events(queue)); 1944 + dev_dbg(board->gpib_dev, "pushed event %i, %i in queue\n", 1945 + (int)event_type, num_gpib_events(queue)); 1954 1946 1955 1947 return 0; 1956 1948 } ··· 1974 1966 } 1975 1967 EXPORT_SYMBOL(push_gpib_event); 1976 1968 1977 - static int pop_gpib_event_nolock(gpib_event_queue_t *queue, short *event_type) 1969 + static int pop_gpib_event_nolock(gpib_board_t *board, gpib_event_queue_t *queue, short *event_type) 1978 1970 { 1979 1971 struct list_head *head = &queue->event_head; 1980 1972 struct list_head *front = head->next; ··· 2001 1993 2002 1994 queue->num_events--; 2003 1995 2004 - GPIB_DPRINTK("popped event %i, %i in queue\n", 2005 - (int)*event_type, num_gpib_events(queue)); 1996 + dev_dbg(board->gpib_dev, "popped event %i, %i in queue\n", 1997 + (int)*event_type, num_gpib_events(queue)); 2006 1998 2007 1999 return 0; 2008 2000 } 2009 2001 2010 2002 // pop event from front of event queue 2011 - int pop_gpib_event(gpib_event_queue_t *queue, short *event_type) 2003 + int pop_gpib_event(gpib_board_t *board, gpib_event_queue_t *queue, short *event_type) 2012 2004 { 2013 2005 unsigned long flags; 2014 2006 int retval; 2015 2007 2016 2008 spin_lock_irqsave(&queue->lock, flags); 2017 - retval = pop_gpib_event_nolock(queue, event_type); 2009 + retval = pop_gpib_event_nolock(board, queue, event_type); 2018 2010 spin_unlock_irqrestore(&queue->lock, flags); 2019 2011 return retval; 2020 2012 } ··· 2025 2017 int retval; 2026 2018 short event; 2027 2019 2028 - retval = pop_gpib_event(&board->event_queue, &event); 2020 + retval = pop_gpib_event(board, &board->event_queue, &event); 2029 2021 if (retval < 0) 2030 2022 return retval; 2031 2023 ··· 2207 2199 board->buffer_length = 0; 2208 2200 } 2209 2201 while (num_gpib_events(&board->event_queue)) 2210 - pop_gpib_event(&board->event_queue, &dummy); 2202 + pop_gpib_event(board, &board->event_queue, &dummy); 2211 2203 } 2212 2204 2213 2205 static void init_board_array(gpib_board_t *board_array, unsigned int length)
+8 -8
drivers/staging/gpib/common/iblib.c
··· 178 178 gpib_board_t *board = board_void; 179 179 int retval = 0; 180 180 181 - GPIB_DPRINTK("entering autospoll thread\n"); 181 + dev_dbg(board->gpib_dev, "entering autospoll thread\n"); 182 182 183 183 while (1) { 184 184 wait_event_interruptible(board->wait, 185 185 kthread_should_stop() || 186 186 autospoll_wait_should_wake_up(board)); 187 - GPIB_DPRINTK("autospoll wait satisfied\n"); 187 + dev_dbg(board->gpib_dev, "autospoll wait satisfied\n"); 188 188 if (kthread_should_stop()) 189 189 break; 190 190 ··· 247 247 } 248 248 #endif 249 249 board->online = 1; 250 - GPIB_DPRINTK("gpib: board online\n"); 250 + dev_dbg(board->gpib_dev, "gpib: board online\n"); 251 251 252 252 return 0; 253 253 } ··· 272 272 board->interface->detach(board); 273 273 gpib_deallocate_board(board); 274 274 board->online = 0; 275 - GPIB_DPRINTK("gpib: board offline\n"); 275 + dev_dbg(board->gpib_dev, "gpib: board offline\n"); 276 276 277 277 return 0; 278 278 } ··· 436 436 pr_warn("gpib: warning, shortening long udelay\n"); 437 437 } 438 438 439 - GPIB_DPRINTK("sending interface clear\n"); 439 + dev_dbg(board->gpib_dev, "sending interface clear\n"); 440 440 board->interface->interface_clear(board, 1); 441 441 udelay(usec_duration); 442 442 board->interface->interface_clear(board, 0); ··· 486 486 board->pad = addr; 487 487 if (board->online) 488 488 board->interface->primary_address(board, board->pad); 489 - GPIB_DPRINTK("set primary addr to %i\n", board->pad); 489 + dev_dbg(board->gpib_dev, "set primary addr to %i\n", board->pad); 490 490 return 0; 491 491 } 492 492 ··· 509 509 else 510 510 board->interface->secondary_address(board, 0, 0); 511 511 } 512 - GPIB_DPRINTK("set secondary addr to %i\n", board->sad); 512 + dev_dbg(board->gpib_dev, "set secondary addr to %i\n", board->sad); 513 513 514 514 return 0; 515 515 } ··· 683 683 684 684 if (wait_event_interruptible(board->wait, wait_satisfied(&winfo, status_queue, 685 685 wait_mask, status, desc))) { 686 - GPIB_DPRINTK("wait interrupted\n"); 686 + dev_dbg(board->gpib_dev, "wait interrupted\n"); 687 687 retval = -ERESTARTSYS; 688 688 } 689 689 remove_wait_timer(&winfo);
+2 -2
drivers/staging/gpib/common/ibsys.h
··· 20 20 void gpib_deallocate_board(gpib_board_t *board); 21 21 22 22 unsigned int num_status_bytes(const gpib_status_queue_t *dev); 23 - int push_status_byte(gpib_status_queue_t *device, uint8_t poll_byte); 24 - int pop_status_byte(gpib_status_queue_t *device, uint8_t *poll_byte); 23 + int push_status_byte(gpib_board_t *board, gpib_status_queue_t *device, uint8_t poll_byte); 24 + int pop_status_byte(gpib_board_t *board, gpib_status_queue_t *device, uint8_t *poll_byte); 25 25 gpib_status_queue_t *get_gpib_status_queue(gpib_board_t *board, unsigned int pad, int sad); 26 26 int get_serial_poll_byte(gpib_board_t *board, unsigned int pad, int sad, 27 27 unsigned int usec_timeout, uint8_t *poll_byte);
+1 -1
drivers/staging/gpib/eastwood/fluke_gpib.c
··· 430 430 test_bit(BUS_ERROR_BN, &nec_priv->state) || 431 431 test_bit(DEV_CLEAR_BN, &nec_priv->state) || 432 432 test_bit(TIMO_NUM, &board->status))) { 433 - GPIB_DPRINTK("gpib write interrupted!\n"); 433 + dev_dbg(board->gpib_dev, "gpib write interrupted!\n"); 434 434 retval = -ERESTARTSYS; 435 435 } 436 436 if (test_bit(TIMO_NUM, &board->status))
+2 -2
drivers/staging/gpib/fmh_gpib/fmh_gpib.c
··· 440 440 test_bit(BUS_ERROR_BN, &nec_priv->state) || 441 441 test_bit(DEV_CLEAR_BN, &nec_priv->state) || 442 442 test_bit(TIMO_NUM, &board->status))) { 443 - GPIB_DPRINTK("gpib write interrupted!\n"); 443 + dev_dbg(board->gpib_dev, "gpib write interrupted!\n"); 444 444 retval = -ERESTARTSYS; 445 445 } 446 446 if (test_bit(TIMO_NUM, &board->status)) ··· 634 634 test_bit(BUS_ERROR_BN, &nec_priv->state) || 635 635 test_bit(DEV_CLEAR_BN, &nec_priv->state) || 636 636 test_bit(TIMO_NUM, &board->status))) { 637 - GPIB_DPRINTK("gpib write interrupted!\n"); 637 + dev_dbg(board->gpib_dev, "gpib write interrupted!\n"); 638 638 retval = -ERESTARTSYS; 639 639 } 640 640 if (test_bit(TIMO_NUM, &board->status))
+1 -7
drivers/staging/gpib/include/gpibP.h
··· 26 26 unsigned int ss_device, struct pci_dev *from); 27 27 unsigned int num_gpib_events(const gpib_event_queue_t *queue); 28 28 int push_gpib_event(gpib_board_t *board, short event_type); 29 - int pop_gpib_event(gpib_event_queue_t *queue, short *event_type); 29 + int pop_gpib_event(gpib_board_t *board, gpib_event_queue_t *queue, short *event_type); 30 30 int gpib_request_pseudo_irq(gpib_board_t *board, irqreturn_t (*handler)(int, void *)); 31 31 void gpib_free_pseudo_irq(gpib_board_t *board); 32 32 int gpib_match_device_path(struct device *dev, const char *device_path_in); ··· 34 34 extern gpib_board_t board_array[GPIB_MAX_NUM_BOARDS]; 35 35 36 36 extern struct list_head registered_drivers; 37 - 38 - #ifdef GPIB_DEBUG 39 - #define GPIB_DPRINTK(format, args...) pr_info("gpib debug: " format, ## args) 40 - #else 41 - #define GPIB_DPRINTK(arg...) 42 - #endif 43 37 44 38 #include <linux/io.h> 45 39
+1 -1
drivers/staging/gpib/ines/ines_gpib.c
··· 202 202 test_bit(BUS_ERROR_BN, &nec_priv->state) || 203 203 test_bit(DEV_CLEAR_BN, &nec_priv->state) || 204 204 test_bit(TIMO_NUM, &board->status))) { 205 - GPIB_DPRINTK("gpib write interrupted\n"); 205 + dev_dbg(board->gpib_dev, "gpib write interrupted\n"); 206 206 return -ERESTARTSYS; 207 207 } 208 208 if (test_bit(BUS_ERROR_BN, &nec_priv->state))
+34 -35
drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c
··· 68 68 * At module loading: modprobe lpvo_usb_gpib debug={0,1,2} 69 69 * On the fly: echo {0,1,2} > /sys/modules/lpvo_usb_gpib/parameters/debug 70 70 */ 71 - #ifdef GPIB_DEBUG 72 - static int debug = 1; 73 - #else 71 + 74 72 static int debug; 75 - #endif 76 73 module_param(debug, int, 0644); 77 74 78 75 #define DIA_LOG(level, format, ...) \ ··· 363 366 DIA_LOG(2, "--> %x\n", b->inbuf[b->last - b->nchar]); 364 367 return b->inbuf[b->last - b->nchar--]; 365 368 } else if (b->nchar == 0) { 366 - pr_alert("%s:%s - read returned EOF\n", NAME, __func__); 369 + dev_alert(board->gpib_dev, "%s:%s - read returned EOF\n", NAME, __func__); 367 370 return -EIO; 368 371 } 369 - pr_alert("%s:%s - read error %d\n", NAME, __func__, b->nchar); 372 + dev_alert(board->gpib_dev, "%s:%s - read error %d\n", NAME, __func__, b->nchar); 370 373 TTY_LOG("\n *** %s *** Read Error - %s\n", NAME, 371 374 "Reset the adapter with 'gpib_config'\n"); 372 375 return -EIO; ··· 409 412 } 410 413 411 414 if (val != ACK) { 412 - pr_alert("%s:%s - error in timeout set: <%s>\n", 413 - NAME, __func__, command); 415 + dev_alert(board->gpib_dev, "%s:%s - error in timeout set: <%s>\n", 416 + NAME, __func__, command); 414 417 } else { 415 418 data->timeout = board->usec_timeout; 416 419 } ··· 453 456 454 457 if (config->device_path) { 455 458 /* if config->device_path given, try that first */ 456 - pr_alert("%s:%s - Looking for device_path: %s\n", 457 - NAME, __func__, config->device_path); 459 + dev_alert(board->gpib_dev, "%s:%s - Looking for device_path: %s\n", 460 + NAME, __func__, config->device_path); 458 461 for (j = 0 ; j < MAX_DEV ; j++) { 459 462 if ((assigned_usb_minors & 1 << j) == 0) 460 463 continue; ··· 489 492 mutex_unlock(&minors_lock); 490 493 491 494 if (j == MAX_DEV) { 492 - pr_alert("%s:%s - Requested device is not registered.\n", NAME, __func__); 495 + dev_alert(board->gpib_dev, "%s:%s - Requested device is not registered.\n", 496 + NAME, __func__); 493 497 return -EIO; 494 498 } 495 499 ··· 735 737 buffer = send_command((gpib_board_t *)board, USB_GPIB_STATUS, 0); 736 738 737 739 if (buffer < 0) { 738 - pr_alert("%s:%s - line status read failed with %d\n", NAME, __func__, buffer); 740 + dev_alert(board->gpib_dev, "%s:%s - line status read failed with %d\n", 741 + NAME, __func__, buffer); 739 742 return -1; 740 743 } 741 744 ··· 776 777 777 778 retval = set_control_line(board, IB_BUS_EOI, 1); 778 779 if (retval != ACK) { 779 - pr_alert("%s:%s - assert EOI failed\n", NAME, __func__); 780 + dev_alert(board->gpib_dev, "%s:%s - assert EOI failed\n", NAME, __func__); 780 781 return -EIO; 781 782 } 782 783 ··· 786 787 787 788 retval = set_control_line(board, IB_BUS_EOI, 0); 788 789 if (retval != 0x06) { 789 - pr_alert("%s:%s - unassert EOI failed\n", NAME, __func__); 790 + dev_alert(board->gpib_dev, "%s:%s - unassert EOI failed\n", NAME, __func__); 790 791 return -EIO; 791 792 } 792 793 ··· 868 869 goto read_return; 869 870 870 871 if (one_char(board, &b) != DLE || one_char(board, &b) != STX) { 871 - pr_alert("%s:%s - wrong <DLE><STX> sequence\n", 872 - NAME, __func__); 872 + dev_alert(board->gpib_dev, "%s:%s - wrong <DLE><STX> sequence\n", 873 + NAME, __func__); 873 874 retval = -EIO; 874 875 goto read_return; 875 876 } ··· 909 910 retval = 0; 910 911 goto read_return; 911 912 } else { 912 - pr_alert("%s:%s - %s %x\n", 913 - NAME, __func__, 914 - "Wrong end of message", c); 913 + dev_alert(board->gpib_dev, "%s:%s - %s %x\n", 914 + NAME, __func__, 915 + "Wrong end of message", c); 915 916 retval = -ETIME; 916 917 goto read_return; 917 918 } 918 919 } else { 919 - pr_alert("%s:%s - %s\n", NAME, __func__, 920 - "lone <DLE> in stream"); 920 + dev_alert(board->gpib_dev, "%s:%s - %s\n", NAME, __func__, 921 + "lone <DLE> in stream"); 921 922 retval = -EIO; 922 923 goto read_return; 923 924 } ··· 936 937 c = one_char(board, &b); 937 938 if (c == ACK) { 938 939 if (MAX_READ_EXCESS - read_count > 1) 939 - pr_alert("%s:%s - %s\n", NAME, __func__, 940 - "small buffer - maybe some data lost"); 940 + dev_alert(board->gpib_dev, "%s:%s - %s\n", NAME, __func__, 941 + "small buffer - maybe some data lost"); 941 942 retval = 0; 942 943 goto read_return; 943 944 } ··· 945 946 } 946 947 } 947 948 948 - pr_alert("%s:%s - no input end - GPIB board in odd state\n", 949 - NAME, __func__); 949 + dev_alert(board->gpib_dev, "%s:%s - no input end - GPIB board in odd state\n", 950 + NAME, __func__); 950 951 retval = -EIO; 951 952 952 953 read_return: ··· 972 973 973 974 retval = set_control_line(board, IB_BUS_REN, enable ? 1 : 0); 974 975 if (retval != ACK) 975 - pr_alert("%s:%s - could not set REN line: %x\n", 976 - NAME, __func__, retval); 976 + dev_alert(board->gpib_dev, "%s:%s - could not set REN line: %x\n", 977 + NAME, __func__, retval); 977 978 978 979 DIA_LOG(1, "done with %x\n", retval); 979 980 } ··· 1071 1072 static void usb_gpib_parallel_poll_configure(gpib_board_t *board, 1072 1073 uint8_t configuration) 1073 1074 { 1074 - pr_alert("%s:%s - currently a NOP\n", NAME, __func__); 1075 + dev_alert(board->gpib_dev, "%s:%s - currently a NOP\n", NAME, __func__); 1075 1076 } 1076 1077 1077 1078 /* parallel_poll_response */ 1078 1079 1079 1080 static void usb_gpib_parallel_poll_response(gpib_board_t *board, int ist) 1080 1081 { 1081 - pr_alert("%s:%s - currently a NOP\n", NAME, __func__); 1082 + dev_alert(board->gpib_dev, "%s:%s - currently a NOP\n", NAME, __func__); 1082 1083 } 1083 1084 1084 1085 /* primary_address */ 1085 1086 1086 1087 static int usb_gpib_primary_address(gpib_board_t *board, unsigned int address) 1087 1088 { 1088 - pr_alert("%s:%s - currently a NOP\n", NAME, __func__); 1089 + dev_alert(board->gpib_dev, "%s:%s - currently a NOP\n", NAME, __func__); 1089 1090 return 0; 1090 1091 } 1091 1092 ··· 1093 1094 1094 1095 static void usb_gpib_return_to_local(gpib_board_t *board) 1095 1096 { 1096 - pr_alert("%s:%s - currently a NOP\n", NAME, __func__); 1097 + dev_alert(board->gpib_dev, "%s:%s - currently a NOP\n", NAME, __func__); 1097 1098 } 1098 1099 1099 1100 /* secondary_address */ ··· 1102 1103 unsigned int address, 1103 1104 int enable) 1104 1105 { 1105 - pr_alert("%s:%s - currently a NOP\n", NAME, __func__); 1106 + dev_alert(board->gpib_dev, "%s:%s - currently a NOP\n", NAME, __func__); 1106 1107 return 0; 1107 1108 } 1108 1109 ··· 1110 1111 1111 1112 static void usb_gpib_serial_poll_response(gpib_board_t *board, uint8_t status) 1112 1113 { 1113 - pr_alert("%s:%s - currently a NOP\n", NAME, __func__); 1114 + dev_alert(board->gpib_dev, "%s:%s - currently a NOP\n", NAME, __func__); 1114 1115 } 1115 1116 1116 1117 /* serial_poll_status */ 1117 1118 1118 1119 static uint8_t usb_gpib_serial_poll_status(gpib_board_t *board) 1119 1120 { 1120 - pr_alert("%s:%s - currently a NOP\n", NAME, __func__); 1121 + dev_alert(board->gpib_dev, "%s:%s - currently a NOP\n", NAME, __func__); 1121 1122 return 0; 1122 1123 } 1123 1124 ··· 1125 1126 1126 1127 static unsigned int usb_gpib_t1_delay(gpib_board_t *board, unsigned int nano_sec) 1127 1128 { 1128 - pr_alert("%s:%s - currently a NOP\n", NAME, __func__); 1129 + dev_alert(board->gpib_dev, "%s:%s - currently a NOP\n", NAME, __func__); 1129 1130 return 0; 1130 1131 } 1131 1132
+17 -17
drivers/staging/gpib/nec7210/nec7210.c
··· 53 53 // wait for result FIXME: support timeouts 54 54 ret = wait_event_interruptible(board->wait, test_bit(COMMAND_READY_BN, &priv->state)); 55 55 if (ret) { 56 - GPIB_DPRINTK("gpib: parallel poll interrupted\n"); 56 + dev_dbg(board->gpib_dev, "gpib: parallel poll interrupted\n"); 57 57 return -ERESTARTSYS; 58 58 } 59 59 *result = read_byte(priv, CPTR); ··· 198 198 priv->srq_pending = 0; 199 199 set_bit(SPOLL_NUM, &board->status); 200 200 } 201 - // GPIB_DPRINTK("status 0x%x, state 0x%x\n", board->status, priv->state); 201 + // dev_dbg(board->gpib_dev, "status 0x%x, state 0x%x\n", board->status, priv->state); 202 202 203 203 /* we rely on the interrupt handler to set the 204 204 * rest of the status bits ··· 430 430 test_bit(COMMAND_READY_BN, &priv->state) || 431 431 test_bit(BUS_ERROR_BN, &priv->state) || 432 432 test_bit(TIMO_NUM, &board->status))) { 433 - GPIB_DPRINTK("gpib command wait interrupted\n"); 433 + dev_dbg(board->gpib_dev, "gpib command wait interrupted\n"); 434 434 retval = -ERESTARTSYS; 435 435 break; 436 436 } ··· 455 455 if (wait_event_interruptible(board->wait, test_bit(COMMAND_READY_BN, &priv->state) || 456 456 test_bit(BUS_ERROR_BN, &priv->state) || 457 457 test_bit(TIMO_NUM, &board->status))) { 458 - GPIB_DPRINTK("gpib command wait interrupted\n"); 458 + dev_dbg(board->gpib_dev, "gpib command wait interrupted\n"); 459 459 retval = -ERESTARTSYS; 460 460 } 461 461 if (test_bit(TIMO_NUM, &board->status)) { 462 - GPIB_DPRINTK("gpib command timed out\n"); 462 + dev_dbg(board->gpib_dev, "gpib command timed out\n"); 463 463 retval = -ETIMEDOUT; 464 464 } 465 465 if (test_and_clear_bit(BUS_ERROR_BN, &priv->state)) { ··· 484 484 test_bit(READ_READY_BN, &priv->state) || 485 485 test_bit(DEV_CLEAR_BN, &priv->state) || 486 486 test_bit(TIMO_NUM, &board->status))) { 487 - GPIB_DPRINTK("nec7210: pio read wait interrupted\n"); 487 + dev_dbg(board->gpib_dev, "nec7210: pio read wait interrupted\n"); 488 488 retval = -ERESTARTSYS; 489 489 break; 490 490 } ··· 503 503 break; 504 504 } 505 505 if (test_bit(TIMO_NUM, &board->status)) { 506 - GPIB_DPRINTK("interrupted by timeout\n"); 506 + dev_dbg(board->gpib_dev, "interrupted by timeout\n"); 507 507 retval = -ETIMEDOUT; 508 508 break; 509 509 } 510 510 if (test_bit(DEV_CLEAR_BN, &priv->state)) { 511 - GPIB_DPRINTK("interrupted by device clear\n"); 511 + dev_dbg(board->gpib_dev, "interrupted by device clear\n"); 512 512 retval = -EINTR; 513 513 break; 514 514 } ··· 558 558 test_bit(DMA_READ_IN_PROGRESS_BN, &priv->state) == 0 || 559 559 test_bit(DEV_CLEAR_BN, &priv->state) || 560 560 test_bit(TIMO_NUM, &board->status))) { 561 - GPIB_DPRINTK("nec7210: dma read wait interrupted\n"); 561 + dev_dbg(board->gpib_dev, "nec7210: dma read wait interrupted\n"); 562 562 retval = -ERESTARTSYS; 563 563 } 564 564 if (test_bit(TIMO_NUM, &board->status)) ··· 639 639 (wake_on_lacs && test_bit(LACS_NUM, &board->status)) || 640 640 (wake_on_atn && test_bit(ATN_NUM, &board->status)) || 641 641 test_bit(TIMO_NUM, &board->status))) { 642 - GPIB_DPRINTK("gpib write interrupted\n"); 642 + dev_dbg(board->gpib_dev, "gpib write interrupted\n"); 643 643 return -ERESTARTSYS; 644 644 } 645 645 if (test_bit(TIMO_NUM, &board->status)) { 646 - GPIB_DPRINTK("nec7210: write timed out\n"); 646 + dev_dbg(board->gpib_dev, "nec7210: write timed out\n"); 647 647 return -ETIMEDOUT; 648 648 } 649 649 if (test_bit(DEV_CLEAR_BN, &priv->state)) { 650 - GPIB_DPRINTK("nec7210: write interrupted by clear\n"); 650 + dev_dbg(board->gpib_dev, "nec7210: write interrupted by clear\n"); 651 651 return -EINTR; 652 652 } 653 653 if (wake_on_bus_error && test_and_clear_bit(BUS_ERROR_BN, &priv->state)) { 654 - GPIB_DPRINTK("nec7210: bus error on write\n"); 654 + dev_dbg(board->gpib_dev, "nec7210: bus error on write\n"); 655 655 return -EIO; 656 656 } 657 657 return 0; ··· 677 677 if (retval == -EIO) { 678 678 /* resend last byte on bus error */ 679 679 *bytes_written = last_count; 680 - GPIB_DPRINTK("resending %c\n", buffer[*bytes_written]); 680 + dev_dbg(board->gpib_dev, "resending %c\n", buffer[*bytes_written]); 681 681 /* we can get unrecoverable bus errors, 682 682 * so give up after a while 683 683 */ ··· 734 734 test_bit(BUS_ERROR_BN, &priv->state) || 735 735 test_bit(DEV_CLEAR_BN, &priv->state) || 736 736 test_bit(TIMO_NUM, &board->status))) { 737 - GPIB_DPRINTK("gpib write interrupted!\n"); 737 + dev_dbg(board->gpib_dev, "gpib write interrupted!\n"); 738 738 retval = -ERESTARTSYS; 739 739 } 740 740 if (test_bit(TIMO_NUM, &board->status)) ··· 969 969 (status2 & (priv->reg_bits[IMR2] & IMR2_ENABLE_INTR_MASK)) || 970 970 nec7210_atn_has_changed(board, priv)) { 971 971 nec7210_update_status_nolock(board, priv); 972 - GPIB_DPRINTK("minor %i, stat %lx, isr1 0x%x, imr1 0x%x, isr2 0x%x, imr2 0x%x\n", 973 - board->minor, board->status, status1, priv->reg_bits[IMR1], status2, 972 + dev_dbg(board->gpib_dev, "minor %i, stat %lx, isr1 0x%x, imr1 0x%x, isr2 0x%x, imr2 0x%x\n", 973 + board->minor, board->status, status1, priv->reg_bits[IMR1], status2, 974 974 priv->reg_bits[IMR2]); 975 975 wake_up_interruptible(&board->wait); /* wake up sleeping process */ 976 976 retval = IRQ_HANDLED;
+4 -4
drivers/staging/gpib/tms9914/tms9914.c
··· 382 382 clear_bit(SRQI_NUM, &board->status); 383 383 } 384 384 385 - GPIB_DPRINTK("status 0x%lx, state 0x%lx\n", board->status, priv->state); 385 + dev_dbg(board->gpib_dev, "status 0x%lx, state 0x%lx\n", board->status, priv->state); 386 386 387 387 return board->status; 388 388 } ··· 549 549 test_bit(BUS_ERROR_BN, &priv->state) || 550 550 test_bit(DEV_CLEAR_BN, &priv->state) || 551 551 test_bit(TIMO_NUM, &board->status))) { 552 - GPIB_DPRINTK("gpib write interrupted!\n"); 552 + dev_dbg(board->gpib_dev, "gpib write interrupted!\n"); 553 553 return -ERESTARTSYS; 554 554 } 555 555 if (test_bit(TIMO_NUM, &board->status)) ··· 774 774 } 775 775 776 776 if (status1 & HR_ERR) { 777 - GPIB_DPRINTK("gpib bus error\n"); 777 + dev_dbg(board->gpib_dev, "gpib bus error\n"); 778 778 set_bit(BUS_ERROR_BN, &priv->state); 779 779 } 780 780 ··· 807 807 } 808 808 809 809 if ((status0 & priv->imr0_bits) || (status1 & priv->imr1_bits)) { 810 - // GPIB_DPRINTK("isr0 0x%x, imr0 0x%x, isr1 0x%x, imr1 0x%x\n", 810 + // dev_dbg(board->gpib_dev, "isr0 0x%x, imr0 0x%x, isr1 0x%x, imr1 0x%x\n", 811 811 // status0, priv->imr0_bits, status1, priv->imr1_bits); 812 812 update_status_nolock(board, priv); 813 813 wake_up_interruptible(&board->wait);
+3 -4
drivers/staging/gpib/tnt4882/tnt4882_gpib.c
··· 491 491 test_bit(BUS_ERROR_BN, &nec_priv->state) || 492 492 test_bit(DEV_CLEAR_BN, &nec_priv->state) || 493 493 test_bit(TIMO_NUM, &board->status))) { 494 - GPIB_DPRINTK("gpib write interrupted\n"); 494 + dev_dbg(board->gpib_dev, "gpib write interrupted\n"); 495 495 return -ERESTARTSYS; 496 496 } 497 497 if (test_bit(TIMO_NUM, &board->status)) { ··· 637 637 if (isr3_bits & HR_DONE) 638 638 priv->imr3_bits &= ~HR_DONE; 639 639 if (isr3_bits & (HR_INTR | HR_TLCI)) { 640 - GPIB_DPRINTK("tnt4882: minor %i isr0 0x%x imr0 0x%x isr3 0x%x imr3 0x%x\n", 641 - board->minor, 642 - isr0_bits, priv->imr0_bits, isr3_bits, imr3_bits); 640 + dev_dbg(board->gpib_dev, "tnt4882: minor %i isr0 0x%x imr0 0x%x isr3 0x%x imr3 0x%x\n", 641 + board->minor, isr0_bits, priv->imr0_bits, isr3_bits, imr3_bits); 643 642 tnt_writeb(priv, priv->imr3_bits, IMR3); 644 643 wake_up_interruptible(&board->wait); 645 644 }