forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/misc/eeprom/eeprom.c
....@@ -1,19 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) 1998, 1999 Frodo Looijaard <frodol@dds.nl> and
34 * Philip Edelbrock <phil@netroedge.com>
45 * Copyright (C) 2003 Greg Kroah-Hartman <greg@kroah.com>
56 * Copyright (C) 2003 IBM Corp.
67 * Copyright (C) 2004 Jean Delvare <jdelvare@suse.de>
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation; either version 2 of the License, or
11
- * (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
178 */
189
1910 #include <linux/kernel.h>
....@@ -85,7 +76,7 @@
8576 struct bin_attribute *bin_attr,
8677 char *buf, loff_t off, size_t count)
8778 {
88
- struct i2c_client *client = to_i2c_client(kobj_to_dev(kobj));
79
+ struct i2c_client *client = kobj_to_i2c_client(kobj);
8980 struct eeprom_data *data = i2c_get_clientdata(client);
9081 u8 slice;
9182
....@@ -184,6 +175,10 @@
184175 }
185176 }
186177
178
+ /* Let the users know they are using deprecated driver */
179
+ dev_notice(&client->dev,
180
+ "eeprom driver is deprecated, please use at24 instead\n");
181
+
187182 /* create the sysfs eeprom file */
188183 return sysfs_create_bin_file(&client->dev.kobj, &eeprom_attr);
189184 }