[Linux1394-cvslog] rev 789 - trunk
Brought to you by:
aeb,
bencollins
From: SVN U. <ben...@li...> - 2003-02-16 04:33:32
|
Author: bencollins Date: 2003-02-15 23:32:57 -0500 (Sat, 15 Feb 2003) New Revision: 789 Modified: trunk/amdtp.c trunk/dv1394.c trunk/video1394.c Log: Check return value of ioctl32 reg/unreg calls. Modified: trunk/amdtp.c ============================================================================== --- trunk/amdtp.c (original) +++ trunk/amdtp.c 2003-02-15 23:32:58.000000000 -0500 @@ -1264,8 +1264,11 @@ static int __init amdtp_init_module (void) { - if (ieee1394_register_chardev(IEEE1394_MINOR_BLOCK_AMDTP, - THIS_MODULE, &amdtp_fops)) { + int ret; + + ret = ieee1394_register_chardev(IEEE1394_MINOR_BLOCK_AMDTP, + THIS_MODULE, &amdtp_fops); + if (ret) { HPSB_ERR("amdtp: unable to get minor device block"); return -EIO; } @@ -1279,10 +1282,12 @@ } #ifdef CONFIG_COMPAT - register_ioctl32_conversion(AMDTP_IOC_CHANNEL, NULL); - register_ioctl32_conversion(AMDTP_IOC_PLUG, NULL); - register_ioctl32_conversion(AMDTP_IOC_PING, NULL); - register_ioctl32_conversion(AMDTP_IOC_ZAP, NULL); + ret = register_ioctl32_conversion(AMDTP_IOC_CHANNEL, NULL); + ret |= register_ioctl32_conversion(AMDTP_IOC_PLUG, NULL); + ret |= register_ioctl32_conversion(AMDTP_IOC_PING, NULL); + ret |= register_ioctl32_conversion(AMDTP_IOC_ZAP, NULL); + if (ret) + HPSB_ERR("amdtp: Error registering ioctl32 translations"); #endif HPSB_INFO("Loaded AMDTP driver"); @@ -1293,10 +1298,14 @@ static void __exit amdtp_exit_module (void) { #ifdef CONFIG_COMPAT - unregister_ioctl32_conversion(AMDTP_IOC_CHANNEL); - unregister_ioctl32_conversion(AMDTP_IOC_PLUG); - unregister_ioctl32_conversion(AMDTP_IOC_PING); - unregister_ioctl32_conversion(AMDTP_IOC_ZAP); + int ret; + + ret = unregister_ioctl32_conversion(AMDTP_IOC_CHANNEL); + ret |= unregister_ioctl32_conversion(AMDTP_IOC_PLUG); + ret |= unregister_ioctl32_conversion(AMDTP_IOC_PING); + ret |= unregister_ioctl32_conversion(AMDTP_IOC_ZAP); + if (ret) + HPSB_ERR("amdtp: Error unregistering ioctl32 translations"); #endif hpsb_unregister_highlevel(amdtp_highlevel); Modified: trunk/video1394.c ============================================================================== --- trunk/video1394.c (original) +++ trunk/video1394.c 2003-02-15 23:32:58.000000000 -0500 @@ -1452,15 +1452,19 @@ static void __exit video1394_exit_module (void) { #ifdef CONFIG_COMPAT - unregister_ioctl32_conversion(VIDEO1394_IOC_LISTEN_CHANNEL); - unregister_ioctl32_conversion(VIDEO1394_IOC_UNLISTEN_CHANNEL); - unregister_ioctl32_conversion(VIDEO1394_IOC_TALK_CHANNEL); - unregister_ioctl32_conversion(VIDEO1394_IOC_UNTALK_CHANNEL); - unregister_ioctl32_conversion(VIDEO1394_IOC32_LISTEN_QUEUE_BUFFER); - unregister_ioctl32_conversion(VIDEO1394_IOC32_LISTEN_WAIT_BUFFER); - unregister_ioctl32_conversion(VIDEO1394_IOC_TALK_QUEUE_BUFFER); - unregister_ioctl32_conversion(VIDEO1394_IOC32_TALK_WAIT_BUFFER); - unregister_ioctl32_conversion(VIDEO1394_IOC32_LISTEN_POLL_BUFFER); + int ret; + + ret = unregister_ioctl32_conversion(VIDEO1394_IOC_LISTEN_CHANNEL); + ret |= unregister_ioctl32_conversion(VIDEO1394_IOC_UNLISTEN_CHANNEL); + ret |= unregister_ioctl32_conversion(VIDEO1394_IOC_TALK_CHANNEL); + ret |= unregister_ioctl32_conversion(VIDEO1394_IOC_UNTALK_CHANNEL); + ret |= unregister_ioctl32_conversion(VIDEO1394_IOC32_LISTEN_QUEUE_BUFFER); + ret |= unregister_ioctl32_conversion(VIDEO1394_IOC32_LISTEN_WAIT_BUFFER); + ret |= unregister_ioctl32_conversion(VIDEO1394_IOC_TALK_QUEUE_BUFFER); + ret |= unregister_ioctl32_conversion(VIDEO1394_IOC32_TALK_WAIT_BUFFER); + ret |= unregister_ioctl32_conversion(VIDEO1394_IOC32_LISTEN_POLL_BUFFER); + if (ret) + PRINT_G(KERN_INFO, "Error unregistering ioctl32 translations"); #endif hpsb_unregister_highlevel (hl_handle); @@ -1473,8 +1477,11 @@ static int __init video1394_init_module (void) { - if (ieee1394_register_chardev(IEEE1394_MINOR_BLOCK_VIDEO1394, - THIS_MODULE, &video1394_fops)) { + int ret; + + ret = ieee1394_register_chardev(IEEE1394_MINOR_BLOCK_VIDEO1394, + THIS_MODULE, &video1394_fops); + if (ret) { PRINT_G(KERN_ERR, "video1394: unable to get minor device block"); return -EIO; } @@ -1491,22 +1498,24 @@ #ifdef CONFIG_COMPAT /* First the compatible ones */ - register_ioctl32_conversion(VIDEO1394_IOC_LISTEN_CHANNEL, NULL); - register_ioctl32_conversion(VIDEO1394_IOC_UNLISTEN_CHANNEL, NULL); - register_ioctl32_conversion(VIDEO1394_IOC_TALK_CHANNEL, NULL); - register_ioctl32_conversion(VIDEO1394_IOC_UNTALK_CHANNEL, NULL); + ret = register_ioctl32_conversion(VIDEO1394_IOC_LISTEN_CHANNEL, NULL); + ret |= register_ioctl32_conversion(VIDEO1394_IOC_UNLISTEN_CHANNEL, NULL); + ret |= register_ioctl32_conversion(VIDEO1394_IOC_TALK_CHANNEL, NULL); + ret |= register_ioctl32_conversion(VIDEO1394_IOC_UNTALK_CHANNEL, NULL); /* These need translation */ - register_ioctl32_conversion(VIDEO1394_IOC32_LISTEN_QUEUE_BUFFER, + ret |= register_ioctl32_conversion(VIDEO1394_IOC32_LISTEN_QUEUE_BUFFER, video1394_w_wait32); - register_ioctl32_conversion(VIDEO1394_IOC32_LISTEN_WAIT_BUFFER, + ret |= register_ioctl32_conversion(VIDEO1394_IOC32_LISTEN_WAIT_BUFFER, video1394_wr_wait32); - register_ioctl32_conversion(VIDEO1394_IOC_TALK_QUEUE_BUFFER, + ret |= register_ioctl32_conversion(VIDEO1394_IOC_TALK_QUEUE_BUFFER, video1394_queue_buf32); - register_ioctl32_conversion(VIDEO1394_IOC32_TALK_WAIT_BUFFER, + ret |= register_ioctl32_conversion(VIDEO1394_IOC32_TALK_WAIT_BUFFER, video1394_w_wait32); - register_ioctl32_conversion(VIDEO1394_IOC32_LISTEN_POLL_BUFFER, + ret |= register_ioctl32_conversion(VIDEO1394_IOC32_LISTEN_POLL_BUFFER, video1394_wr_wait32); + if (ret) + PRINT_G(KERN_INFO, "Error registering ioctl32 translations"); #endif PRINT_G(KERN_INFO, "Installed " VIDEO1394_DRIVER_NAME " module"); Modified: trunk/dv1394.c ============================================================================== --- trunk/dv1394.c (original) +++ trunk/dv1394.c 2003-02-15 23:32:58.000000000 -0500 @@ -3012,13 +3012,17 @@ static void __exit dv1394_exit_module(void) { #ifdef CONFIG_COMPAT - unregister_ioctl32_conversion(DV1394_IOC_SHUTDOWN); - unregister_ioctl32_conversion(DV1394_IOC_SUBMIT_FRAMES); - unregister_ioctl32_conversion(DV1394_IOC_WAIT_FRAMES); - unregister_ioctl32_conversion(DV1394_IOC_RECEIVE_FRAMES); - unregister_ioctl32_conversion(DV1394_IOC_START_RECEIVE); - unregister_ioctl32_conversion(DV1394_IOC32_INIT); - unregister_ioctl32_conversion(DV1394_IOC32_GET_STATUS); + int ret; + + ret = unregister_ioctl32_conversion(DV1394_IOC_SHUTDOWN); + ret |= unregister_ioctl32_conversion(DV1394_IOC_SUBMIT_FRAMES); + ret |= unregister_ioctl32_conversion(DV1394_IOC_WAIT_FRAMES); + ret |= unregister_ioctl32_conversion(DV1394_IOC_RECEIVE_FRAMES); + ret |= unregister_ioctl32_conversion(DV1394_IOC_START_RECEIVE); + ret |= unregister_ioctl32_conversion(DV1394_IOC32_INIT); + ret |= unregister_ioctl32_conversion(DV1394_IOC32_GET_STATUS); + if (ret) + printk(KERN_ERR "dv1394: Error unregistering ioctl32 translations\n"); #endif hpsb_unregister_highlevel (hl_handle); @@ -3033,14 +3037,18 @@ static int __init dv1394_init_module(void) { - if (ieee1394_register_chardev(IEEE1394_MINOR_BLOCK_DV1394, - THIS_MODULE, &dv1394_fops)) { + int ret; + + ret = ieee1394_register_chardev(IEEE1394_MINOR_BLOCK_DV1394, + THIS_MODULE, &dv1394_fops); + if (ret) { printk(KERN_ERR "dv1394: unable to register character device\n"); return -EIO; } #ifdef CONFIG_DEVFS_FS - if (dv1394_devfs_add_dir("dv", NULL, NULL) < 0) { + ret = dv1394_devfs_add_dir("dv", NULL, NULL); + if (ret < 0) { printk(KERN_ERR "dv1394: unable to create /dev/ieee1394/dv\n"); ieee1394_unregister_chardev(IEEE1394_MINOR_BLOCK_DV1394); return -ENOMEM; @@ -3048,7 +3056,8 @@ #endif #ifdef CONFIG_PROC_FS - if (dv1394_procfs_add_dir("dv",NULL,NULL) < 0) { + ret = dv1394_procfs_add_dir("dv",NULL,NULL); + if (ret < 0) { printk(KERN_ERR "dv1394: unable to create /proc/bus/ieee1394/dv\n"); ieee1394_unregister_chardev(IEEE1394_MINOR_BLOCK_DV1394); #ifdef CONFIG_DEVFS_FS @@ -3073,15 +3082,17 @@ #ifdef CONFIG_COMPAT /* First compatible ones */ - register_ioctl32_conversion(DV1394_IOC_SHUTDOWN, NULL); - register_ioctl32_conversion(DV1394_IOC_SUBMIT_FRAMES, NULL); - register_ioctl32_conversion(DV1394_IOC_WAIT_FRAMES, NULL); - register_ioctl32_conversion(DV1394_IOC_RECEIVE_FRAMES, NULL); - register_ioctl32_conversion(DV1394_IOC_START_RECEIVE, NULL); + ret = register_ioctl32_conversion(DV1394_IOC_SHUTDOWN, NULL); + ret |= register_ioctl32_conversion(DV1394_IOC_SUBMIT_FRAMES, NULL); + ret |= register_ioctl32_conversion(DV1394_IOC_WAIT_FRAMES, NULL); + ret |= register_ioctl32_conversion(DV1394_IOC_RECEIVE_FRAMES, NULL); + ret |= register_ioctl32_conversion(DV1394_IOC_START_RECEIVE, NULL); /* These need to be handled by translation */ - register_ioctl32_conversion(DV1394_IOC32_INIT, handle_dv1394_init); - register_ioctl32_conversion(DV1394_IOC32_GET_STATUS, handle_dv1394_get_status); + ret |= register_ioctl32_conversion(DV1394_IOC32_INIT, handle_dv1394_init); + ret |= register_ioctl32_conversion(DV1394_IOC32_GET_STATUS, handle_dv1394_get_status); + if (ret) + printk(KERN_ERR "dv1394: Error registering ioctl32 translations\n"); #endif return 0; |