| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * driver for Earthsoft PT1/PT2 |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * based on pt1dvr - http://pt1dvr.sourceforge.jp/ |
|---|
| 7 | 8 | * 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. |
|---|
| 18 | 9 | */ |
|---|
| 19 | 10 | |
|---|
| 20 | 11 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 1226 | 1217 | |
|---|
| 1227 | 1218 | static int pt1_suspend(struct device *dev) |
|---|
| 1228 | 1219 | { |
|---|
| 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); |
|---|
| 1231 | 1221 | |
|---|
| 1232 | 1222 | pt1_init_streams(pt1); |
|---|
| 1233 | 1223 | pt1_disable_ram(pt1); |
|---|
| .. | .. |
|---|
| 1239 | 1229 | |
|---|
| 1240 | 1230 | static int pt1_resume(struct device *dev) |
|---|
| 1241 | 1231 | { |
|---|
| 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); |
|---|
| 1244 | 1233 | int ret; |
|---|
| 1245 | 1234 | int i; |
|---|
| 1246 | 1235 | |
|---|
| .. | .. |
|---|
| 1396 | 1385 | i2c_adap->algo = &pt1_i2c_algo; |
|---|
| 1397 | 1386 | i2c_adap->algo_data = NULL; |
|---|
| 1398 | 1387 | i2c_adap->dev.parent = &pdev->dev; |
|---|
| 1399 | | - strcpy(i2c_adap->name, DRIVER_NAME); |
|---|
| 1388 | + strscpy(i2c_adap->name, DRIVER_NAME, sizeof(i2c_adap->name)); |
|---|
| 1400 | 1389 | i2c_set_adapdata(i2c_adap, pt1); |
|---|
| 1401 | 1390 | ret = i2c_add_adapter(i2c_adap); |
|---|
| 1402 | 1391 | if (ret < 0) |
|---|