summaryrefslogtreecommitdiff
path: root/drivers/media/v4l2-core/v4l2-device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/v4l2-core/v4l2-device.c')
-rw-r--r--drivers/media/v4l2-core/v4l2-device.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/media/v4l2-core/v4l2-device.c b/drivers/media/v4l2-core/v4l2-device.c
index 06fa5f1b2cff..62bbed76dbbc 100644
--- a/drivers/media/v4l2-core/v4l2-device.c
+++ b/drivers/media/v4l2-core/v4l2-device.c
@@ -160,12 +160,9 @@ int v4l2_device_register_subdev(struct v4l2_device *v4l2_dev,
int err;
/* Check for valid input */
- if (v4l2_dev == NULL || sd == NULL || !sd->name[0])
+ if (!v4l2_dev || !sd || sd->v4l2_dev || !sd->name[0])
return -EINVAL;
- /* Warn if we apparently re-register a subdev */
- WARN_ON(sd->v4l2_dev != NULL);
-
/*
* The reason to acquire the module here is to avoid unloading
* a module of sub-device which is registered to a media