From 6778948f9de86c3cfaf36725a7c87dcff9ba247f Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Mon, 11 Dec 2023 08:20:59 +0000
Subject: [PATCH] kernel_5.10 no rt
---
kernel/drivers/misc/nkio/nk_io_core.c | 26 +++++++++++---------------
1 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/kernel/drivers/misc/nkio/nk_io_core.c b/kernel/drivers/misc/nkio/nk_io_core.c
index e17fb86..c2f4ae1 100755
--- a/kernel/drivers/misc/nkio/nk_io_core.c
+++ b/kernel/drivers/misc/nkio/nk_io_core.c
@@ -13,6 +13,7 @@
#include <linux/string.h>
#include <linux/uaccess.h>
#include <linux/device.h>
+#include <linux/proc_fs.h>
#define GPIO_FUNCTION_OUTPUT 0
#define GPIO_FUNCTION_INPUT 1
@@ -20,7 +21,7 @@
#define HIGH "1"
#define LOW "0"
-static int flash_flag = 0;
+//static int flash_flag = 0;
struct ndj_gpio {
int gpio_num; //gpio num
@@ -94,7 +95,7 @@
};
#endif
-static int event_flag = 0;
+//static int event_flag = 0;
static int open_now = 0;
static char* file_name = NULL;
@@ -152,26 +153,21 @@
}
-static const struct file_operations gpio_ops = {
- .owner = THIS_MODULE,
- .open = gpio_open,
- .write = gpio_write,
- .read = gpio_read,
+static const struct proc_ops gpio_ops = {
+ .proc_open = gpio_open,
+ .proc_write = gpio_write,
+ .proc_read = gpio_read,
};
static int ndj_gpio_probe(struct platform_device *pdev) {
struct device_node *np = pdev->dev.of_node;
struct device_node *child_np;
- struct device *dev = &pdev->dev;
static struct proc_dir_entry *root_entry_gpio;
enum of_gpio_flags gpio_flags;
int ret = 0;
int gpio_cnt = 0;
char gpio_name_num[20];
int gpio_in_cnt = 0;
- int cnt =0;
- int i=0;
- enum of_gpio_flags flags;
gpio_data = devm_kzalloc(&pdev->dev, sizeof(struct ndj_gpio_data),GFP_KERNEL);
if (!gpio_data) {
@@ -286,15 +282,15 @@
static int ndj_gpio_suspend(struct platform_device *pdev, pm_message_t state)
{
- int ret;
- struct nk_io_pdata *pdata;
+// int ret;
+// struct nk_io_pdata *pdata;
printk("nk_suspend !!!!\n");
return 0;
}
static int ndj_gpio_resume(struct platform_device *pdev)
{
- int ret,reset_pin;
+// int ret,reset_pin;
printk("nk_io resume !!!!\n");
return 0;
}
@@ -325,4 +321,4 @@
module_platform_driver(ndj_gpio_driver);
MODULE_LICENSE("GPL");
-MODULE_LICENSE("GPL");
\ No newline at end of file
+MODULE_LICENSE("GPL");
--
Gitblit v1.6.2