[media] media: pci: remove duplicate checks for EPERM
authorLad, Prabhakar <prabhakar.csengg@gmail.com>
Tue, 14 May 2013 04:45:17 +0000 (01:45 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 27 May 2013 12:34:56 +0000 (09:34 -0300)
This patch removes check for EPERM in dbg_g/s_register and
vidioc_g/s_register 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>
drivers/media/pci/bt8xx/bttv-driver.c
drivers/media/pci/cx18/cx18-av-core.c
drivers/media/pci/cx23885/cx23885-ioctl.c
drivers/media/pci/cx23885/cx23888-ir.c
drivers/media/pci/ivtv/ivtv-ioctl.c
drivers/media/pci/saa7146/mxb.c
drivers/media/pci/saa7164/saa7164-encoder.c

index e7d08841341141b67871d6916f570c76ea15fbec..a334c94a303d623759d38a112b04da6d888174f5 100644 (file)
@@ -1936,9 +1936,6 @@ static int bttv_g_register(struct file *file, void *f,
        struct bttv_fh *fh = f;
        struct bttv *btv = fh->btv;
 
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
-
        if (!v4l2_chip_match_host(&reg->match)) {
                /* TODO: subdev errors should not be ignored, this should become a
                   subdev helper function. */
@@ -1960,9 +1957,6 @@ static int bttv_s_register(struct file *file, void *f,
        struct bttv_fh *fh = f;
        struct bttv *btv = fh->btv;
 
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
-
        if (!v4l2_chip_match_host(&reg->match)) {
                /* TODO: subdev errors should not be ignored, this should become a
                   subdev helper function. */
index 38b1d64ffc27670a29078683f0630fa4031a6402..ba8caf0fbb858a752e8a3d099aa4303eccd01e90 100644 (file)
@@ -1258,8 +1258,6 @@ static int cx18_av_g_register(struct v4l2_subdev *sd,
                return -EINVAL;
        if ((reg->reg & 0x3) != 0)
                return -EINVAL;
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
        reg->size = 4;
        reg->val = cx18_av_read4(cx, reg->reg & 0x00000ffc);
        return 0;
@@ -1274,8 +1272,6 @@ static int cx18_av_s_register(struct v4l2_subdev *sd,
                return -EINVAL;
        if ((reg->reg & 0x3) != 0)
                return -EINVAL;
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
        cx18_av_write4(cx, reg->reg & 0x00000ffc, reg->val);
        return 0;
 }
index acdb6d58db5844494b6c47cbf861b15acf70937a..00f51251728b1fd4bd1796191f40b1b2f6d56db3 100644 (file)
@@ -138,9 +138,6 @@ int cx23885_g_register(struct file *file, void *fh,
 {
        struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev;
 
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
-
        if (reg->match.type == V4L2_CHIP_MATCH_HOST) {
                switch (reg->match.addr) {
                case 0:
@@ -186,9 +183,6 @@ int cx23885_s_register(struct file *file, void *fh,
 {
        struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev;
 
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
-
        if (reg->match.type == V4L2_CHIP_MATCH_HOST) {
                switch (reg->match.addr) {
                case 0:
index fa672fe410793568990bf36d0802e9c646932ff2..cd98651f3ae6603847cfd110d3170bcf6359daf3 100644 (file)
@@ -1116,8 +1116,6 @@ static int cx23888_ir_g_register(struct v4l2_subdev *sd,
                return -EINVAL;
        if (addr < CX23888_IR_CNTRL_REG || addr > CX23888_IR_LEARN_REG)
                return -EINVAL;
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
        reg->size = 4;
        reg->val = cx23888_ir_read4(state->dev, addr);
        return 0;
@@ -1135,8 +1133,6 @@ static int cx23888_ir_s_register(struct v4l2_subdev *sd,
                return -EINVAL;
        if (addr < CX23888_IR_CNTRL_REG || addr > CX23888_IR_LEARN_REG)
                return -EINVAL;
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
        cx23888_ir_write4(state->dev, addr, reg->val);
        return 0;
 }
index 9cbbce0eaedca38ac1cffcd0d5d723aa41699af4..3e281eccdd8813f6b2e620253691854103b70db6 100644 (file)
@@ -715,8 +715,6 @@ static int ivtv_itvc(struct ivtv *itv, bool get, u64 reg, u64 *val)
 {
        volatile u8 __iomem *reg_start;
 
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
        if (reg >= IVTV_REG_OFFSET && reg < IVTV_REG_OFFSET + IVTV_REG_SIZE)
                reg_start = itv->reg_mem - IVTV_REG_OFFSET;
        else if (itv->has_cx23415 && reg >= IVTV_DECODER_OFFSET &&
index 71e8bead321b25774f5699ac15cae6ec6cff9212..52cbe7a027ccad321a26e82670d23064b827dab1 100644 (file)
@@ -669,8 +669,6 @@ static int vidioc_g_register(struct file *file, void *fh, struct v4l2_dbg_regist
 {
        struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
 
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
        if (v4l2_chip_match_host(&reg->match)) {
                reg->val = saa7146_read(dev, reg->reg);
                reg->size = 4;
@@ -684,8 +682,6 @@ static int vidioc_s_register(struct file *file, void *fh, const struct v4l2_dbg_
 {
        struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
 
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
        if (v4l2_chip_match_host(&reg->match)) {
                saa7146_write(dev, reg->reg, reg->val);
                return 0;
index 0b74fb2300dda8c74a01f3e1b73f901c47207bfd..63a72fb71f30e2d2d1e909d028c59c92e8d60354 100644 (file)
@@ -1306,9 +1306,6 @@ static int saa7164_g_register(struct file *file, void *fh,
        struct saa7164_dev *dev = port->dev;
        dprintk(DBGLVL_ENC, "%s()\n", __func__);
 
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
-
        return 0;
 }
 
@@ -1319,9 +1316,6 @@ static int saa7164_s_register(struct file *file, void *fh,
        struct saa7164_dev *dev = port->dev;
        dprintk(DBGLVL_ENC, "%s()\n", __func__);
 
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
-
        return 0;
 }
 #endif