Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7eac97d7 authored by Lad, Prabhakar's avatar Lad, Prabhakar Committed by Mauro Carvalho Chehab
Browse files

[media] media: pci: remove duplicate checks for EPERM



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: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 625b3522
Loading
Loading
Loading
Loading
+0 −6
Original line number Original line Diff line number Diff line
@@ -1936,9 +1936,6 @@ static int bttv_g_register(struct file *file, void *f,
	struct bttv_fh *fh = f;
	struct bttv_fh *fh = f;
	struct bttv *btv = fh->btv;
	struct bttv *btv = fh->btv;


	if (!capable(CAP_SYS_ADMIN))
		return -EPERM;

	if (!v4l2_chip_match_host(&reg->match)) {
	if (!v4l2_chip_match_host(&reg->match)) {
		/* TODO: subdev errors should not be ignored, this should become a
		/* TODO: subdev errors should not be ignored, this should become a
		   subdev helper function. */
		   subdev helper function. */
@@ -1960,9 +1957,6 @@ static int bttv_s_register(struct file *file, void *f,
	struct bttv_fh *fh = f;
	struct bttv_fh *fh = f;
	struct bttv *btv = fh->btv;
	struct bttv *btv = fh->btv;


	if (!capable(CAP_SYS_ADMIN))
		return -EPERM;

	if (!v4l2_chip_match_host(&reg->match)) {
	if (!v4l2_chip_match_host(&reg->match)) {
		/* TODO: subdev errors should not be ignored, this should become a
		/* TODO: subdev errors should not be ignored, this should become a
		   subdev helper function. */
		   subdev helper function. */
+0 −4
Original line number Original line Diff line number Diff line
@@ -1258,8 +1258,6 @@ static int cx18_av_g_register(struct v4l2_subdev *sd,
		return -EINVAL;
		return -EINVAL;
	if ((reg->reg & 0x3) != 0)
	if ((reg->reg & 0x3) != 0)
		return -EINVAL;
		return -EINVAL;
	if (!capable(CAP_SYS_ADMIN))
		return -EPERM;
	reg->size = 4;
	reg->size = 4;
	reg->val = cx18_av_read4(cx, reg->reg & 0x00000ffc);
	reg->val = cx18_av_read4(cx, reg->reg & 0x00000ffc);
	return 0;
	return 0;
@@ -1274,8 +1272,6 @@ static int cx18_av_s_register(struct v4l2_subdev *sd,
		return -EINVAL;
		return -EINVAL;
	if ((reg->reg & 0x3) != 0)
	if ((reg->reg & 0x3) != 0)
		return -EINVAL;
		return -EINVAL;
	if (!capable(CAP_SYS_ADMIN))
		return -EPERM;
	cx18_av_write4(cx, reg->reg & 0x00000ffc, reg->val);
	cx18_av_write4(cx, reg->reg & 0x00000ffc, reg->val);
	return 0;
	return 0;
}
}
+0 −6
Original line number Original line Diff line number Diff line
@@ -138,9 +138,6 @@ int cx23885_g_register(struct file *file, void *fh,
{
{
	struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev;
	struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev;


	if (!capable(CAP_SYS_ADMIN))
		return -EPERM;

	if (reg->match.type == V4L2_CHIP_MATCH_HOST) {
	if (reg->match.type == V4L2_CHIP_MATCH_HOST) {
		switch (reg->match.addr) {
		switch (reg->match.addr) {
		case 0:
		case 0:
@@ -186,9 +183,6 @@ int cx23885_s_register(struct file *file, void *fh,
{
{
	struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev;
	struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev;


	if (!capable(CAP_SYS_ADMIN))
		return -EPERM;

	if (reg->match.type == V4L2_CHIP_MATCH_HOST) {
	if (reg->match.type == V4L2_CHIP_MATCH_HOST) {
		switch (reg->match.addr) {
		switch (reg->match.addr) {
		case 0:
		case 0:
+0 −4
Original line number Original line Diff line number Diff line
@@ -1116,8 +1116,6 @@ static int cx23888_ir_g_register(struct v4l2_subdev *sd,
		return -EINVAL;
		return -EINVAL;
	if (addr < CX23888_IR_CNTRL_REG || addr > CX23888_IR_LEARN_REG)
	if (addr < CX23888_IR_CNTRL_REG || addr > CX23888_IR_LEARN_REG)
		return -EINVAL;
		return -EINVAL;
	if (!capable(CAP_SYS_ADMIN))
		return -EPERM;
	reg->size = 4;
	reg->size = 4;
	reg->val = cx23888_ir_read4(state->dev, addr);
	reg->val = cx23888_ir_read4(state->dev, addr);
	return 0;
	return 0;
@@ -1135,8 +1133,6 @@ static int cx23888_ir_s_register(struct v4l2_subdev *sd,
		return -EINVAL;
		return -EINVAL;
	if (addr < CX23888_IR_CNTRL_REG || addr > CX23888_IR_LEARN_REG)
	if (addr < CX23888_IR_CNTRL_REG || addr > CX23888_IR_LEARN_REG)
		return -EINVAL;
		return -EINVAL;
	if (!capable(CAP_SYS_ADMIN))
		return -EPERM;
	cx23888_ir_write4(state->dev, addr, reg->val);
	cx23888_ir_write4(state->dev, addr, reg->val);
	return 0;
	return 0;
}
}
+0 −2
Original line number Original line Diff line number Diff line
@@ -715,8 +715,6 @@ static int ivtv_itvc(struct ivtv *itv, bool get, u64 reg, u64 *val)
{
{
	volatile u8 __iomem *reg_start;
	volatile u8 __iomem *reg_start;


	if (!capable(CAP_SYS_ADMIN))
		return -EPERM;
	if (reg >= IVTV_REG_OFFSET && reg < IVTV_REG_OFFSET + IVTV_REG_SIZE)
	if (reg >= IVTV_REG_OFFSET && reg < IVTV_REG_OFFSET + IVTV_REG_SIZE)
		reg_start = itv->reg_mem - IVTV_REG_OFFSET;
		reg_start = itv->reg_mem - IVTV_REG_OFFSET;
	else if (itv->has_cx23415 && reg >= IVTV_DECODER_OFFSET &&
	else if (itv->has_cx23415 && reg >= IVTV_DECODER_OFFSET &&
Loading