forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/media/pci/bt8xx/dst.c
....@@ -1,21 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 Frontend/Card driver for TwinHan DST Frontend
34 Copyright (C) 2003 Jamie Honan
45 Copyright (C) 2004, 2005 Manu Abraham (manu@kromtek.com)
56
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License
17
- along with this program; if not, write to the Free Software
18
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
197 */
208
219 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
....@@ -1100,7 +1088,8 @@
11001088 /* Card capabilities */
11011089 state->dst_hw_cap = p_dst_type->dst_feature;
11021090 pr_err("Recognise [%s]\n", p_dst_type->device_id);
1103
- strncpy(&state->fw_name[0], p_dst_type->device_id, 6);
1091
+ strscpy(state->fw_name, p_dst_type->device_id,
1092
+ sizeof(state->fw_name));
11041093 /* Multiple tuners */
11051094 if (p_dst_type->tuner_type & TUNER_TYPE_MULTI) {
11061095 switch (use_dst_type) {
....@@ -1295,15 +1284,15 @@
12951284
12961285 static int dst_tone_power_cmd(struct dst_state *state)
12971286 {
1298
- u8 paket[8] = { 0x00, 0x09, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00 };
1287
+ u8 packet[8] = { 0x00, 0x09, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00 };
12991288
13001289 if (state->dst_type != DST_TYPE_IS_SAT)
13011290 return -EOPNOTSUPP;
1302
- paket[4] = state->tx_tuna[4];
1303
- paket[2] = state->tx_tuna[2];
1304
- paket[3] = state->tx_tuna[3];
1305
- paket[7] = dst_check_sum (paket, 7);
1306
- return dst_command(state, paket, 8);
1291
+ packet[4] = state->tx_tuna[4];
1292
+ packet[2] = state->tx_tuna[2];
1293
+ packet[3] = state->tx_tuna[3];
1294
+ packet[7] = dst_check_sum (packet, 7);
1295
+ return dst_command(state, packet, 8);
13071296 }
13081297
13091298 static int dst_get_tuna(struct dst_state *state)
....@@ -1429,18 +1418,18 @@
14291418 static int dst_set_diseqc(struct dvb_frontend *fe, struct dvb_diseqc_master_cmd *cmd)
14301419 {
14311420 struct dst_state *state = fe->demodulator_priv;
1432
- u8 paket[8] = { 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xf0, 0xec };
1421
+ u8 packet[8] = { 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xf0, 0xec };
14331422
14341423 if (state->dst_type != DST_TYPE_IS_SAT)
14351424 return -EOPNOTSUPP;
14361425 if (cmd->msg_len > 0 && cmd->msg_len < 5)
1437
- memcpy(&paket[3], cmd->msg, cmd->msg_len);
1426
+ memcpy(&packet[3], cmd->msg, cmd->msg_len);
14381427 else if (cmd->msg_len == 5 && state->dst_hw_cap & DST_TYPE_HAS_DISEQC5)
1439
- memcpy(&paket[2], cmd->msg, cmd->msg_len);
1428
+ memcpy(&packet[2], cmd->msg, cmd->msg_len);
14401429 else
14411430 return -EINVAL;
1442
- paket[7] = dst_check_sum(&paket[0], 7);
1443
- return dst_command(state, paket, 8);
1431
+ packet[7] = dst_check_sum(&packet[0], 7);
1432
+ return dst_command(state, packet, 8);
14441433 }
14451434
14461435 static int dst_set_voltage(struct dvb_frontend *fe, enum fe_sec_voltage voltage)
....@@ -1733,7 +1722,7 @@
17331722 return state; /* Manu (DST is a card not a frontend) */
17341723 }
17351724
1736
-EXPORT_SYMBOL(dst_attach);
1725
+EXPORT_SYMBOL_GPL(dst_attach);
17371726
17381727 static const struct dvb_frontend_ops dst_dvbt_ops = {
17391728 .delsys = { SYS_DVBT },