| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2010 - Maxim Levitsky |
|---|
| 3 | 4 | * 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. |
|---|
| 8 | 5 | */ |
|---|
| 9 | 6 | |
|---|
| 10 | 7 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 47 | 44 | * memstick_debug_get_tpc_name - debug helper that returns string for |
|---|
| 48 | 45 | * a TPC number |
|---|
| 49 | 46 | */ |
|---|
| 50 | | -const char *memstick_debug_get_tpc_name(int tpc) |
|---|
| 47 | +static __maybe_unused const char *memstick_debug_get_tpc_name(int tpc) |
|---|
| 51 | 48 | { |
|---|
| 52 | 49 | return tpc_names[tpc-1]; |
|---|
| 53 | 50 | } |
|---|
| 54 | | -EXPORT_SYMBOL(memstick_debug_get_tpc_name); |
|---|
| 55 | | - |
|---|
| 56 | 51 | |
|---|
| 57 | 52 | /* Read a register*/ |
|---|
| 58 | 53 | static inline u32 r592_read_reg(struct r592_device *dev, int address) |
|---|
| .. | .. |
|---|
| 831 | 826 | /* Stop the processing thread. |
|---|
| 832 | 827 | That ensures that we won't take any more requests */ |
|---|
| 833 | 828 | kthread_stop(dev->io_thread); |
|---|
| 834 | | - |
|---|
| 829 | + del_timer_sync(&dev->detect_timer); |
|---|
| 835 | 830 | r592_enable_device(dev, false); |
|---|
| 836 | 831 | |
|---|
| 837 | 832 | while (!error && dev->req) { |
|---|
| .. | .. |
|---|
| 854 | 849 | #ifdef CONFIG_PM_SLEEP |
|---|
| 855 | 850 | static int r592_suspend(struct device *core_dev) |
|---|
| 856 | 851 | { |
|---|
| 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); |
|---|
| 859 | 853 | |
|---|
| 860 | 854 | r592_clear_interrupts(dev); |
|---|
| 861 | 855 | memstick_suspend_host(dev->host); |
|---|
| .. | .. |
|---|
| 865 | 859 | |
|---|
| 866 | 860 | static int r592_resume(struct device *core_dev) |
|---|
| 867 | 861 | { |
|---|
| 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); |
|---|
| 870 | 863 | |
|---|
| 871 | 864 | r592_clear_interrupts(dev); |
|---|
| 872 | 865 | r592_enable_device(dev, false); |
|---|