@@ -55,34 +55,32 @@ char *NAME_DEV_U[ID_DEV_SIZE] = {[ID_DEV_LED] = "rtled%u",
55
55
[ID_DEV_MOTOR ] = "rtmotor%u" };
56
56
57
57
// used in by register_dev() and cleanup_each_dev()
58
- static int _major_dev [ID_DEV_SIZE ] = {
58
+ int _major_dev [ID_DEV_SIZE ] = {
59
59
[ID_DEV_LED ] = DEV_MAJOR , [ID_DEV_SWITCH ] = DEV_MAJOR ,
60
60
[ID_DEV_SENSOR ] = DEV_MAJOR , [ID_DEV_BUZZER ] = DEV_MAJOR ,
61
61
[ID_DEV_MOTORRAWR ] = DEV_MAJOR , [ID_DEV_MOTORRAWL ] = DEV_MAJOR ,
62
62
[ID_DEV_MOTOREN ] = DEV_MAJOR , [ID_DEV_MOTOR ] = DEV_MAJOR };
63
63
64
64
// used in register_dev() and cleanup_each_dev()
65
- static int _minor_dev [ID_DEV_SIZE ] = {
65
+ int _minor_dev [ID_DEV_SIZE ] = {
66
66
[ID_DEV_LED ] = DEV_MINOR , [ID_DEV_SWITCH ] = DEV_MINOR ,
67
67
[ID_DEV_SENSOR ] = DEV_MINOR , [ID_DEV_BUZZER ] = DEV_MINOR ,
68
68
[ID_DEV_MOTORRAWR ] = DEV_MINOR , [ID_DEV_MOTORRAWL ] = DEV_MINOR ,
69
69
[ID_DEV_MOTOREN ] = DEV_MINOR , [ID_DEV_MOTOR ] = DEV_MINOR };
70
70
71
71
/* --- General Options --- */
72
- static struct cdev * cdev_array = NULL ;
73
- static struct class * class_dev [ID_DEV_SIZE ] = {
72
+ struct cdev * cdev_array = NULL ;
73
+ struct class * class_dev [ID_DEV_SIZE ] = {
74
74
[ID_DEV_LED ] = NULL , [ID_DEV_SWITCH ] = NULL ,
75
75
[ID_DEV_SENSOR ] = NULL , [ID_DEV_BUZZER ] = NULL ,
76
76
[ID_DEV_MOTORRAWR ] = NULL , [ID_DEV_MOTORRAWL ] = NULL ,
77
77
[ID_DEV_MOTOREN ] = NULL , [ID_DEV_MOTOR ] = NULL };
78
78
79
- static volatile void __iomem * pwm_base ;
80
- static volatile void __iomem * clk_base ;
81
- static volatile uint32_t * gpio_base ;
82
-
83
- static volatile int cdev_index = 0 ;
84
-
85
- static struct mutex lock ;
79
+ volatile void __iomem * pwm_base ;
80
+ volatile void __iomem * clk_base ;
81
+ volatile uint32_t * gpio_base ;
82
+ volatile int cdev_index = 0 ;
83
+ struct mutex lock ;
86
84
87
85
/* --- Function Declarations --- */
88
86
static void set_motor_r_freq (int freq );
@@ -123,13 +121,13 @@ struct mcp3204_drvdata {
123
121
124
122
/* --- Static variables --- */
125
123
/* SPI device ID */
126
- static struct spi_device_id mcp3204_id [] = {
124
+ struct spi_device_id mcp3204_id [] = {
127
125
{"mcp3204" , 0 },
128
126
{},
129
127
};
130
128
131
129
/* SPI Info */
132
- static struct spi_board_info mcp3204_info = {
130
+ struct spi_board_info mcp3204_info = {
133
131
.modalias = "mcp3204" ,
134
132
.max_speed_hz = 100000 ,
135
133
.bus_num = 0 ,
@@ -138,11 +136,11 @@ static struct spi_board_info mcp3204_info = {
138
136
};
139
137
140
138
#if LINUX_VERSION_CODE >= KERNEL_VERSION (5 , 16 , 0 )
141
- static struct device * mcp320x_dev ;
139
+ struct device * mcp320x_dev ;
142
140
#endif
143
141
144
142
/* SPI Dirver Info */
145
- static struct spi_driver mcp3204_driver = {
143
+ struct spi_driver mcp3204_driver = {
146
144
.driver =
147
145
{
148
146
.name = DEVNAME_SENSOR ,
@@ -165,20 +163,20 @@ struct rtcnt_device_info {
165
163
int raw_pulse_count ;
166
164
};
167
165
168
- static struct i2c_client * i2c_client_r = NULL ;
169
- static struct i2c_client * i2c_client_l = NULL ;
170
- static unsigned int motor_l_freq_is_positive = 1 ;
171
- static unsigned int motor_r_freq_is_positive = 1 ;
166
+ struct i2c_client * i2c_client_r = NULL ;
167
+ struct i2c_client * i2c_client_l = NULL ;
168
+ unsigned int motor_l_freq_is_positive = 1 ;
169
+ unsigned int motor_r_freq_is_positive = 1 ;
172
170
173
171
/* I2C Device ID */
174
- static struct i2c_device_id i2c_counter_id [] = {
172
+ struct i2c_device_id i2c_counter_id [] = {
175
173
{DEVNAME_CNTL , 0 },
176
174
{DEVNAME_CNTR , 1 },
177
175
{},
178
176
};
179
177
180
178
/* I2C Dirver Info */
181
- static struct i2c_driver i2c_counter_driver = {
179
+ struct i2c_driver i2c_counter_driver = {
182
180
.driver =
183
181
{
184
182
.name = "rtcounter" ,
@@ -1673,6 +1671,8 @@ int dev_init_module(void)
1673
1671
int registered_devices = 0 ;
1674
1672
size_t size ;
1675
1673
1674
+ tmp_func ();
1675
+
1676
1676
/* log loding message */
1677
1677
printk (KERN_INFO "%s: loading driver...\n" , DRIVER_NAME );
1678
1678
0 commit comments