forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/media/usb/pvrusb2/pvrusb2-eeprom.c
....@@ -1,18 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
2
- *
33 *
44 * Copyright (C) 2005 Mike Isely <isely@pobox.com>
55 * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr>
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; either version 2 of the License
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
- *
166 */
177
188 #include <linux/slab.h>
....@@ -49,7 +39,7 @@
4939 int ret;
5040 int mode16 = 0;
5141 unsigned pcnt,tcnt;
52
- eeprom = kmalloc(EEPROM_SIZE,GFP_KERNEL);
42
+ eeprom = kzalloc(EEPROM_SIZE, GFP_KERNEL);
5343 if (!eeprom) {
5444 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
5545 "Failed to allocate memory required to read eeprom");
....@@ -84,7 +74,6 @@
8474 (1) we're only fetching part of the eeprom, and (2) if we were
8575 getting the whole thing our I2C driver can't grab it in one
8676 pass - which is what tveeprom is otherwise going to attempt */
87
- memset(eeprom,0,EEPROM_SIZE);
8877 for (tcnt = 0; tcnt < EEPROM_SIZE; tcnt += pcnt) {
8978 pcnt = 16;
9079 if (pcnt + tcnt > EEPROM_SIZE) pcnt = EEPROM_SIZE-tcnt;