i2c: expand minor range when registering chrdev region

Message ID 20190212060657.9070-1-cgxu519@gmx.com
State Accepted
Headers show
Series
  • i2c: expand minor range when registering chrdev region
Related show

Commit Message

cgxu519 Feb. 12, 2019, 6:06 a.m.
Actually, total amount of available minor number
for a single major is MINORMARK + 1. So expand
minor range when registering chrdev region.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
 drivers/i2c/i2c-dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Wolfram Sang Feb. 15, 2019, 8:56 a.m. | #1
On Tue, Feb 12, 2019 at 02:06:57PM +0800, Chengguang Xu wrote:
> Actually, total amount of available minor number
> for a single major is MINORMARK + 1. So expand

True. But "MINORMASK" here. I fixed this when applying.

> minor range when registering chrdev region.
> 
> Signed-off-by: Chengguang Xu <cgxu519@gmx.com>

Applied to for-next, thanks!
cgxu519 Feb. 15, 2019, 11:28 a.m. | #2
On 2/15/19 4:56 PM, Wolfram Sang wrote:
> On Tue, Feb 12, 2019 at 02:06:57PM +0800, Chengguang Xu wrote:
>> Actually, total amount of available minor number
>> for a single major is MINORMARK + 1. So expand
> True. But "MINORMASK" here. I fixed this when applying.

Thanks for the fix.


>
>> minor range when registering chrdev region.
>>
>> Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
> Applied to for-next, thanks!
>

Patch

diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index ccd76c71af09..3f7b9af11137 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -52,7 +52,7 @@  struct i2c_dev {
 	struct cdev cdev;
 };
 
-#define I2C_MINORS	MINORMASK
+#define I2C_MINORS	(MINORMASK + 1)
 static LIST_HEAD(i2c_dev_list);
 static DEFINE_SPINLOCK(i2c_dev_list_lock);