diff options
Diffstat (limited to 'drivers/char')
| -rw-r--r-- | drivers/char/drm/drm_drv.c | 2 | ||||
| -rw-r--r-- | drivers/char/drm/drm_proc.c | 2 | ||||
| -rw-r--r-- | drivers/char/ipmi/ipmi_poweroff.c | 2 | ||||
| -rw-r--r-- | drivers/char/n_r3964.c | 84 | ||||
| -rw-r--r-- | drivers/char/watchdog/mv64x60_wdt.c | 14 |
5 files changed, 52 insertions, 52 deletions
diff --git a/drivers/char/drm/drm_drv.c b/drivers/char/drm/drm_drv.c index 6ba48f346fcf..041bb47b5c39 100644 --- a/drivers/char/drm/drm_drv.c +++ b/drivers/char/drm/drm_drv.c | |||
| @@ -376,7 +376,7 @@ static int __init drm_core_init(void) | |||
| 376 | goto err_p2; | 376 | goto err_p2; |
| 377 | } | 377 | } |
| 378 | 378 | ||
| 379 | drm_proc_root = create_proc_entry("dri", S_IFDIR, NULL); | 379 | drm_proc_root = proc_mkdir("dri", NULL); |
| 380 | if (!drm_proc_root) { | 380 | if (!drm_proc_root) { |
| 381 | DRM_ERROR("Cannot create /proc/dri\n"); | 381 | DRM_ERROR("Cannot create /proc/dri\n"); |
| 382 | ret = -1; | 382 | ret = -1; |
diff --git a/drivers/char/drm/drm_proc.c b/drivers/char/drm/drm_proc.c index 32d2bb99462c..977961002488 100644 --- a/drivers/char/drm/drm_proc.c +++ b/drivers/char/drm/drm_proc.c | |||
| @@ -95,7 +95,7 @@ int drm_proc_init(drm_device_t *dev, int minor, | |||
| 95 | char name[64]; | 95 | char name[64]; |
| 96 | 96 | ||
| 97 | sprintf(name, "%d", minor); | 97 | sprintf(name, "%d", minor); |
| 98 | *dev_root = create_proc_entry(name, S_IFDIR, root); | 98 | *dev_root = proc_mkdir(name, root); |
| 99 | if (!*dev_root) { | 99 | if (!*dev_root) { |
| 100 | DRM_ERROR("Cannot create /proc/dri/%s\n", name); | 100 | DRM_ERROR("Cannot create /proc/dri/%s\n", name); |
| 101 | return -1; | 101 | return -1; |
diff --git a/drivers/char/ipmi/ipmi_poweroff.c b/drivers/char/ipmi/ipmi_poweroff.c index e82a96ba396b..f66947722e12 100644 --- a/drivers/char/ipmi/ipmi_poweroff.c +++ b/drivers/char/ipmi/ipmi_poweroff.c | |||
| @@ -55,7 +55,7 @@ extern void (*pm_power_off)(void); | |||
| 55 | static int poweroff_powercycle; | 55 | static int poweroff_powercycle; |
| 56 | 56 | ||
| 57 | /* parameter definition to allow user to flag power cycle */ | 57 | /* parameter definition to allow user to flag power cycle */ |
| 58 | module_param(poweroff_powercycle, int, 0); | 58 | module_param(poweroff_powercycle, int, 0644); |
| 59 | MODULE_PARM_DESC(poweroff_powercycles, " Set to non-zero to enable power cycle instead of power down. Power cycle is contingent on hardware support, otherwise it defaults back to power down."); | 59 | MODULE_PARM_DESC(poweroff_powercycles, " Set to non-zero to enable power cycle instead of power down. Power cycle is contingent on hardware support, otherwise it defaults back to power down."); |
| 60 | 60 | ||
| 61 | /* Stuff from the get device id command. */ | 61 | /* Stuff from the get device id command. */ |
diff --git a/drivers/char/n_r3964.c b/drivers/char/n_r3964.c index 2291a87e8ada..97d6dc24b800 100644 --- a/drivers/char/n_r3964.c +++ b/drivers/char/n_r3964.c | |||
| @@ -229,8 +229,8 @@ static int __init r3964_init(void) | |||
| 229 | TRACE_L("line discipline %d registered", N_R3964); | 229 | TRACE_L("line discipline %d registered", N_R3964); |
| 230 | TRACE_L("flags=%x num=%x", tty_ldisc_N_R3964.flags, | 230 | TRACE_L("flags=%x num=%x", tty_ldisc_N_R3964.flags, |
| 231 | tty_ldisc_N_R3964.num); | 231 | tty_ldisc_N_R3964.num); |
| 232 | TRACE_L("open=%x", (int)tty_ldisc_N_R3964.open); | 232 | TRACE_L("open=%p", tty_ldisc_N_R3964.open); |
| 233 | TRACE_L("tty_ldisc_N_R3964 = %x", (int)&tty_ldisc_N_R3964); | 233 | TRACE_L("tty_ldisc_N_R3964 = %p", &tty_ldisc_N_R3964); |
| 234 | } | 234 | } |
| 235 | else | 235 | else |
| 236 | { | 236 | { |
| @@ -267,8 +267,8 @@ static void add_tx_queue(struct r3964_info *pInfo, struct r3964_block_header *pH | |||
| 267 | 267 | ||
| 268 | spin_unlock_irqrestore(&pInfo->lock, flags); | 268 | spin_unlock_irqrestore(&pInfo->lock, flags); |
| 269 | 269 | ||
| 270 | TRACE_Q("add_tx_queue %x, length %d, tx_first = %x", | 270 | TRACE_Q("add_tx_queue %p, length %d, tx_first = %p", |
| 271 | (int)pHeader, pHeader->length, (int)pInfo->tx_first ); | 271 | pHeader, pHeader->length, pInfo->tx_first ); |
| 272 | } | 272 | } |
| 273 | 273 | ||
| 274 | static void remove_from_tx_queue(struct r3964_info *pInfo, int error_code) | 274 | static void remove_from_tx_queue(struct r3964_info *pInfo, int error_code) |
| @@ -285,10 +285,10 @@ static void remove_from_tx_queue(struct r3964_info *pInfo, int error_code) | |||
| 285 | return; | 285 | return; |
| 286 | 286 | ||
| 287 | #ifdef DEBUG_QUEUE | 287 | #ifdef DEBUG_QUEUE |
| 288 | printk("r3964: remove_from_tx_queue: %x, length %d - ", | 288 | printk("r3964: remove_from_tx_queue: %p, length %u - ", |
| 289 | (int)pHeader, (int)pHeader->length ); | 289 | pHeader, pHeader->length ); |
| 290 | for(pDump=pHeader;pDump;pDump=pDump->next) | 290 | for(pDump=pHeader;pDump;pDump=pDump->next) |
| 291 | printk("%x ", (int)pDump); | 291 | printk("%p ", pDump); |
| 292 | printk("\n"); | 292 | printk("\n"); |
| 293 | #endif | 293 | #endif |
| 294 | 294 | ||
| @@ -319,10 +319,10 @@ static void remove_from_tx_queue(struct r3964_info *pInfo, int error_code) | |||
| 319 | spin_unlock_irqrestore(&pInfo->lock, flags); | 319 | spin_unlock_irqrestore(&pInfo->lock, flags); |
| 320 | 320 | ||
| 321 | kfree(pHeader); | 321 | kfree(pHeader); |
| 322 | TRACE_M("remove_from_tx_queue - kfree %x",(int)pHeader); | 322 | TRACE_M("remove_from_tx_queue - kfree %p",pHeader); |
| 323 | 323 | ||
| 324 | TRACE_Q("remove_from_tx_queue: tx_first = %x, tx_last = %x", | 324 | TRACE_Q("remove_from_tx_queue: tx_first = %p, tx_last = %p", |
| 325 | (int)pInfo->tx_first, (int)pInfo->tx_last ); | 325 | pInfo->tx_first, pInfo->tx_last ); |
| 326 | } | 326 | } |
| 327 | 327 | ||
| 328 | static void add_rx_queue(struct r3964_info *pInfo, struct r3964_block_header *pHeader) | 328 | static void add_rx_queue(struct r3964_info *pInfo, struct r3964_block_header *pHeader) |
| @@ -346,9 +346,9 @@ static void add_rx_queue(struct r3964_info *pInfo, struct r3964_block_header *pH | |||
| 346 | 346 | ||
| 347 | spin_unlock_irqrestore(&pInfo->lock, flags); | 347 | spin_unlock_irqrestore(&pInfo->lock, flags); |
| 348 | 348 | ||
| 349 | TRACE_Q("add_rx_queue: %x, length = %d, rx_first = %x, count = %d", | 349 | TRACE_Q("add_rx_queue: %p, length = %d, rx_first = %p, count = %d", |
| 350 | (int)pHeader, pHeader->length, | 350 | pHeader, pHeader->length, |
| 351 | (int)pInfo->rx_first, pInfo->blocks_in_rx_queue); | 351 | pInfo->rx_first, pInfo->blocks_in_rx_queue); |
| 352 | } | 352 | } |
| 353 | 353 | ||
| 354 | static void remove_from_rx_queue(struct r3964_info *pInfo, | 354 | static void remove_from_rx_queue(struct r3964_info *pInfo, |
| @@ -360,10 +360,10 @@ static void remove_from_rx_queue(struct r3964_info *pInfo, | |||
| 360 | if(pHeader==NULL) | 360 | if(pHeader==NULL) |
| 361 | return; | 361 | return; |
| 362 | 362 | ||
| 363 | TRACE_Q("remove_from_rx_queue: rx_first = %x, rx_last = %x, count = %d", | 363 | TRACE_Q("remove_from_rx_queue: rx_first = %p, rx_last = %p, count = %d", |
| 364 | (int)pInfo->rx_first, (int)pInfo->rx_last, pInfo->blocks_in_rx_queue ); | 364 | pInfo->rx_first, pInfo->rx_last, pInfo->blocks_in_rx_queue ); |
| 365 | TRACE_Q("remove_from_rx_queue: %x, length %d", | 365 | TRACE_Q("remove_from_rx_queue: %p, length %u", |
| 366 | (int)pHeader, (int)pHeader->length ); | 366 | pHeader, pHeader->length ); |
| 367 | 367 | ||
| 368 | spin_lock_irqsave(&pInfo->lock, flags); | 368 | spin_lock_irqsave(&pInfo->lock, flags); |
| 369 | 369 | ||
| @@ -401,10 +401,10 @@ static void remove_from_rx_queue(struct r3964_info *pInfo, | |||
| 401 | spin_unlock_irqrestore(&pInfo->lock, flags); | 401 | spin_unlock_irqrestore(&pInfo->lock, flags); |
| 402 | 402 | ||
| 403 | kfree(pHeader); | 403 | kfree(pHeader); |
| 404 | TRACE_M("remove_from_rx_queue - kfree %x",(int)pHeader); | 404 | TRACE_M("remove_from_rx_queue - kfree %p",pHeader); |
| 405 | 405 | ||
| 406 | TRACE_Q("remove_from_rx_queue: rx_first = %x, rx_last = %x, count = %d", | 406 | TRACE_Q("remove_from_rx_queue: rx_first = %p, rx_last = %p, count = %d", |
| 407 | (int)pInfo->rx_first, (int)pInfo->rx_last, pInfo->blocks_in_rx_queue ); | 407 | pInfo->rx_first, pInfo->rx_last, pInfo->blocks_in_rx_queue ); |
| 408 | } | 408 | } |
| 409 | 409 | ||
| 410 | static void put_char(struct r3964_info *pInfo, unsigned char ch) | 410 | static void put_char(struct r3964_info *pInfo, unsigned char ch) |
| @@ -506,8 +506,8 @@ static void transmit_block(struct r3964_info *pInfo) | |||
| 506 | if(tty->driver->write_room) | 506 | if(tty->driver->write_room) |
| 507 | room=tty->driver->write_room(tty); | 507 | room=tty->driver->write_room(tty); |
| 508 | 508 | ||
| 509 | TRACE_PS("transmit_block %x, room %d, length %d", | 509 | TRACE_PS("transmit_block %p, room %d, length %d", |
| 510 | (int)pBlock, room, pBlock->length); | 510 | pBlock, room, pBlock->length); |
| 511 | 511 | ||
| 512 | while(pInfo->tx_position < pBlock->length) | 512 | while(pInfo->tx_position < pBlock->length) |
| 513 | { | 513 | { |
| @@ -588,7 +588,7 @@ static void on_receive_block(struct r3964_info *pInfo) | |||
| 588 | 588 | ||
| 589 | /* prepare struct r3964_block_header: */ | 589 | /* prepare struct r3964_block_header: */ |
| 590 | pBlock = kmalloc(length+sizeof(struct r3964_block_header), GFP_KERNEL); | 590 | pBlock = kmalloc(length+sizeof(struct r3964_block_header), GFP_KERNEL); |
| 591 | TRACE_M("on_receive_block - kmalloc %x",(int)pBlock); | 591 | TRACE_M("on_receive_block - kmalloc %p",pBlock); |
| 592 | 592 | ||
| 593 | if(pBlock==NULL) | 593 | if(pBlock==NULL) |
| 594 | return; | 594 | return; |
| @@ -868,11 +868,11 @@ static int enable_signals(struct r3964_info *pInfo, pid_t pid, int arg) | |||
| 868 | if(pMsg) | 868 | if(pMsg) |
| 869 | { | 869 | { |
| 870 | kfree(pMsg); | 870 | kfree(pMsg); |
| 871 | TRACE_M("enable_signals - msg kfree %x",(int)pMsg); | 871 | TRACE_M("enable_signals - msg kfree %p",pMsg); |
| 872 | } | 872 | } |
| 873 | } | 873 | } |
| 874 | kfree(pClient); | 874 | kfree(pClient); |
| 875 | TRACE_M("enable_signals - kfree %x",(int)pClient); | 875 | TRACE_M("enable_signals - kfree %p",pClient); |
| 876 | return 0; | 876 | return 0; |
| 877 | } | 877 | } |
| 878 | } | 878 | } |
| @@ -890,7 +890,7 @@ static int enable_signals(struct r3964_info *pInfo, pid_t pid, int arg) | |||
| 890 | { | 890 | { |
| 891 | /* add client to client list */ | 891 | /* add client to client list */ |
| 892 | pClient=kmalloc(sizeof(struct r3964_client_info), GFP_KERNEL); | 892 | pClient=kmalloc(sizeof(struct r3964_client_info), GFP_KERNEL); |
| 893 | TRACE_M("enable_signals - kmalloc %x",(int)pClient); | 893 | TRACE_M("enable_signals - kmalloc %p",pClient); |
| 894 | if(pClient==NULL) | 894 | if(pClient==NULL) |
| 895 | return -ENOMEM; | 895 | return -ENOMEM; |
| 896 | 896 | ||
| @@ -954,7 +954,7 @@ static void add_msg(struct r3964_client_info *pClient, int msg_id, int arg, | |||
| 954 | queue_the_message: | 954 | queue_the_message: |
| 955 | 955 | ||
| 956 | pMsg = kmalloc(sizeof(struct r3964_message), GFP_KERNEL); | 956 | pMsg = kmalloc(sizeof(struct r3964_message), GFP_KERNEL); |
| 957 | TRACE_M("add_msg - kmalloc %x",(int)pMsg); | 957 | TRACE_M("add_msg - kmalloc %p",pMsg); |
| 958 | if(pMsg==NULL) { | 958 | if(pMsg==NULL) { |
| 959 | return; | 959 | return; |
| 960 | } | 960 | } |
| @@ -1067,11 +1067,11 @@ static int r3964_open(struct tty_struct *tty) | |||
| 1067 | struct r3964_info *pInfo; | 1067 | struct r3964_info *pInfo; |
| 1068 | 1068 | ||
| 1069 | TRACE_L("open"); | 1069 | TRACE_L("open"); |
| 1070 | TRACE_L("tty=%x, PID=%d, disc_data=%x", | 1070 | TRACE_L("tty=%p, PID=%d, disc_data=%p", |
| 1071 | (int)tty, current->pid, (int)tty->disc_data); | 1071 | tty, current->pid, tty->disc_data); |
| 1072 | 1072 | ||
| 1073 | pInfo=kmalloc(sizeof(struct r3964_info), GFP_KERNEL); | 1073 | pInfo=kmalloc(sizeof(struct r3964_info), GFP_KERNEL); |
| 1074 | TRACE_M("r3964_open - info kmalloc %x",(int)pInfo); | 1074 | TRACE_M("r3964_open - info kmalloc %p",pInfo); |
| 1075 | 1075 | ||
| 1076 | if(!pInfo) | 1076 | if(!pInfo) |
| 1077 | { | 1077 | { |
| @@ -1080,26 +1080,26 @@ static int r3964_open(struct tty_struct *tty) | |||
| 1080 | } | 1080 | } |
| 1081 | 1081 | ||
| 1082 | pInfo->rx_buf = kmalloc(RX_BUF_SIZE, GFP_KERNEL); | 1082 | pInfo->rx_buf = kmalloc(RX_BUF_SIZE, GFP_KERNEL); |
| 1083 | TRACE_M("r3964_open - rx_buf kmalloc %x",(int)pInfo->rx_buf); | 1083 | TRACE_M("r3964_open - rx_buf kmalloc %p",pInfo->rx_buf); |
| 1084 | 1084 | ||
| 1085 | if(!pInfo->rx_buf) | 1085 | if(!pInfo->rx_buf) |
| 1086 | { | 1086 | { |
| 1087 | printk(KERN_ERR "r3964: failed to alloc receive buffer\n"); | 1087 | printk(KERN_ERR "r3964: failed to alloc receive buffer\n"); |
| 1088 | kfree(pInfo); | 1088 | kfree(pInfo); |
| 1089 | TRACE_M("r3964_open - info kfree %x",(int)pInfo); | 1089 | TRACE_M("r3964_open - info kfree %p",pInfo); |
| 1090 | return -ENOMEM; | 1090 | return -ENOMEM; |
| 1091 | } | 1091 | } |
| 1092 | 1092 | ||
| 1093 | pInfo->tx_buf = kmalloc(TX_BUF_SIZE, GFP_KERNEL); | 1093 | pInfo->tx_buf = kmalloc(TX_BUF_SIZE, GFP_KERNEL); |
| 1094 | TRACE_M("r3964_open - tx_buf kmalloc %x",(int)pInfo->tx_buf); | 1094 | TRACE_M("r3964_open - tx_buf kmalloc %p",pInfo->tx_buf); |
| 1095 | 1095 | ||
| 1096 | if(!pInfo->tx_buf) | 1096 | if(!pInfo->tx_buf) |
| 1097 | { | 1097 | { |
| 1098 | printk(KERN_ERR "r3964: failed to alloc transmit buffer\n"); | 1098 | printk(KERN_ERR "r3964: failed to alloc transmit buffer\n"); |
| 1099 | kfree(pInfo->rx_buf); | 1099 | kfree(pInfo->rx_buf); |
| 1100 | TRACE_M("r3964_open - rx_buf kfree %x",(int)pInfo->rx_buf); | 1100 | TRACE_M("r3964_open - rx_buf kfree %p",pInfo->rx_buf); |
| 1101 | kfree(pInfo); | 1101 | kfree(pInfo); |
| 1102 | TRACE_M("r3964_open - info kfree %x",(int)pInfo); | 1102 | TRACE_M("r3964_open - info kfree %p",pInfo); |
| 1103 | return -ENOMEM; | 1103 | return -ENOMEM; |
| 1104 | } | 1104 | } |
| 1105 | 1105 | ||
| @@ -1154,11 +1154,11 @@ static void r3964_close(struct tty_struct *tty) | |||
| 1154 | if(pMsg) | 1154 | if(pMsg) |
| 1155 | { | 1155 | { |
| 1156 | kfree(pMsg); | 1156 | kfree(pMsg); |
| 1157 | TRACE_M("r3964_close - msg kfree %x",(int)pMsg); | 1157 | TRACE_M("r3964_close - msg kfree %p",pMsg); |
| 1158 | } | 1158 | } |
| 1159 | } | 1159 | } |
| 1160 | kfree(pClient); | 1160 | kfree(pClient); |
| 1161 | TRACE_M("r3964_close - client kfree %x",(int)pClient); | 1161 | TRACE_M("r3964_close - client kfree %p",pClient); |
| 1162 | pClient=pNext; | 1162 | pClient=pNext; |
| 1163 | } | 1163 | } |
| 1164 | /* Remove jobs from tx_queue: */ | 1164 | /* Remove jobs from tx_queue: */ |
| @@ -1177,11 +1177,11 @@ static void r3964_close(struct tty_struct *tty) | |||
| 1177 | /* Free buffers: */ | 1177 | /* Free buffers: */ |
| 1178 | wake_up_interruptible(&pInfo->read_wait); | 1178 | wake_up_interruptible(&pInfo->read_wait); |
| 1179 | kfree(pInfo->rx_buf); | 1179 | kfree(pInfo->rx_buf); |
| 1180 | TRACE_M("r3964_close - rx_buf kfree %x",(int)pInfo->rx_buf); | 1180 | TRACE_M("r3964_close - rx_buf kfree %p",pInfo->rx_buf); |
| 1181 | kfree(pInfo->tx_buf); | 1181 | kfree(pInfo->tx_buf); |
| 1182 | TRACE_M("r3964_close - tx_buf kfree %x",(int)pInfo->tx_buf); | 1182 | TRACE_M("r3964_close - tx_buf kfree %p",pInfo->tx_buf); |
| 1183 | kfree(pInfo); | 1183 | kfree(pInfo); |
| 1184 | TRACE_M("r3964_close - info kfree %x",(int)pInfo); | 1184 | TRACE_M("r3964_close - info kfree %p",pInfo); |
| 1185 | } | 1185 | } |
| 1186 | 1186 | ||
| 1187 | static ssize_t r3964_read(struct tty_struct *tty, struct file *file, | 1187 | static ssize_t r3964_read(struct tty_struct *tty, struct file *file, |
| @@ -1234,7 +1234,7 @@ repeat: | |||
| 1234 | count = sizeof(struct r3964_client_message); | 1234 | count = sizeof(struct r3964_client_message); |
| 1235 | 1235 | ||
| 1236 | kfree(pMsg); | 1236 | kfree(pMsg); |
| 1237 | TRACE_M("r3964_read - msg kfree %x",(int)pMsg); | 1237 | TRACE_M("r3964_read - msg kfree %p",pMsg); |
| 1238 | 1238 | ||
| 1239 | if (copy_to_user(buf,&theMsg, count)) | 1239 | if (copy_to_user(buf,&theMsg, count)) |
| 1240 | return -EFAULT; | 1240 | return -EFAULT; |
| @@ -1279,7 +1279,7 @@ static ssize_t r3964_write(struct tty_struct * tty, struct file * file, | |||
| 1279 | * Allocate a buffer for the data and copy it from the buffer with header prepended | 1279 | * Allocate a buffer for the data and copy it from the buffer with header prepended |
| 1280 | */ | 1280 | */ |
| 1281 | new_data = kmalloc (count+sizeof(struct r3964_block_header), GFP_KERNEL); | 1281 | new_data = kmalloc (count+sizeof(struct r3964_block_header), GFP_KERNEL); |
| 1282 | TRACE_M("r3964_write - kmalloc %x",(int)new_data); | 1282 | TRACE_M("r3964_write - kmalloc %p",new_data); |
| 1283 | if (new_data == NULL) { | 1283 | if (new_data == NULL) { |
| 1284 | if (pInfo->flags & R3964_DEBUG) | 1284 | if (pInfo->flags & R3964_DEBUG) |
| 1285 | { | 1285 | { |
diff --git a/drivers/char/watchdog/mv64x60_wdt.c b/drivers/char/watchdog/mv64x60_wdt.c index 1436aea3b28f..6d3ff0836c44 100644 --- a/drivers/char/watchdog/mv64x60_wdt.c +++ b/drivers/char/watchdog/mv64x60_wdt.c | |||
| @@ -87,6 +87,8 @@ static int mv64x60_wdt_open(struct inode *inode, struct file *file) | |||
| 87 | mv64x60_wdt_service(); | 87 | mv64x60_wdt_service(); |
| 88 | mv64x60_wdt_handler_enable(); | 88 | mv64x60_wdt_handler_enable(); |
| 89 | 89 | ||
| 90 | nonseekable_open(inode, file); | ||
| 91 | |||
| 90 | return 0; | 92 | return 0; |
| 91 | } | 93 | } |
| 92 | 94 | ||
| @@ -103,12 +105,9 @@ static int mv64x60_wdt_release(struct inode *inode, struct file *file) | |||
| 103 | return 0; | 105 | return 0; |
| 104 | } | 106 | } |
| 105 | 107 | ||
| 106 | static ssize_t mv64x60_wdt_write(struct file *file, const char *data, | 108 | static ssize_t mv64x60_wdt_write(struct file *file, const char __user *data, |
| 107 | size_t len, loff_t * ppos) | 109 | size_t len, loff_t * ppos) |
| 108 | { | 110 | { |
| 109 | if (*ppos != file->f_pos) | ||
| 110 | return -ESPIPE; | ||
| 111 | |||
| 112 | if (len) | 111 | if (len) |
| 113 | mv64x60_wdt_service(); | 112 | mv64x60_wdt_service(); |
| 114 | 113 | ||
| @@ -119,6 +118,7 @@ static int mv64x60_wdt_ioctl(struct inode *inode, struct file *file, | |||
| 119 | unsigned int cmd, unsigned long arg) | 118 | unsigned int cmd, unsigned long arg) |
| 120 | { | 119 | { |
| 121 | int timeout; | 120 | int timeout; |
| 121 | void __user *argp = (void __user *)arg; | ||
| 122 | static struct watchdog_info info = { | 122 | static struct watchdog_info info = { |
| 123 | .options = WDIOF_KEEPALIVEPING, | 123 | .options = WDIOF_KEEPALIVEPING, |
| 124 | .firmware_version = 0, | 124 | .firmware_version = 0, |
| @@ -127,13 +127,13 @@ static int mv64x60_wdt_ioctl(struct inode *inode, struct file *file, | |||
| 127 | 127 | ||
| 128 | switch (cmd) { | 128 | switch (cmd) { |
| 129 | case WDIOC_GETSUPPORT: | 129 | case WDIOC_GETSUPPORT: |
| 130 | if (copy_to_user((void *)arg, &info, sizeof(info))) | 130 | if (copy_to_user(argp, &info, sizeof(info))) |
| 131 | return -EFAULT; | 131 | return -EFAULT; |
| 132 | break; | 132 | break; |
| 133 | 133 | ||
| 134 | case WDIOC_GETSTATUS: | 134 | case WDIOC_GETSTATUS: |
| 135 | case WDIOC_GETBOOTSTATUS: | 135 | case WDIOC_GETBOOTSTATUS: |
| 136 | if (put_user(wdt_status, (int *)arg)) | 136 | if (put_user(wdt_status, (int __user *)argp)) |
| 137 | return -EFAULT; | 137 | return -EFAULT; |
| 138 | wdt_status &= ~WDIOF_KEEPALIVEPING; | 138 | wdt_status &= ~WDIOF_KEEPALIVEPING; |
| 139 | break; | 139 | break; |
| @@ -154,7 +154,7 @@ static int mv64x60_wdt_ioctl(struct inode *inode, struct file *file, | |||
| 154 | 154 | ||
| 155 | case WDIOC_GETTIMEOUT: | 155 | case WDIOC_GETTIMEOUT: |
| 156 | timeout = mv64x60_wdt_timeout * HZ; | 156 | timeout = mv64x60_wdt_timeout * HZ; |
| 157 | if (put_user(timeout, (int *)arg)) | 157 | if (put_user(timeout, (int __user *)argp)) |
| 158 | return -EFAULT; | 158 | return -EFAULT; |
| 159 | break; | 159 | break; |
| 160 | 160 | ||
