| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | | - * |
|---|
| 3 | 3 | * |
|---|
| 4 | 4 | * Copyright (C) 2005 Mike Isely <isely@pobox.com> |
|---|
| 5 | 5 | * 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 | | - * |
|---|
| 16 | 6 | */ |
|---|
| 17 | 7 | |
|---|
| 18 | 8 | #include <linux/slab.h> |
|---|
| .. | .. |
|---|
| 49 | 39 | int ret; |
|---|
| 50 | 40 | int mode16 = 0; |
|---|
| 51 | 41 | unsigned pcnt,tcnt; |
|---|
| 52 | | - eeprom = kmalloc(EEPROM_SIZE,GFP_KERNEL); |
|---|
| 42 | + eeprom = kzalloc(EEPROM_SIZE, GFP_KERNEL); |
|---|
| 53 | 43 | if (!eeprom) { |
|---|
| 54 | 44 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, |
|---|
| 55 | 45 | "Failed to allocate memory required to read eeprom"); |
|---|
| .. | .. |
|---|
| 84 | 74 | (1) we're only fetching part of the eeprom, and (2) if we were |
|---|
| 85 | 75 | getting the whole thing our I2C driver can't grab it in one |
|---|
| 86 | 76 | pass - which is what tveeprom is otherwise going to attempt */ |
|---|
| 87 | | - memset(eeprom,0,EEPROM_SIZE); |
|---|
| 88 | 77 | for (tcnt = 0; tcnt < EEPROM_SIZE; tcnt += pcnt) { |
|---|
| 89 | 78 | pcnt = 16; |
|---|
| 90 | 79 | if (pcnt + tcnt > EEPROM_SIZE) pcnt = EEPROM_SIZE-tcnt; |
|---|