treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / misc / mic / card / mic_debugfs.c
blobb58608829b180e3b1dbb45afec9da42a26bd61f1
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * Intel MIC Platform Software Stack (MPSS)
5 * Copyright(c) 2013 Intel Corporation.
7 * Disclaimer: The codes contained in these modules may be specific to
8 * the Intel Software Development Platform codenamed: Knights Ferry, and
9 * the Intel product codenamed: Knights Corner, and are not backward
10 * compatible with other Intel products. Additionally, Intel will NOT
11 * support the codes or instruction set in future products.
13 * Intel MIC Card driver.
15 #include <linux/debugfs.h>
16 #include <linux/delay.h>
17 #include <linux/seq_file.h>
18 #include <linux/interrupt.h>
19 #include <linux/device.h>
21 #include "../common/mic_dev.h"
22 #include "mic_device.h"
24 /* Debugfs parent dir */
25 static struct dentry *mic_dbg;
27 /**
28 * mic_intr_show - Send interrupts to host.
30 static int mic_intr_show(struct seq_file *s, void *unused)
32 struct mic_driver *mdrv = s->private;
33 struct mic_device *mdev = &mdrv->mdev;
35 mic_send_intr(mdev, 0);
36 msleep(1000);
37 mic_send_intr(mdev, 1);
38 msleep(1000);
39 mic_send_intr(mdev, 2);
40 msleep(1000);
41 mic_send_intr(mdev, 3);
42 msleep(1000);
44 return 0;
47 DEFINE_SHOW_ATTRIBUTE(mic_intr);
49 /**
50 * mic_create_card_debug_dir - Initialize MIC debugfs entries.
52 void __init mic_create_card_debug_dir(struct mic_driver *mdrv)
54 if (!mic_dbg)
55 return;
57 mdrv->dbg_dir = debugfs_create_dir(mdrv->name, mic_dbg);
59 debugfs_create_file("intr_test", 0444, mdrv->dbg_dir, mdrv,
60 &mic_intr_fops);
63 /**
64 * mic_delete_card_debug_dir - Uninitialize MIC debugfs entries.
66 void mic_delete_card_debug_dir(struct mic_driver *mdrv)
68 debugfs_remove_recursive(mdrv->dbg_dir);
71 /**
72 * mic_init_card_debugfs - Initialize global debugfs entry.
74 void __init mic_init_card_debugfs(void)
76 mic_dbg = debugfs_create_dir(KBUILD_MODNAME, NULL);
79 /**
80 * mic_exit_card_debugfs - Uninitialize global debugfs entry
82 void mic_exit_card_debugfs(void)
84 debugfs_remove(mic_dbg);