X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fmedia%2Fvideo%2Fadp1653.c;h=5914390211ff2ac6f087ec5693c08234ec55bd7d;hb=839b48dff10990c03f7d41afdaf5853cb3c0ab83;hp=be7befd60947eff952698fc36f14923381ad69b7;hpb=f6a975c50a1c5e68c376634b4331052990ca3dfd;p=pandora-kernel.git diff --git a/drivers/media/video/adp1653.c b/drivers/media/video/adp1653.c index be7befd60947..5914390211ff 100644 --- a/drivers/media/video/adp1653.c +++ b/drivers/media/video/adp1653.c @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -258,7 +259,7 @@ static int adp1653_init_controls(struct adp1653_flash *flash) if (flash->ctrls.error) return flash->ctrls.error; - fault->is_volatile = 1; + fault->flags |= V4L2_CTRL_FLAG_VOLATILE; flash->subdev.ctrl_handler = &flash->ctrls; return 0; @@ -413,6 +414,10 @@ static int adp1653_probe(struct i2c_client *client, struct adp1653_flash *flash; int ret; + /* we couldn't work without platform data */ + if (client->dev.platform_data == NULL) + return -ENODEV; + flash = kzalloc(sizeof(*flash), GFP_KERNEL); if (flash == NULL) return -ENOMEM; @@ -425,12 +430,21 @@ static int adp1653_probe(struct i2c_client *client, flash->subdev.internal_ops = &adp1653_internal_ops; flash->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; - adp1653_init_controls(flash); + ret = adp1653_init_controls(flash); + if (ret) + goto free_and_quit; ret = media_entity_init(&flash->subdev.entity, 0, NULL, 0); if (ret < 0) - kfree(flash); + goto free_and_quit; + + flash->subdev.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_FLASH; + + return 0; +free_and_quit: + v4l2_ctrl_handler_free(&flash->ctrls); + kfree(flash); return ret; }