File tree 3 files changed +13
-29
lines changed
host/linux/host_driver/esp32
3 files changed +13
-29
lines changed Original file line number Diff line number Diff line change @@ -728,11 +728,24 @@ static int __init esp_init(void)
728
728
deinit_adapter ();
729
729
}
730
730
731
+ #ifdef CONFIG_SUPPORT_ESP_SERIAL
732
+ /* Create the char devices */
733
+ ret = esp_serial_init ((void * )adapter );
734
+ if (ret != 0 ) {
735
+ printk (KERN_ERR "Error initialising serial char devices!\n" );
736
+ return ret ;
737
+ }
738
+ #endif
739
+
731
740
return ret ;
732
741
}
733
742
734
743
static void __exit esp_exit (void )
735
744
{
745
+ #ifdef CONFIG_SUPPORT_ESP_SERIAL
746
+ /* Remove the char devices */
747
+ esp_serial_cleanup ();
748
+ #endif
736
749
esp_deinit_interface_layer ();
737
750
deinit_adapter ();
738
751
if (resetpin != HOST_GPIO_PIN_INVALID ) {
Original file line number Diff line number Diff line change 27
27
#include "esp_sdio_api.h"
28
28
#include "esp_api.h"
29
29
#include "esp_bt_api.h"
30
- #ifdef CONFIG_SUPPORT_ESP_SERIAL
31
- #include "esp_serial.h"
32
- #endif
33
30
#include <linux/kthread.h>
34
31
#include <linux/printk.h>
35
32
@@ -261,10 +258,6 @@ static void esp_remove(struct sdio_func *func)
261
258
262
259
printk (KERN_INFO "%s -> Remove card" , __func__ );
263
260
264
- #ifdef CONFIG_SUPPORT_ESP_SERIAL
265
- esp_serial_cleanup ();
266
- #endif
267
-
268
261
#ifdef CONFIG_ENABLE_MONITOR_PROCESS
269
262
if (monitor_thread )
270
263
kthread_stop (monitor_thread );
@@ -714,15 +707,6 @@ static int esp_probe(struct sdio_func *func,
714
707
if (!tx_thread )
715
708
printk (KERN_ERR "Failed to create esp32_sdio TX thread\n" );
716
709
717
- #ifdef CONFIG_SUPPORT_ESP_SERIAL
718
- ret = esp_serial_init ((void * ) context -> adapter );
719
- if (ret != 0 ) {
720
- esp_remove (func );
721
- printk (KERN_ERR "Error initialising serial interface\n" );
722
- return ret ;
723
- }
724
- #endif
725
-
726
710
ret = esp_add_card (context -> adapter );
727
711
if (ret ) {
728
712
esp_remove (func );
Original file line number Diff line number Diff line change 23
23
#include "esp_if.h"
24
24
#include "esp_api.h"
25
25
#include "esp_bt_api.h"
26
- #ifdef CONFIG_SUPPORT_ESP_SERIAL
27
- #include "esp_serial.h"
28
- #endif
29
26
30
27
#define SPI_INITIAL_CLK_MHZ 10
31
28
#define NUMBER_1M 1000000
@@ -493,15 +490,6 @@ static int spi_init(void)
493
490
return status ;
494
491
}
495
492
496
- #ifdef CONFIG_SUPPORT_ESP_SERIAL
497
- status = esp_serial_init ((void * ) spi_context .adapter );
498
- if (status != 0 ) {
499
- spi_exit ();
500
- printk (KERN_ERR "Error initialising serial interface\n" );
501
- return status ;
502
- }
503
- #endif
504
-
505
493
status = esp_add_card (spi_context .adapter );
506
494
if (status ) {
507
495
spi_exit ();
@@ -530,7 +518,6 @@ static void spi_exit(void)
530
518
spi_context .spi_workqueue = NULL ;
531
519
}
532
520
533
- esp_serial_cleanup ();
534
521
esp_remove_card (spi_context .adapter );
535
522
536
523
if (spi_context .adapter -> hcidev )
You can’t perform that action at this time.
0 commit comments