diff options
author | Lad, Prabhakar <prabhakar.csengg@gmail.com> | 2013-05-14 00:45:14 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-05-27 08:34:06 -0400 |
commit | 7e89bd9f242930371f89f3d8c32eaf42ea1c74b1 (patch) | |
tree | 79c5b37e75aa14ca5e30e54eb26703f3640358ce /drivers | |
parent | 39cc029f9c74a9917560c51f1b5dd2ed8c4ede8a (diff) |
[media] media: i2c: remove duplicate checks for EPERM in dbg_g/s_register
This patch removes check for EPERM in dbg_g/s_register of subdevice
drivers as this check is already performed by core.
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/i2c/ad9389b.c | 4 | ||||
-rw-r--r-- | drivers/media/i2c/adv7183.c | 4 | ||||
-rw-r--r-- | drivers/media/i2c/adv7604.c | 4 | ||||
-rw-r--r-- | drivers/media/i2c/cs5345.c | 4 | ||||
-rw-r--r-- | drivers/media/i2c/cx25840/cx25840-core.c | 4 | ||||
-rw-r--r-- | drivers/media/i2c/m52790.c | 4 | ||||
-rw-r--r-- | drivers/media/i2c/mt9v011.c | 4 | ||||
-rw-r--r-- | drivers/media/i2c/ov7670.c | 4 | ||||
-rw-r--r-- | drivers/media/i2c/saa7115.c | 4 | ||||
-rw-r--r-- | drivers/media/i2c/saa7127.c | 4 | ||||
-rw-r--r-- | drivers/media/i2c/saa717x.c | 4 | ||||
-rw-r--r-- | drivers/media/i2c/ths7303.c | 4 | ||||
-rw-r--r-- | drivers/media/i2c/tvp5150.c | 4 | ||||
-rw-r--r-- | drivers/media/i2c/tvp7002.c | 10 | ||||
-rw-r--r-- | drivers/media/i2c/upd64031a.c | 4 | ||||
-rw-r--r-- | drivers/media/i2c/upd64083.c | 4 | ||||
-rw-r--r-- | drivers/media/i2c/vs6624.c | 4 |
17 files changed, 2 insertions, 72 deletions
diff --git a/drivers/media/i2c/ad9389b.c b/drivers/media/i2c/ad9389b.c index 1d4e4e70e8f8..ade1fec7e040 100644 --- a/drivers/media/i2c/ad9389b.c +++ b/drivers/media/i2c/ad9389b.c | |||
@@ -347,8 +347,6 @@ static int ad9389b_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * | |||
347 | 347 | ||
348 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 348 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
349 | return -EINVAL; | 349 | return -EINVAL; |
350 | if (!capable(CAP_SYS_ADMIN)) | ||
351 | return -EPERM; | ||
352 | reg->val = ad9389b_rd(sd, reg->reg & 0xff); | 350 | reg->val = ad9389b_rd(sd, reg->reg & 0xff); |
353 | reg->size = 1; | 351 | reg->size = 1; |
354 | return 0; | 352 | return 0; |
@@ -360,8 +358,6 @@ static int ad9389b_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regi | |||
360 | 358 | ||
361 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 359 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
362 | return -EINVAL; | 360 | return -EINVAL; |
363 | if (!capable(CAP_SYS_ADMIN)) | ||
364 | return -EPERM; | ||
365 | ad9389b_wr(sd, reg->reg & 0xff, reg->val & 0xff); | 361 | ad9389b_wr(sd, reg->reg & 0xff, reg->val & 0xff); |
366 | return 0; | 362 | return 0; |
367 | } | 363 | } |
diff --git a/drivers/media/i2c/adv7183.c b/drivers/media/i2c/adv7183.c index 42b2dec4ca3a..7c48e22b41a2 100644 --- a/drivers/media/i2c/adv7183.c +++ b/drivers/media/i2c/adv7183.c | |||
@@ -500,8 +500,6 @@ static int adv7183_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * | |||
500 | 500 | ||
501 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 501 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
502 | return -EINVAL; | 502 | return -EINVAL; |
503 | if (!capable(CAP_SYS_ADMIN)) | ||
504 | return -EPERM; | ||
505 | reg->val = adv7183_read(sd, reg->reg & 0xff); | 503 | reg->val = adv7183_read(sd, reg->reg & 0xff); |
506 | reg->size = 1; | 504 | reg->size = 1; |
507 | return 0; | 505 | return 0; |
@@ -513,8 +511,6 @@ static int adv7183_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regi | |||
513 | 511 | ||
514 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 512 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
515 | return -EINVAL; | 513 | return -EINVAL; |
516 | if (!capable(CAP_SYS_ADMIN)) | ||
517 | return -EPERM; | ||
518 | adv7183_write(sd, reg->reg & 0xff, reg->val & 0xff); | 514 | adv7183_write(sd, reg->reg & 0xff, reg->val & 0xff); |
519 | return 0; | 515 | return 0; |
520 | } | 516 | } |
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index 4cdcfc96aa56..5528cd15cc67 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c | |||
@@ -647,8 +647,6 @@ static int adv7604_g_register(struct v4l2_subdev *sd, | |||
647 | 647 | ||
648 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 648 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
649 | return -EINVAL; | 649 | return -EINVAL; |
650 | if (!capable(CAP_SYS_ADMIN)) | ||
651 | return -EPERM; | ||
652 | reg->size = 1; | 650 | reg->size = 1; |
653 | switch (reg->reg >> 8) { | 651 | switch (reg->reg >> 8) { |
654 | case 0: | 652 | case 0: |
@@ -705,8 +703,6 @@ static int adv7604_s_register(struct v4l2_subdev *sd, | |||
705 | 703 | ||
706 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 704 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
707 | return -EINVAL; | 705 | return -EINVAL; |
708 | if (!capable(CAP_SYS_ADMIN)) | ||
709 | return -EPERM; | ||
710 | switch (reg->reg >> 8) { | 706 | switch (reg->reg >> 8) { |
711 | case 0: | 707 | case 0: |
712 | io_write(sd, reg->reg & 0xff, reg->val & 0xff); | 708 | io_write(sd, reg->reg & 0xff, reg->val & 0xff); |
diff --git a/drivers/media/i2c/cs5345.c b/drivers/media/i2c/cs5345.c index 841b9c49dcfa..2661757c3a8c 100644 --- a/drivers/media/i2c/cs5345.c +++ b/drivers/media/i2c/cs5345.c | |||
@@ -103,8 +103,6 @@ static int cs5345_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r | |||
103 | 103 | ||
104 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 104 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
105 | return -EINVAL; | 105 | return -EINVAL; |
106 | if (!capable(CAP_SYS_ADMIN)) | ||
107 | return -EPERM; | ||
108 | reg->size = 1; | 106 | reg->size = 1; |
109 | reg->val = cs5345_read(sd, reg->reg & 0x1f); | 107 | reg->val = cs5345_read(sd, reg->reg & 0x1f); |
110 | return 0; | 108 | return 0; |
@@ -116,8 +114,6 @@ static int cs5345_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regis | |||
116 | 114 | ||
117 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 115 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
118 | return -EINVAL; | 116 | return -EINVAL; |
119 | if (!capable(CAP_SYS_ADMIN)) | ||
120 | return -EPERM; | ||
121 | cs5345_write(sd, reg->reg & 0x1f, reg->val & 0xff); | 117 | cs5345_write(sd, reg->reg & 0x1f, reg->val & 0xff); |
122 | return 0; | 118 | return 0; |
123 | } | 119 | } |
diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c index bdfec4c768fe..b81e32f371ae 100644 --- a/drivers/media/i2c/cx25840/cx25840-core.c +++ b/drivers/media/i2c/cx25840/cx25840-core.c | |||
@@ -1664,8 +1664,6 @@ static int cx25840_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * | |||
1664 | 1664 | ||
1665 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 1665 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
1666 | return -EINVAL; | 1666 | return -EINVAL; |
1667 | if (!capable(CAP_SYS_ADMIN)) | ||
1668 | return -EPERM; | ||
1669 | reg->size = 1; | 1667 | reg->size = 1; |
1670 | reg->val = cx25840_read(client, reg->reg & 0x0fff); | 1668 | reg->val = cx25840_read(client, reg->reg & 0x0fff); |
1671 | return 0; | 1669 | return 0; |
@@ -1677,8 +1675,6 @@ static int cx25840_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regi | |||
1677 | 1675 | ||
1678 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 1676 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
1679 | return -EINVAL; | 1677 | return -EINVAL; |
1680 | if (!capable(CAP_SYS_ADMIN)) | ||
1681 | return -EPERM; | ||
1682 | cx25840_write(client, reg->reg & 0x0fff, reg->val & 0xff); | 1678 | cx25840_write(client, reg->reg & 0x0fff, reg->val & 0xff); |
1683 | return 0; | 1679 | return 0; |
1684 | } | 1680 | } |
diff --git a/drivers/media/i2c/m52790.c b/drivers/media/i2c/m52790.c index 0d153f3b1a5b..3eeb546be6d9 100644 --- a/drivers/media/i2c/m52790.c +++ b/drivers/media/i2c/m52790.c | |||
@@ -87,8 +87,6 @@ static int m52790_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r | |||
87 | 87 | ||
88 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 88 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
89 | return -EINVAL; | 89 | return -EINVAL; |
90 | if (!capable(CAP_SYS_ADMIN)) | ||
91 | return -EPERM; | ||
92 | if (reg->reg != 0) | 90 | if (reg->reg != 0) |
93 | return -EINVAL; | 91 | return -EINVAL; |
94 | reg->size = 1; | 92 | reg->size = 1; |
@@ -103,8 +101,6 @@ static int m52790_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regis | |||
103 | 101 | ||
104 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 102 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
105 | return -EINVAL; | 103 | return -EINVAL; |
106 | if (!capable(CAP_SYS_ADMIN)) | ||
107 | return -EPERM; | ||
108 | if (reg->reg != 0) | 104 | if (reg->reg != 0) |
109 | return -EINVAL; | 105 | return -EINVAL; |
110 | state->input = reg->val & 0x0303; | 106 | state->input = reg->val & 0x0303; |
diff --git a/drivers/media/i2c/mt9v011.c b/drivers/media/i2c/mt9v011.c index c64c9d9e253d..141919bf77fc 100644 --- a/drivers/media/i2c/mt9v011.c +++ b/drivers/media/i2c/mt9v011.c | |||
@@ -411,8 +411,6 @@ static int mt9v011_g_register(struct v4l2_subdev *sd, | |||
411 | 411 | ||
412 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 412 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
413 | return -EINVAL; | 413 | return -EINVAL; |
414 | if (!capable(CAP_SYS_ADMIN)) | ||
415 | return -EPERM; | ||
416 | 414 | ||
417 | reg->val = mt9v011_read(sd, reg->reg & 0xff); | 415 | reg->val = mt9v011_read(sd, reg->reg & 0xff); |
418 | reg->size = 2; | 416 | reg->size = 2; |
@@ -427,8 +425,6 @@ static int mt9v011_s_register(struct v4l2_subdev *sd, | |||
427 | 425 | ||
428 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 426 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
429 | return -EINVAL; | 427 | return -EINVAL; |
430 | if (!capable(CAP_SYS_ADMIN)) | ||
431 | return -EPERM; | ||
432 | 428 | ||
433 | mt9v011_write(sd, reg->reg & 0xff, reg->val & 0xffff); | 429 | mt9v011_write(sd, reg->reg & 0xff, reg->val & 0xffff); |
434 | 430 | ||
diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c index d71602f4fb43..b030279810d3 100644 --- a/drivers/media/i2c/ov7670.c +++ b/drivers/media/i2c/ov7670.c | |||
@@ -1479,8 +1479,6 @@ static int ov7670_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r | |||
1479 | 1479 | ||
1480 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 1480 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
1481 | return -EINVAL; | 1481 | return -EINVAL; |
1482 | if (!capable(CAP_SYS_ADMIN)) | ||
1483 | return -EPERM; | ||
1484 | ret = ov7670_read(sd, reg->reg & 0xff, &val); | 1482 | ret = ov7670_read(sd, reg->reg & 0xff, &val); |
1485 | reg->val = val; | 1483 | reg->val = val; |
1486 | reg->size = 1; | 1484 | reg->size = 1; |
@@ -1493,8 +1491,6 @@ static int ov7670_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regis | |||
1493 | 1491 | ||
1494 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 1492 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
1495 | return -EINVAL; | 1493 | return -EINVAL; |
1496 | if (!capable(CAP_SYS_ADMIN)) | ||
1497 | return -EPERM; | ||
1498 | ov7670_write(sd, reg->reg & 0xff, reg->val & 0xff); | 1494 | ov7670_write(sd, reg->reg & 0xff, reg->val & 0xff); |
1499 | return 0; | 1495 | return 0; |
1500 | } | 1496 | } |
diff --git a/drivers/media/i2c/saa7115.c b/drivers/media/i2c/saa7115.c index 8316ae448f4c..18cf0bfaf743 100644 --- a/drivers/media/i2c/saa7115.c +++ b/drivers/media/i2c/saa7115.c | |||
@@ -1464,8 +1464,6 @@ static int saa711x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * | |||
1464 | 1464 | ||
1465 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 1465 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
1466 | return -EINVAL; | 1466 | return -EINVAL; |
1467 | if (!capable(CAP_SYS_ADMIN)) | ||
1468 | return -EPERM; | ||
1469 | reg->val = saa711x_read(sd, reg->reg & 0xff); | 1467 | reg->val = saa711x_read(sd, reg->reg & 0xff); |
1470 | reg->size = 1; | 1468 | reg->size = 1; |
1471 | return 0; | 1469 | return 0; |
@@ -1477,8 +1475,6 @@ static int saa711x_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regi | |||
1477 | 1475 | ||
1478 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 1476 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
1479 | return -EINVAL; | 1477 | return -EINVAL; |
1480 | if (!capable(CAP_SYS_ADMIN)) | ||
1481 | return -EPERM; | ||
1482 | saa711x_write(sd, reg->reg & 0xff, reg->val & 0xff); | 1478 | saa711x_write(sd, reg->reg & 0xff, reg->val & 0xff); |
1483 | return 0; | 1479 | return 0; |
1484 | } | 1480 | } |
diff --git a/drivers/media/i2c/saa7127.c b/drivers/media/i2c/saa7127.c index 9882c83c1c93..d9c388103e7a 100644 --- a/drivers/media/i2c/saa7127.c +++ b/drivers/media/i2c/saa7127.c | |||
@@ -665,8 +665,6 @@ static int saa7127_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * | |||
665 | 665 | ||
666 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 666 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
667 | return -EINVAL; | 667 | return -EINVAL; |
668 | if (!capable(CAP_SYS_ADMIN)) | ||
669 | return -EPERM; | ||
670 | reg->val = saa7127_read(sd, reg->reg & 0xff); | 668 | reg->val = saa7127_read(sd, reg->reg & 0xff); |
671 | reg->size = 1; | 669 | reg->size = 1; |
672 | return 0; | 670 | return 0; |
@@ -678,8 +676,6 @@ static int saa7127_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regi | |||
678 | 676 | ||
679 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 677 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
680 | return -EINVAL; | 678 | return -EINVAL; |
681 | if (!capable(CAP_SYS_ADMIN)) | ||
682 | return -EPERM; | ||
683 | saa7127_write(sd, reg->reg & 0xff, reg->val & 0xff); | 679 | saa7127_write(sd, reg->reg & 0xff, reg->val & 0xff); |
684 | return 0; | 680 | return 0; |
685 | } | 681 | } |
diff --git a/drivers/media/i2c/saa717x.c b/drivers/media/i2c/saa717x.c index 71328109642e..330a04c58939 100644 --- a/drivers/media/i2c/saa717x.c +++ b/drivers/media/i2c/saa717x.c | |||
@@ -981,8 +981,6 @@ static int saa717x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * | |||
981 | 981 | ||
982 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 982 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
983 | return -EINVAL; | 983 | return -EINVAL; |
984 | if (!capable(CAP_SYS_ADMIN)) | ||
985 | return -EPERM; | ||
986 | reg->val = saa717x_read(sd, reg->reg); | 984 | reg->val = saa717x_read(sd, reg->reg); |
987 | reg->size = 1; | 985 | reg->size = 1; |
988 | return 0; | 986 | return 0; |
@@ -996,8 +994,6 @@ static int saa717x_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regi | |||
996 | 994 | ||
997 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 995 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
998 | return -EINVAL; | 996 | return -EINVAL; |
999 | if (!capable(CAP_SYS_ADMIN)) | ||
1000 | return -EPERM; | ||
1001 | saa717x_write(sd, addr, val); | 997 | saa717x_write(sd, addr, val); |
1002 | return 0; | 998 | return 0; |
1003 | } | 999 | } |
diff --git a/drivers/media/i2c/ths7303.c b/drivers/media/i2c/ths7303.c index c4339556a2ea..65853eea09a1 100644 --- a/drivers/media/i2c/ths7303.c +++ b/drivers/media/i2c/ths7303.c | |||
@@ -236,8 +236,6 @@ static int ths7303_g_register(struct v4l2_subdev *sd, | |||
236 | 236 | ||
237 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 237 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
238 | return -EINVAL; | 238 | return -EINVAL; |
239 | if (!capable(CAP_SYS_ADMIN)) | ||
240 | return -EPERM; | ||
241 | 239 | ||
242 | reg->size = 1; | 240 | reg->size = 1; |
243 | reg->val = ths7303_read(sd, reg->reg); | 241 | reg->val = ths7303_read(sd, reg->reg); |
@@ -251,8 +249,6 @@ static int ths7303_s_register(struct v4l2_subdev *sd, | |||
251 | 249 | ||
252 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 250 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
253 | return -EINVAL; | 251 | return -EINVAL; |
254 | if (!capable(CAP_SYS_ADMIN)) | ||
255 | return -EPERM; | ||
256 | 252 | ||
257 | ths7303_write(sd, reg->reg, reg->val); | 253 | ths7303_write(sd, reg->reg, reg->val); |
258 | return 0; | 254 | return 0; |
diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c index de9db3bf1ebd..b3cf26628c09 100644 --- a/drivers/media/i2c/tvp5150.c +++ b/drivers/media/i2c/tvp5150.c | |||
@@ -1054,8 +1054,6 @@ static int tvp5150_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * | |||
1054 | 1054 | ||
1055 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 1055 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
1056 | return -EINVAL; | 1056 | return -EINVAL; |
1057 | if (!capable(CAP_SYS_ADMIN)) | ||
1058 | return -EPERM; | ||
1059 | res = tvp5150_read(sd, reg->reg & 0xff); | 1057 | res = tvp5150_read(sd, reg->reg & 0xff); |
1060 | if (res < 0) { | 1058 | if (res < 0) { |
1061 | v4l2_err(sd, "%s: failed with error = %d\n", __func__, res); | 1059 | v4l2_err(sd, "%s: failed with error = %d\n", __func__, res); |
@@ -1073,8 +1071,6 @@ static int tvp5150_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regi | |||
1073 | 1071 | ||
1074 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 1072 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
1075 | return -EINVAL; | 1073 | return -EINVAL; |
1076 | if (!capable(CAP_SYS_ADMIN)) | ||
1077 | return -EPERM; | ||
1078 | tvp5150_write(sd, reg->reg & 0xff, reg->val & 0xff); | 1074 | tvp5150_write(sd, reg->reg & 0xff, reg->val & 0xff); |
1079 | return 0; | 1075 | return 0; |
1080 | } | 1076 | } |
diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c index 81b4eb40d7a6..f339e6faca90 100644 --- a/drivers/media/i2c/tvp7002.c +++ b/drivers/media/i2c/tvp7002.c | |||
@@ -736,8 +736,7 @@ static int tvp7002_query_dv_timings(struct v4l2_subdev *sd, | |||
736 | * | 736 | * |
737 | * Get the value of a TVP7002 decoder device register. | 737 | * Get the value of a TVP7002 decoder device register. |
738 | * Returns zero when successful, -EINVAL if register read fails or | 738 | * Returns zero when successful, -EINVAL if register read fails or |
739 | * access to I2C client fails, -EPERM if the call is not allowed | 739 | * access to I2C client fails. |
740 | * by disabled CAP_SYS_ADMIN. | ||
741 | */ | 740 | */ |
742 | static int tvp7002_g_register(struct v4l2_subdev *sd, | 741 | static int tvp7002_g_register(struct v4l2_subdev *sd, |
743 | struct v4l2_dbg_register *reg) | 742 | struct v4l2_dbg_register *reg) |
@@ -748,8 +747,6 @@ static int tvp7002_g_register(struct v4l2_subdev *sd, | |||
748 | 747 | ||
749 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 748 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
750 | return -EINVAL; | 749 | return -EINVAL; |
751 | if (!capable(CAP_SYS_ADMIN)) | ||
752 | return -EPERM; | ||
753 | 750 | ||
754 | ret = tvp7002_read(sd, reg->reg & 0xff, &val); | 751 | ret = tvp7002_read(sd, reg->reg & 0xff, &val); |
755 | reg->val = val; | 752 | reg->val = val; |
@@ -762,8 +759,7 @@ static int tvp7002_g_register(struct v4l2_subdev *sd, | |||
762 | * @reg: ptr to v4l2_dbg_register struct | 759 | * @reg: ptr to v4l2_dbg_register struct |
763 | * | 760 | * |
764 | * Get the value of a TVP7002 decoder device register. | 761 | * Get the value of a TVP7002 decoder device register. |
765 | * Returns zero when successful, -EINVAL if register read fails or | 762 | * Returns zero when successful, -EINVAL if register read fails. |
766 | * -EPERM if call not allowed. | ||
767 | */ | 763 | */ |
768 | static int tvp7002_s_register(struct v4l2_subdev *sd, | 764 | static int tvp7002_s_register(struct v4l2_subdev *sd, |
769 | const struct v4l2_dbg_register *reg) | 765 | const struct v4l2_dbg_register *reg) |
@@ -772,8 +768,6 @@ static int tvp7002_s_register(struct v4l2_subdev *sd, | |||
772 | 768 | ||
773 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 769 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
774 | return -EINVAL; | 770 | return -EINVAL; |
775 | if (!capable(CAP_SYS_ADMIN)) | ||
776 | return -EPERM; | ||
777 | 771 | ||
778 | return tvp7002_write(sd, reg->reg & 0xff, reg->val & 0xff); | 772 | return tvp7002_write(sd, reg->reg & 0xff, reg->val & 0xff); |
779 | } | 773 | } |
diff --git a/drivers/media/i2c/upd64031a.c b/drivers/media/i2c/upd64031a.c index 4283fc5f39ef..13a4cf8bebdf 100644 --- a/drivers/media/i2c/upd64031a.c +++ b/drivers/media/i2c/upd64031a.c | |||
@@ -168,8 +168,6 @@ static int upd64031a_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register | |||
168 | 168 | ||
169 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 169 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
170 | return -EINVAL; | 170 | return -EINVAL; |
171 | if (!capable(CAP_SYS_ADMIN)) | ||
172 | return -EPERM; | ||
173 | reg->val = upd64031a_read(sd, reg->reg & 0xff); | 171 | reg->val = upd64031a_read(sd, reg->reg & 0xff); |
174 | reg->size = 1; | 172 | reg->size = 1; |
175 | return 0; | 173 | return 0; |
@@ -181,8 +179,6 @@ static int upd64031a_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_re | |||
181 | 179 | ||
182 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 180 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
183 | return -EINVAL; | 181 | return -EINVAL; |
184 | if (!capable(CAP_SYS_ADMIN)) | ||
185 | return -EPERM; | ||
186 | upd64031a_write(sd, reg->reg & 0xff, reg->val & 0xff); | 182 | upd64031a_write(sd, reg->reg & 0xff, reg->val & 0xff); |
187 | return 0; | 183 | return 0; |
188 | } | 184 | } |
diff --git a/drivers/media/i2c/upd64083.c b/drivers/media/i2c/upd64083.c index b2ac56ca22e6..e296639ab90e 100644 --- a/drivers/media/i2c/upd64083.c +++ b/drivers/media/i2c/upd64083.c | |||
@@ -126,8 +126,6 @@ static int upd64083_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register | |||
126 | 126 | ||
127 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 127 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
128 | return -EINVAL; | 128 | return -EINVAL; |
129 | if (!capable(CAP_SYS_ADMIN)) | ||
130 | return -EPERM; | ||
131 | reg->val = upd64083_read(sd, reg->reg & 0xff); | 129 | reg->val = upd64083_read(sd, reg->reg & 0xff); |
132 | reg->size = 1; | 130 | reg->size = 1; |
133 | return 0; | 131 | return 0; |
@@ -139,8 +137,6 @@ static int upd64083_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_reg | |||
139 | 137 | ||
140 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 138 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
141 | return -EINVAL; | 139 | return -EINVAL; |
142 | if (!capable(CAP_SYS_ADMIN)) | ||
143 | return -EPERM; | ||
144 | upd64083_write(sd, reg->reg & 0xff, reg->val & 0xff); | 140 | upd64083_write(sd, reg->reg & 0xff, reg->val & 0xff); |
145 | return 0; | 141 | return 0; |
146 | } | 142 | } |
diff --git a/drivers/media/i2c/vs6624.c b/drivers/media/i2c/vs6624.c index 7b55b3ddd80f..d2209a35c510 100644 --- a/drivers/media/i2c/vs6624.c +++ b/drivers/media/i2c/vs6624.c | |||
@@ -741,8 +741,6 @@ static int vs6624_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *r | |||
741 | 741 | ||
742 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 742 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
743 | return -EINVAL; | 743 | return -EINVAL; |
744 | if (!capable(CAP_SYS_ADMIN)) | ||
745 | return -EPERM; | ||
746 | reg->val = vs6624_read(sd, reg->reg & 0xffff); | 744 | reg->val = vs6624_read(sd, reg->reg & 0xffff); |
747 | reg->size = 1; | 745 | reg->size = 1; |
748 | return 0; | 746 | return 0; |
@@ -754,8 +752,6 @@ static int vs6624_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_regis | |||
754 | 752 | ||
755 | if (!v4l2_chip_match_i2c_client(client, ®->match)) | 753 | if (!v4l2_chip_match_i2c_client(client, ®->match)) |
756 | return -EINVAL; | 754 | return -EINVAL; |
757 | if (!capable(CAP_SYS_ADMIN)) | ||
758 | return -EPERM; | ||
759 | vs6624_write(sd, reg->reg & 0xffff, reg->val & 0xff); | 755 | vs6624_write(sd, reg->reg & 0xffff, reg->val & 0xff); |
760 | return 0; | 756 | return 0; |
761 | } | 757 | } |