.. | .. |
---|
355 | 355 | } |
---|
356 | 356 | } |
---|
357 | 357 | |
---|
358 | | -static int dma_debug_show(struct seq_file *s, void *v) |
---|
| 358 | +static int knav_dma_debug_show(struct seq_file *s, void *v) |
---|
359 | 359 | { |
---|
360 | 360 | struct knav_dma_device *dma; |
---|
361 | 361 | |
---|
.. | .. |
---|
370 | 370 | return 0; |
---|
371 | 371 | } |
---|
372 | 372 | |
---|
373 | | -static int knav_dma_debug_open(struct inode *inode, struct file *file) |
---|
374 | | -{ |
---|
375 | | - return single_open(file, dma_debug_show, NULL); |
---|
376 | | -} |
---|
377 | | - |
---|
378 | | -static const struct file_operations knav_dma_debug_ops = { |
---|
379 | | - .open = knav_dma_debug_open, |
---|
380 | | - .read = seq_read, |
---|
381 | | - .llseek = seq_lseek, |
---|
382 | | - .release = single_release, |
---|
383 | | -}; |
---|
| 373 | +DEFINE_SHOW_ATTRIBUTE(knav_dma_debug); |
---|
384 | 374 | |
---|
385 | 375 | static int of_channel_match_helper(struct device_node *np, const char *name, |
---|
386 | 376 | const char **dma_instance) |
---|
.. | .. |
---|
438 | 428 | |
---|
439 | 429 | chan_num = of_channel_match_helper(dev->of_node, name, &instance); |
---|
440 | 430 | if (chan_num < 0) { |
---|
441 | | - dev_err(kdev->dev, "No DMA instace with name %s\n", name); |
---|
| 431 | + dev_err(kdev->dev, "No DMA instance with name %s\n", name); |
---|
442 | 432 | return (void *)-EINVAL; |
---|
443 | 433 | } |
---|
444 | 434 | |
---|
.. | .. |
---|
461 | 451 | } |
---|
462 | 452 | } |
---|
463 | 453 | if (!found) { |
---|
464 | | - dev_err(kdev->dev, "No DMA instace with name %s\n", instance); |
---|
| 454 | + dev_err(kdev->dev, "No DMA instance with name %s\n", instance); |
---|
465 | 455 | return (void *)-EINVAL; |
---|
466 | 456 | } |
---|
467 | 457 | |
---|
.. | .. |
---|
544 | 534 | |
---|
545 | 535 | ret = of_address_to_resource(node, index, &res); |
---|
546 | 536 | if (ret) { |
---|
547 | | - dev_err(dev, "Can't translate of node(%s) address for index(%d)\n", |
---|
548 | | - node->name, index); |
---|
| 537 | + dev_err(dev, "Can't translate of node(%pOFn) address for index(%d)\n", |
---|
| 538 | + node, index); |
---|
549 | 539 | return ERR_PTR(ret); |
---|
550 | 540 | } |
---|
551 | 541 | |
---|
552 | 542 | regs = devm_ioremap_resource(kdev->dev, &res); |
---|
553 | 543 | if (IS_ERR(regs)) |
---|
554 | | - dev_err(dev, "Failed to map register base for index(%d) node(%s)\n", |
---|
555 | | - index, node->name); |
---|
| 544 | + dev_err(dev, "Failed to map register base for index(%d) node(%pOFn)\n", |
---|
| 545 | + index, node); |
---|
556 | 546 | if (_size) |
---|
557 | 547 | *_size = resource_size(&res); |
---|
558 | 548 | |
---|
.. | .. |
---|
598 | 588 | |
---|
599 | 589 | INIT_LIST_HEAD(&chan->list); |
---|
600 | 590 | chan->dma = dma; |
---|
601 | | - chan->direction = DMA_NONE; |
---|
| 591 | + chan->direction = DMA_TRANS_NONE; |
---|
602 | 592 | atomic_set(&chan->ref_count, 0); |
---|
603 | 593 | spin_lock_init(&chan->lock); |
---|
604 | 594 | |
---|
.. | .. |
---|
780 | 770 | } |
---|
781 | 771 | |
---|
782 | 772 | debugfs_create_file("knav_dma", S_IFREG | S_IRUGO, NULL, NULL, |
---|
783 | | - &knav_dma_debug_ops); |
---|
| 773 | + &knav_dma_debug_fops); |
---|
784 | 774 | |
---|
785 | 775 | device_ready = true; |
---|
786 | 776 | return ret; |
---|