From 9370bb92b2d16684ee45cf24e879c93c509162da Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Thu, 19 Dec 2024 01:47:39 +0000 Subject: [PATCH] add wifi6 8852be driver --- kernel/drivers/media/pci/bt8xx/bttv-input.c | 25 ++++++++----------------- 1 files changed, 8 insertions(+), 17 deletions(-) diff --git a/kernel/drivers/media/pci/bt8xx/bttv-input.c b/kernel/drivers/media/pci/bt8xx/bttv-input.c index 08266b2..41226f1 100644 --- a/kernel/drivers/media/pci/bt8xx/bttv-input.c +++ b/kernel/drivers/media/pci/bt8xx/bttv-input.c @@ -1,17 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * * Copyright (c) 2003 Gerd Knorr * Copyright (c) 2003 Pavel Machek - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt @@ -93,7 +84,7 @@ data = ir_extract_bits(gpio, ir->mask_keycode); /* Check if it is keyup */ - keyup = (gpio & ir->mask_keyup) ? 1 << 31 : 0; + keyup = (gpio & ir->mask_keyup) ? 1UL << 31 : 0; if ((ir->last_gpio & 0x7f) != data) { dprintk("gpio=0x%x code=%d | %s\n", @@ -104,7 +95,7 @@ if (keyup) rc_keyup(ir->dev); } else { - if ((ir->last_gpio & 1 << 31) == keyup) + if ((ir->last_gpio & 1UL << 31) == keyup) return; dprintk("(cnt) gpio=0x%x code=%d | %s\n", @@ -370,7 +361,7 @@ /* Instantiate the I2C IR receiver device, if present */ void init_bttv_i2c_ir(struct bttv *btv) { - const unsigned short addr_list[] = { + static const unsigned short addr_list[] = { 0x1a, 0x18, 0x64, 0x30, 0x71, I2C_CLIENT_END }; @@ -382,7 +373,7 @@ memset(&info, 0, sizeof(struct i2c_board_info)); memset(&btv->init_data, 0, sizeof(btv->init_data)); - strlcpy(info.type, "ir_video", I2C_NAME_SIZE); + strscpy(info.type, "ir_video", I2C_NAME_SIZE); switch (btv->c.type) { case BTTV_BOARD_PV951: @@ -395,7 +386,7 @@ if (btv->init_data.name) { info.platform_data = &btv->init_data; - i2c_dev = i2c_new_device(&btv->c.i2c_adap, &info); + i2c_dev = i2c_new_client_device(&btv->c.i2c_adap, &info); } else { /* * The external IR receiver is at i2c address 0x34 (0x35 for @@ -405,9 +396,9 @@ * internal. * That's why we probe 0x1a (~0x34) first. CB */ - i2c_dev = i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list, NULL); + i2c_dev = i2c_new_scanned_device(&btv->c.i2c_adap, &info, addr_list, NULL); } - if (NULL == i2c_dev) + if (IS_ERR(i2c_dev)) return; #if defined(CONFIG_MODULES) && defined(MODULE) -- Gitblit v1.6.2