| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | i2c-dev.c - i2c-bus driver, char device interface |
|---|
| 3 | 4 | |
|---|
| .. | .. |
|---|
| 5 | 6 | Copyright (C) 1998-99 Frodo Looijaard <frodol@dds.nl> |
|---|
| 6 | 7 | Copyright (C) 2003 Greg Kroah-Hartman <greg@kroah.com> |
|---|
| 7 | 8 | |
|---|
| 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. |
|---|
| 17 | 9 | */ |
|---|
| 18 | 10 | |
|---|
| 19 | 11 | /* Note that this is a complete rewrite of Simon Vogl's i2c-dev module. |
|---|
| .. | .. |
|---|
| 23 | 15 | /* The I2C_RDWR ioctl code is written by Kolja Waschk <waschk@telos.de> */ |
|---|
| 24 | 16 | |
|---|
| 25 | 17 | #include <linux/cdev.h> |
|---|
| 18 | +#include <linux/compat.h> |
|---|
| 26 | 19 | #include <linux/device.h> |
|---|
| 27 | 20 | #include <linux/fs.h> |
|---|
| 28 | 21 | #include <linux/i2c-dev.h> |
|---|
| .. | .. |
|---|
| 35 | 28 | #include <linux/notifier.h> |
|---|
| 36 | 29 | #include <linux/slab.h> |
|---|
| 37 | 30 | #include <linux/uaccess.h> |
|---|
| 38 | | -#include <linux/compat.h> |
|---|
| 39 | 31 | |
|---|
| 40 | 32 | /* |
|---|
| 41 | 33 | * An i2c_dev represents an i2c_adapter ... an I2C or SMBus master, not a |
|---|
| .. | .. |
|---|
| 52 | 44 | struct cdev cdev; |
|---|
| 53 | 45 | }; |
|---|
| 54 | 46 | |
|---|
| 55 | | -#define I2C_MINORS MINORMASK |
|---|
| 47 | +#define I2C_MINORS (MINORMASK + 1) |
|---|
| 56 | 48 | static LIST_HEAD(i2c_dev_list); |
|---|
| 57 | 49 | static DEFINE_SPINLOCK(i2c_dev_list_lock); |
|---|
| 58 | 50 | |
|---|
| .. | .. |
|---|
| 778 | 770 | unregister_chrdev_region(MKDEV(I2C_MAJOR, 0), I2C_MINORS); |
|---|
| 779 | 771 | } |
|---|
| 780 | 772 | |
|---|
| 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>"); |
|---|
| 783 | 775 | MODULE_DESCRIPTION("I2C /dev entries driver"); |
|---|
| 784 | 776 | MODULE_LICENSE("GPL"); |
|---|
| 785 | 777 | |
|---|