hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/media/usb/dvb-usb/dib0700_devices.c
....@@ -1,8 +1,5 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /* Linux driver for devices based on the DiBcom DiB0700 USB bridge
2
- *
3
- * This program is free software; you can redistribute it and/or modify it
4
- * under the terms of the GNU General Public License as published by the Free
5
- * Software Foundation, version 2.
63 *
74 * Copyright (C) 2005-9 DiBcom, SA et al
85 */
....@@ -29,7 +26,7 @@
2926
3027 static int force_lna_activation;
3128 module_param(force_lna_activation, int, 0644);
32
-MODULE_PARM_DESC(force_lna_activation, "force the activation of Low-Noise-Amplifyer(s) (LNA), if applicable for the device (default: 0=automatic/off).");
29
+MODULE_PARM_DESC(force_lna_activation, "force the activation of Low-Noise-Amplifier(s) (LNA), if applicable for the device (default: 0=automatic/off).");
3330
3431 struct dib0700_adapter_state {
3532 int (*set_param_save) (struct dvb_frontend *);
....@@ -1662,14 +1659,14 @@
16621659
16631660 switch (band) {
16641661 default:
1665
- deb_info("Warning : Rf frequency (%iHz) is not in the supported range, using VHF switch ", fe->dtv_property_cache.frequency);
1666
- /* fall through */
1662
+ deb_info("Warning : Rf frequency (%iHz) is not in the supported range, using VHF switch ", fe->dtv_property_cache.frequency);
1663
+ fallthrough;
16671664 case BAND_VHF:
1668
- state->dib8000_ops.set_gpio(fe, 3, 0, 1);
1669
- break;
1665
+ state->dib8000_ops.set_gpio(fe, 3, 0, 1);
1666
+ break;
16701667 case BAND_UHF:
1671
- state->dib8000_ops.set_gpio(fe, 3, 0, 0);
1672
- break;
1668
+ state->dib8000_ops.set_gpio(fe, 3, 0, 0);
1669
+ break;
16731670 }
16741671
16751672 ret = state->set_param_save(fe);
....@@ -1741,14 +1738,9 @@
17411738 struct dib0700_adapter_state *st = adap->priv;
17421739 struct i2c_adapter *tun_i2c = st->dib8000_ops.get_i2c_master(adap->fe_adap[0].fe, DIBX000_I2C_INTERFACE_TUNER, 1);
17431740
1744
- if (adap->id == 0) {
1745
- if (dvb_attach(dib0090_register, adap->fe_adap[0].fe, tun_i2c, &dib809x_dib0090_config) == NULL)
1746
- return -ENODEV;
1747
- } else {
1748
- /* FIXME: check if it is fe_adap[1] */
1749
- if (dvb_attach(dib0090_register, adap->fe_adap[0].fe, tun_i2c, &dib809x_dib0090_config) == NULL)
1750
- return -ENODEV;
1751
- }
1741
+ /* FIXME: if adap->id != 0, check if it is fe_adap[1] */
1742
+ if (!dvb_attach(dib0090_register, adap->fe_adap[0].fe, tun_i2c, &dib809x_dib0090_config))
1743
+ return -ENODEV;
17521744
17531745 st->set_param_save = adap->fe_adap[0].fe->ops.tuner_ops.set_params;
17541746 adap->fe_adap[0].fe->ops.tuner_ops.set_params = dib8096_set_param_override;
....@@ -3771,12 +3763,12 @@
37713763 mn88472_config.ts_mode = PARALLEL_TS_MODE;
37723764 mn88472_config.ts_clock = FIXED_TS_CLOCK;
37733765 memset(&info, 0, sizeof(struct i2c_board_info));
3774
- strlcpy(info.type, "mn88472", I2C_NAME_SIZE);
3766
+ strscpy(info.type, "mn88472", I2C_NAME_SIZE);
37753767 info.addr = 0x18;
37763768 info.platform_data = &mn88472_config;
37773769 request_module(info.type);
3778
- client_demod = i2c_new_device(&d->i2c_adap, &info);
3779
- if (client_demod == NULL || client_demod->dev.driver == NULL)
3770
+ client_demod = i2c_new_client_device(&d->i2c_adap, &info);
3771
+ if (!i2c_client_has_driver(client_demod))
37803772 goto fail_demod_device;
37813773 if (!try_module_get(client_demod->dev.driver->owner))
37823774 goto fail_demod_module;
....@@ -3798,13 +3790,13 @@
37983790 tda18250_config.fe = adap->fe_adap[0].fe;
37993791
38003792 memset(&info, 0, sizeof(struct i2c_board_info));
3801
- strlcpy(info.type, "tda18250", I2C_NAME_SIZE);
3793
+ strscpy(info.type, "tda18250", I2C_NAME_SIZE);
38023794 info.addr = 0x60;
38033795 info.platform_data = &tda18250_config;
38043796
38053797 request_module(info.type);
3806
- client_tuner = i2c_new_device(&adap->dev->i2c_adap, &info);
3807
- if (client_tuner == NULL || client_tuner->dev.driver == NULL)
3798
+ client_tuner = i2c_new_client_device(&adap->dev->i2c_adap, &info);
3799
+ if (!i2c_client_has_driver(client_tuner))
38083800 goto fail_tuner_device;
38093801 if (!try_module_get(client_tuner->dev.driver->owner))
38103802 goto fail_tuner_module;