hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/i2c/i2c-dev.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 i2c-dev.c - i2c-bus driver, char device interface
34
....@@ -5,15 +6,6 @@
56 Copyright (C) 1998-99 Frodo Looijaard <frodol@dds.nl>
67 Copyright (C) 2003 Greg Kroah-Hartman <greg@kroah.com>
78
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.
179 */
1810
1911 /* Note that this is a complete rewrite of Simon Vogl's i2c-dev module.
....@@ -23,6 +15,7 @@
2315 /* The I2C_RDWR ioctl code is written by Kolja Waschk <waschk@telos.de> */
2416
2517 #include <linux/cdev.h>
18
+#include <linux/compat.h>
2619 #include <linux/device.h>
2720 #include <linux/fs.h>
2821 #include <linux/i2c-dev.h>
....@@ -35,7 +28,6 @@
3528 #include <linux/notifier.h>
3629 #include <linux/slab.h>
3730 #include <linux/uaccess.h>
38
-#include <linux/compat.h>
3931
4032 /*
4133 * An i2c_dev represents an i2c_adapter ... an I2C or SMBus master, not a
....@@ -52,7 +44,7 @@
5244 struct cdev cdev;
5345 };
5446
55
-#define I2C_MINORS MINORMASK
47
+#define I2C_MINORS (MINORMASK + 1)
5648 static LIST_HEAD(i2c_dev_list);
5749 static DEFINE_SPINLOCK(i2c_dev_list_lock);
5850
....@@ -778,8 +770,8 @@
778770 unregister_chrdev_region(MKDEV(I2C_MAJOR, 0), I2C_MINORS);
779771 }
780772
781
-MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl> and "
782
- "Simon G. Vogl <simon@tk.uni-linz.ac.at>");
773
+MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>");
774
+MODULE_AUTHOR("Simon G. Vogl <simon@tk.uni-linz.ac.at>");
783775 MODULE_DESCRIPTION("I2C /dev entries driver");
784776 MODULE_LICENSE("GPL");
785777