linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 13/13] adp1653: add subdevs
@ 2017-02-14 13:40 Pavel Machek
  0 siblings, 0 replies; only message in thread
From: Pavel Machek @ 2017-02-14 13:40 UTC (permalink / raw)
  To: sakari.ailus
  Cc: sre, pali.rohar, pavel, linux-media, linux-kernel,
	laurent.pinchart, mchehab, ivo.g.dimitrov.75

[-- Attachment #1: Type: text/plain, Size: 1705 bytes --]

Needed for number of camera devices to match and fcam-dev to work.
---
 drivers/media/i2c/adp1653.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/adp1653.c b/drivers/media/i2c/adp1653.c
index ba1ec4a..b3d8e60 100644
--- a/drivers/media/i2c/adp1653.c
+++ b/drivers/media/i2c/adp1653.c
@@ -497,11 +497,13 @@ static int adp1653_probe(struct i2c_client *client,
 		flash->platform_data = client->dev.platform_data;
 	}
 
+	dev_info(&client->dev, "adp1653 probe: subdev\n");	
 	mutex_init(&flash->power_lock);
 
 	v4l2_i2c_subdev_init(&flash->subdev, client, &adp1653_ops);
 	flash->subdev.internal_ops = &adp1653_internal_ops;
 	flash->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
+	strcpy(flash->subdev.name, "adp1653 flash");
 
 	ret = adp1653_init_controls(flash);
 	if (ret)
@@ -509,12 +511,21 @@ static int adp1653_probe(struct i2c_client *client,
 
 	ret = media_entity_pads_init(&flash->subdev.entity, 0, NULL);
 	if (ret < 0)
-		goto free_and_quit;
+		goto free_pads;
+
+	dev_info(&client->dev, "adp1653 probe: should be ok\n");
+
+	ret = v4l2_async_register_subdev(&flash->subdev);
+	if (ret < 0)
+		goto free_pads;
+
+	dev_info(&client->dev, "adp1653 probe: async register subdev ok\n");	
 
 	flash->subdev.entity.function = MEDIA_ENT_F_FLASH;
 
 	return 0;
-
+free_pads:
+	media_entity_cleanup(&flash->subdev.entity);
 free_and_quit:
 	dev_err(&client->dev, "adp1653: failed to register device\n");
 	v4l2_ctrl_handler_free(&flash->ctrls);
-- 
2.1.4


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-02-14 13:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-14 13:40 [RFC 13/13] adp1653: add subdevs Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).