From patchwork Tue Feb 14 13:40:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 9571997 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CD1E16045F for ; Tue, 14 Feb 2017 13:41:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C118927F4B for ; Tue, 14 Feb 2017 13:41:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B599028305; Tue, 14 Feb 2017 13:41:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6952327F4B for ; Tue, 14 Feb 2017 13:41:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753946AbdBNNkx (ORCPT ); Tue, 14 Feb 2017 08:40:53 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:59152 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754044AbdBNNkp (ORCPT ); Tue, 14 Feb 2017 08:40:45 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 9B67581813; Tue, 14 Feb 2017 14:40:33 +0100 (CET) Date: Tue, 14 Feb 2017 14:40:33 +0100 From: Pavel Machek To: sakari.ailus@iki.fi Cc: sre@kernel.org, pali.rohar@gmail.com, pavel@ucw.cz, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, laurent.pinchart@ideasonboard.com, mchehab@kernel.org, ivo.g.dimitrov.75@gmail.com Subject: [RFC 13/13] adp1653: add subdevs Message-ID: <20170214134033.GA8674@amd> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);