summaryrefslogtreecommitdiff
path: root/drivers/media/platform/marvell/cafe-driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/platform/marvell/cafe-driver.c')
-rw-r--r--drivers/media/platform/marvell/cafe-driver.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/media/platform/marvell/cafe-driver.c b/drivers/media/platform/marvell/cafe-driver.c
index ae97ce4ead98..ef810249def6 100644
--- a/drivers/media/platform/marvell/cafe-driver.c
+++ b/drivers/media/platform/marvell/cafe-driver.c
@@ -478,7 +478,7 @@ static int cafe_pci_probe(struct pci_dev *pdev,
int ret;
struct cafe_camera *cam;
struct mcam_camera *mcam;
- struct v4l2_async_subdev *asd;
+ struct v4l2_async_connection *asd;
struct i2c_client *i2c_dev;
/*
@@ -536,19 +536,24 @@ static int cafe_pci_probe(struct pci_dev *pdev,
if (ret)
goto out_pdown;
- v4l2_async_nf_init(&mcam->notifier);
+ ret = v4l2_device_register(mcam->dev, &mcam->v4l2_dev);
+ if (ret)
+ goto out_smbus_shutdown;
+
+ v4l2_async_nf_init(&mcam->notifier, &mcam->v4l2_dev);
asd = v4l2_async_nf_add_i2c(&mcam->notifier,
i2c_adapter_id(cam->i2c_adapter),
- ov7670_info.addr, struct v4l2_async_subdev);
+ ov7670_info.addr,
+ struct v4l2_async_connection);
if (IS_ERR(asd)) {
ret = PTR_ERR(asd);
- goto out_smbus_shutdown;
+ goto out_v4l2_device_unregister;
}
ret = mccic_register(mcam);
if (ret)
- goto out_smbus_shutdown;
+ goto out_v4l2_device_unregister;
clkdev_create(mcam->mclk, "xclk", "%d-%04x",
i2c_adapter_id(cam->i2c_adapter), ov7670_info.addr);
@@ -564,6 +569,8 @@ static int cafe_pci_probe(struct pci_dev *pdev,
out_mccic_shutdown:
mccic_shutdown(mcam);
+out_v4l2_device_unregister:
+ v4l2_device_unregister(&mcam->v4l2_dev);
out_smbus_shutdown:
cafe_smbus_shutdown(cam);
out_pdown:
@@ -586,6 +593,7 @@ out:
static void cafe_shutdown(struct cafe_camera *cam)
{
mccic_shutdown(&cam->mcam);
+ v4l2_device_unregister(&cam->mcam.v4l2_dev);
cafe_smbus_shutdown(cam);
free_irq(cam->pdev->irq, cam);
pci_iounmap(cam->pdev, cam->mcam.regs);