From patchwork Sat Apr 15 10:05:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Frank_Sch=C3=A4fer?= X-Patchwork-Id: 9682181 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 38F5D601E7 for ; Sat, 15 Apr 2017 10:05:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1994D28597 for ; Sat, 15 Apr 2017 10:05:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E6FB285B3; Sat, 15 Apr 2017 10:05:55 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham 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 0FFA828597 for ; Sat, 15 Apr 2017 10:05:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753424AbdDOKFl (ORCPT ); Sat, 15 Apr 2017 06:05:41 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36693 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752840AbdDOKFk (ORCPT ); Sat, 15 Apr 2017 06:05:40 -0400 Received: by mail-wm0-f65.google.com with SMTP id q125so1908452wmd.3 for ; Sat, 15 Apr 2017 03:05:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=f6zTuOGWWTEGhEY0C9eOarla0CDHkySz5LOauqnhyoo=; b=XGONiypLidYNaROiztnYKGdhPLWHU4mA8Q+FN59W7k+XxY1mvFbfCN008TsGLSoAOu eVwCy3QJTsMNB2k8BYzkiyLtDmRSHZodRYPiAkX5v77eMF3BGpPmXfGVrNTjMXifgYCL gEaY/B0XLUWrnLRbEUStN5kV8k+S8diNvORwDs4BXGoiJRcATcFi+AjSOs4Iis40Sc5p v+9t8AjZR5+MD8tCQYLjiziCcwakRgg8wYYJVy95sY/B01ap9l3hBJkvk1cDc7NHpRXX y9lfdJc/Hk+W6ZKri5NpDZ1egEWxFT3CbzD3ohYCCA+ADjbJXa63tcge269Bw0sVgHEv 3gIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=f6zTuOGWWTEGhEY0C9eOarla0CDHkySz5LOauqnhyoo=; b=kCgo4ovv8mrndWFrkkr1r0vSxk8F3qcUcYk0QCMWryNhUmv0c5h0D/OnfP/YUlWvOl 5zXtNkBQmBX8kziLJT/eK9v0saeN3YNzuaL00rbeXHFDdboBuSN8nD7/U00fU5YcuYbD beYOQmPYGOhX/PqOAd6+1laHdJDJxuX79IMkR6mb+B3YqaIk29kkPwAPEl+udpGosJsM /Gf4rFBIhDxOvs6CW5DgbpnKwKBC+dziR28JgWm4aVeXvtSzfAipCRUjDFX8E2oBToeX 9bVq8a6HG4TZ0SGi73oZBgHmLb5n+luV3Du0hedhDgeM5qV10Y3vQCMf6hbJhVlSYlZd Ku8A== X-Gm-Message-State: AN3rC/43D4GD34EpG6TtflG6POZ03JJOyOHpNOdXmjzz58zT71Nj7Fko lPNXvnGKUfaF8E6z X-Received: by 10.28.153.4 with SMTP id b4mr2015267wme.58.1492250738517; Sat, 15 Apr 2017 03:05:38 -0700 (PDT) Received: from Athlon64X2-5000.lan (ip-178-201-166-194.hsi08.unitymediagroup.de. [178.201.166.194]) by smtp.googlemail.com with ESMTPSA id b73sm5753639wrd.29.2017.04.15.03.05.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 15 Apr 2017 03:05:37 -0700 (PDT) From: =?UTF-8?q?Frank=20Sch=C3=A4fer?= To: linux-media@vger.kernel.org Cc: mchehab@kernel.org, =?UTF-8?q?Frank=20Sch=C3=A4fer?= Subject: [PATCH 1/5] em28xx: get rid of the dummy clock source Date: Sat, 15 Apr 2017 12:05:00 +0200 Message-Id: <20170415100504.3076-1-fschaefer.oss@googlemail.com> X-Mailer: git-send-email 2.12.2 MIME-Version: 1.0 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 The v4l2 dummy clock has been added with commit fc5d0f8a8878 ("V4L2: em28xx: register a V4L2 clock source") to be able to use the ov2640 soc_camera driver. Since commit 46796cfcd346 ("ov2640: use standard clk and enable it") it is no longer required. Signed-off-by: Frank Schäfer --- drivers/media/usb/em28xx/em28xx-camera.c | 30 ++++++------------------------ drivers/media/usb/em28xx/em28xx-video.c | 6 ------ drivers/media/usb/em28xx/em28xx.h | 1 - 3 files changed, 6 insertions(+), 31 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-camera.c b/drivers/media/usb/em28xx/em28xx-camera.c index 2f59237ee399..d43f630050bb 100644 --- a/drivers/media/usb/em28xx/em28xx-camera.c +++ b/drivers/media/usb/em28xx/em28xx-camera.c @@ -24,7 +24,6 @@ #include #include #include -#include #include /* Possible i2c addresses of Micron sensors */ @@ -331,17 +330,9 @@ int em28xx_detect_sensor(struct em28xx *dev) int em28xx_init_camera(struct em28xx *dev) { - char clk_name[V4L2_CLK_NAME_SIZE]; struct i2c_client *client = &dev->i2c_client[dev->def_i2c_bus]; struct i2c_adapter *adap = &dev->i2c_adap[dev->def_i2c_bus]; struct em28xx_v4l2 *v4l2 = dev->v4l2; - int ret = 0; - - v4l2_clk_name_i2c(clk_name, sizeof(clk_name), - i2c_adapter_id(adap), client->addr); - v4l2->clk = v4l2_clk_register_fixed(clk_name, -EINVAL); - if (IS_ERR(v4l2->clk)) - return PTR_ERR(v4l2->clk); switch (dev->em28xx_sensor) { case EM28XX_MT9V011: @@ -371,10 +362,8 @@ int em28xx_init_camera(struct em28xx *dev) pdata.xtal = v4l2->sensor_xtal; if (NULL == v4l2_i2c_new_subdev_board(&v4l2->v4l2_dev, adap, - &mt9v011_info, NULL)) { - ret = -ENODEV; - break; - } + &mt9v011_info, NULL)) + return -ENODEV; /* probably means GRGB 16 bit bayer */ v4l2->vinmode = 0x0d; v4l2->vinctl = 0x00; @@ -430,10 +419,8 @@ int em28xx_init_camera(struct em28xx *dev) subdev = v4l2_i2c_new_subdev_board(&v4l2->v4l2_dev, adap, &ov2640_info, NULL); - if (NULL == subdev) { - ret = -ENODEV; - break; - } + if (subdev == NULL) + return -ENODEV; format.format.code = MEDIA_BUS_FMT_YUYV8_2X8; format.format.width = 640; @@ -450,14 +437,9 @@ int em28xx_init_camera(struct em28xx *dev) } case EM28XX_NOSENSOR: default: - ret = -EINVAL; - } - - if (ret < 0) { - v4l2_clk_unregister_fixed(v4l2->clk); - v4l2->clk = NULL; + return -EINVAL; } - return ret; + return 0; } EXPORT_SYMBOL_GPL(em28xx_init_camera); diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index 8d93100334ea..3cbc3d4270a3 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #include @@ -2140,11 +2139,6 @@ static int em28xx_v4l2_fini(struct em28xx *dev) v4l2_ctrl_handler_free(&v4l2->ctrl_handler); v4l2_device_unregister(&v4l2->v4l2_dev); - if (v4l2->clk) { - v4l2_clk_unregister_fixed(v4l2->clk); - v4l2->clk = NULL; - } - kref_put(&v4l2->ref, em28xx_free_v4l2); mutex_unlock(&dev->lock); diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h index e9f379959fa5..e8d97d5ec161 100644 --- a/drivers/media/usb/em28xx/em28xx.h +++ b/drivers/media/usb/em28xx/em28xx.h @@ -510,7 +510,6 @@ struct em28xx_v4l2 { struct v4l2_device v4l2_dev; struct v4l2_ctrl_handler ctrl_handler; - struct v4l2_clk *clk; struct video_device vdev; struct video_device vbi_dev;