forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/memstick/host/r592.c
....@@ -1,10 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2010 - Maxim Levitsky
34 * driver for Ricoh memstick readers
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License version 2 as
7
- * published by the Free Software Foundation.
85 */
96
107 #include <linux/kernel.h>
....@@ -47,12 +44,10 @@
4744 * memstick_debug_get_tpc_name - debug helper that returns string for
4845 * a TPC number
4946 */
50
-const char *memstick_debug_get_tpc_name(int tpc)
47
+static __maybe_unused const char *memstick_debug_get_tpc_name(int tpc)
5148 {
5249 return tpc_names[tpc-1];
5350 }
54
-EXPORT_SYMBOL(memstick_debug_get_tpc_name);
55
-
5651
5752 /* Read a register*/
5853 static inline u32 r592_read_reg(struct r592_device *dev, int address)
....@@ -831,7 +826,7 @@
831826 /* Stop the processing thread.
832827 That ensures that we won't take any more requests */
833828 kthread_stop(dev->io_thread);
834
-
829
+ del_timer_sync(&dev->detect_timer);
835830 r592_enable_device(dev, false);
836831
837832 while (!error && dev->req) {
....@@ -854,8 +849,7 @@
854849 #ifdef CONFIG_PM_SLEEP
855850 static int r592_suspend(struct device *core_dev)
856851 {
857
- struct pci_dev *pdev = to_pci_dev(core_dev);
858
- struct r592_device *dev = pci_get_drvdata(pdev);
852
+ struct r592_device *dev = dev_get_drvdata(core_dev);
859853
860854 r592_clear_interrupts(dev);
861855 memstick_suspend_host(dev->host);
....@@ -865,8 +859,7 @@
865859
866860 static int r592_resume(struct device *core_dev)
867861 {
868
- struct pci_dev *pdev = to_pci_dev(core_dev);
869
- struct r592_device *dev = pci_get_drvdata(pdev);
862
+ struct r592_device *dev = dev_get_drvdata(core_dev);
870863
871864 r592_clear_interrupts(dev);
872865 r592_enable_device(dev, false);