hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/soc/ti/knav_dma.c
....@@ -355,7 +355,7 @@
355355 }
356356 }
357357
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)
359359 {
360360 struct knav_dma_device *dma;
361361
....@@ -370,17 +370,7 @@
370370 return 0;
371371 }
372372
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);
384374
385375 static int of_channel_match_helper(struct device_node *np, const char *name,
386376 const char **dma_instance)
....@@ -438,7 +428,7 @@
438428
439429 chan_num = of_channel_match_helper(dev->of_node, name, &instance);
440430 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);
442432 return (void *)-EINVAL;
443433 }
444434
....@@ -461,7 +451,7 @@
461451 }
462452 }
463453 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);
465455 return (void *)-EINVAL;
466456 }
467457
....@@ -544,15 +534,15 @@
544534
545535 ret = of_address_to_resource(node, index, &res);
546536 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);
549539 return ERR_PTR(ret);
550540 }
551541
552542 regs = devm_ioremap_resource(kdev->dev, &res);
553543 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);
556546 if (_size)
557547 *_size = resource_size(&res);
558548
....@@ -598,7 +588,7 @@
598588
599589 INIT_LIST_HEAD(&chan->list);
600590 chan->dma = dma;
601
- chan->direction = DMA_NONE;
591
+ chan->direction = DMA_TRANS_NONE;
602592 atomic_set(&chan->ref_count, 0);
603593 spin_lock_init(&chan->lock);
604594
....@@ -780,7 +770,7 @@
780770 }
781771
782772 debugfs_create_file("knav_dma", S_IFREG | S_IRUGO, NULL, NULL,
783
- &knav_dma_debug_ops);
773
+ &knav_dma_debug_fops);
784774
785775 device_ready = true;
786776 return ret;