summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-05-10 17:23:03 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-05-20 14:51:28 +0200
commita79afb97e0227f7224bbf2e0ee12f2a4f719cc0a (patch)
tree56230e130e201404bf5248374228cbf9d909f80b /drivers/staging
parent09d87466655d00526cf818b3f3b267884c591702 (diff)
downloadlinux-a79afb97e0227f7224bbf2e0ee12f2a4f719cc0a.tar.bz2
media: atomisp: warn if unsupported subdevs are found
Right now, the driver supports just one VCM and just one flash device. Warn if more than one such devices were probed. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp_v4l2.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
index c4bf2ac706d9..e83aae1978bd 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
@@ -1117,6 +1117,11 @@ static int atomisp_subdev_probe(struct atomisp_device *isp)
* (via ACPI) and registered, do not create new
* ones */
subdev = atomisp_gmin_find_subdev(adapter, board_info);
+ if (!subdev) {
+ dev_warn(isp->dev, "Subdev %s not found\n",
+ board_info->type);
+ continue;
+ }
ret = v4l2_device_register_subdev(&isp->v4l2_dev, subdev);
if (ret) {
dev_warn(isp->dev, "Subdev %s detection fail\n",
@@ -1137,6 +1142,7 @@ static int atomisp_subdev_probe(struct atomisp_device *isp)
case RAW_CAMERA:
raw_index = isp->input_cnt;
dev_dbg(isp->dev, "raw_index: %d\n", raw_index);
+ /* pass-though */
case SOC_CAMERA:
dev_dbg(isp->dev, "SOC_INDEX: %d\n", isp->input_cnt);
if (isp->input_cnt >= ATOM_ISP_MAX_INPUTS) {
@@ -1173,10 +1179,22 @@ static int atomisp_subdev_probe(struct atomisp_device *isp)
}
break;
case CAMERA_MOTOR:
+ if (isp->motor) {
+ dev_warn(isp->dev,
+ "too many atomisp motors, ignored %s\n",
+ board_info->type);
+ continue;
+ }
isp->motor = subdev;
break;
case LED_FLASH:
case XENON_FLASH:
+ if (isp->flash) {
+ dev_warn(isp->dev,
+ "too many atomisp flash devices, ignored %s\n",
+ board_info->type);
+ continue;
+ }
isp->flash = subdev;
break;
default: