forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/media/pci/pt1/pt1.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * driver for Earthsoft PT1/PT2
34 *
....@@ -5,16 +6,6 @@
56 *
67 * based on pt1dvr - http://pt1dvr.sourceforge.jp/
78 * by Tomoaki Ishikawa <tomy@users.sourceforge.jp>
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
189 */
1910
2011 #include <linux/kernel.h>
....@@ -1226,8 +1217,7 @@
12261217
12271218 static int pt1_suspend(struct device *dev)
12281219 {
1229
- struct pci_dev *pdev = to_pci_dev(dev);
1230
- struct pt1 *pt1 = pci_get_drvdata(pdev);
1220
+ struct pt1 *pt1 = dev_get_drvdata(dev);
12311221
12321222 pt1_init_streams(pt1);
12331223 pt1_disable_ram(pt1);
....@@ -1239,8 +1229,7 @@
12391229
12401230 static int pt1_resume(struct device *dev)
12411231 {
1242
- struct pci_dev *pdev = to_pci_dev(dev);
1243
- struct pt1 *pt1 = pci_get_drvdata(pdev);
1232
+ struct pt1 *pt1 = dev_get_drvdata(dev);
12441233 int ret;
12451234 int i;
12461235
....@@ -1396,7 +1385,7 @@
13961385 i2c_adap->algo = &pt1_i2c_algo;
13971386 i2c_adap->algo_data = NULL;
13981387 i2c_adap->dev.parent = &pdev->dev;
1399
- strcpy(i2c_adap->name, DRIVER_NAME);
1388
+ strscpy(i2c_adap->name, DRIVER_NAME, sizeof(i2c_adap->name));
14001389 i2c_set_adapdata(i2c_adap, pt1);
14011390 ret = i2c_add_adapter(i2c_adap);
14021391 if (ret < 0)