hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/misc/cardreader/rtl8411.c
....@@ -1,19 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /* Driver for Realtek PCI-Express card reader
23 *
34 * Copyright(c) 2009-2013 Realtek Semiconductor Corp. All rights reserved.
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms of the GNU General Public License as published by the
7
- * Free Software Foundation; either version 2, or (at your option) any
8
- * later version.
9
- *
10
- * This program is distributed in the hope that it will be useful, but
11
- * WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
- * General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License along
16
- * with this program; if not, see <http://www.gnu.org/licenses/>.
175 *
186 * Author:
197 * Wei WANG <wei_wang@realsil.com.cn>
....@@ -49,10 +37,11 @@
4937
5038 static void rtl8411_fetch_vendor_settings(struct rtsx_pcr *pcr)
5139 {
40
+ struct pci_dev *pdev = pcr->pci;
5241 u32 reg1 = 0;
5342 u8 reg3 = 0;
5443
55
- rtsx_pci_read_config_dword(pcr, PCR_SETTING_REG1, &reg1);
44
+ pci_read_config_dword(pdev, PCR_SETTING_REG1, &reg1);
5645 pcr_dbg(pcr, "Cfg 0x%x: 0x%x\n", PCR_SETTING_REG1, reg1);
5746
5847 if (!rtsx_vendor_setting_valid(reg1))
....@@ -64,16 +53,17 @@
6453 pcr->card_drive_sel &= 0x3F;
6554 pcr->card_drive_sel |= rtsx_reg_to_card_drive_sel(reg1);
6655
67
- rtsx_pci_read_config_byte(pcr, PCR_SETTING_REG3, &reg3);
56
+ pci_read_config_byte(pdev, PCR_SETTING_REG3, &reg3);
6857 pcr_dbg(pcr, "Cfg 0x%x: 0x%x\n", PCR_SETTING_REG3, reg3);
6958 pcr->sd30_drive_sel_3v3 = rtl8411_reg_to_sd30_drive_sel_3v3(reg3);
7059 }
7160
7261 static void rtl8411b_fetch_vendor_settings(struct rtsx_pcr *pcr)
7362 {
63
+ struct pci_dev *pdev = pcr->pci;
7464 u32 reg = 0;
7565
76
- rtsx_pci_read_config_dword(pcr, PCR_SETTING_REG1, &reg);
66
+ pci_read_config_dword(pdev, PCR_SETTING_REG1, &reg);
7767 pcr_dbg(pcr, "Cfg 0x%x: 0x%x\n", PCR_SETTING_REG1, reg);
7868
7969 if (!rtsx_vendor_setting_valid(reg))