From patchwork Wed Jun 15 22:29:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 9179659 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 87D92604DB for ; Wed, 15 Jun 2016 22:31:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7696C27BE5 for ; Wed, 15 Jun 2016 22:31:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B3A827DA4; Wed, 15 Jun 2016 22:31:45 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, HK_RANDOM_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 0C07D27BE5 for ; Wed, 15 Jun 2016 22:31:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161156AbcFOWbJ (ORCPT ); Wed, 15 Jun 2016 18:31:09 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:36702 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161143AbcFOWbG (ORCPT ); Wed, 15 Jun 2016 18:31:06 -0400 Received: by mail-lf0-f66.google.com with SMTP id a2so4001968lfe.3; Wed, 15 Jun 2016 15:31:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FyErubAMM19SkfBpy83vO8/4p0MT4XNIeQjgaSJuw3E=; b=sLToX+sc0uHj+4m1cwUGP/5HHTL3MawIu6KbZufgQ5bSr6WS/Tz5FCKLliVTCF0pNj swBgZsgqwuuGrri+Otiav7BUS69MoQwYDZjZghPWhRIWwAlkzNMm5WAMjg9jHhIPIWoI CAAgKDKae8H4176UOvLhhunk1IHtl0EFL2R5zcbi62NxmpaCZg+hYby4zoZhTKBxB52Y OiWFxCUBI2rVcHndl9nzLldH9alHTx/fjIkNQwUBy5haysQZoPucT9Ij7oXqLFN1VQ5Q xP0ShT6YHstkbr6Ap5Vbz7w1q/fOdJJQRdpEAcvZCRUmP+bVDaKsCVQUroE/xkq59PEJ IoZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FyErubAMM19SkfBpy83vO8/4p0MT4XNIeQjgaSJuw3E=; b=KpOZHdnnb9ei9AEkIvaJHwybu/UZNCUVuCaxnpISUKR347lG2IbNNmYyTTjD/nevYe siwqPPs0gEzSM9LeOJrs7qdVBTjN0l3MDWHijOjVb5f0HI1OQyDgM6HD+K9r5r1f36Ts mOPxk6nB9NOUj36RBR9e/GMulKkSoj/s5AATPFZ8CD9VDD6ORETj7v9nKBulgxL/r1+b dUfbgGcEo6nmrnO69XIzVFDs0Ra+HBQ4Z2zfQQEPIVqLwOMFWLFK1kPSFZ9uRsdhcK3W RPiie1CIe+mFUmXwWzNJEYRE3Gw9BNZSungCbnafdJaIjvWi8ogAjS+8m8j6KDPM2UUg xSDQ== X-Gm-Message-State: ALyK8tIU6wRzXA8H/RbAefa/fMPcdMQzjbs/vxnmCFY/n7nZAV8MFBpfjKiIEjZmYuoYmQ== X-Received: by 10.25.37.9 with SMTP id l9mr331159lfl.70.1466029859604; Wed, 15 Jun 2016 15:30:59 -0700 (PDT) Received: from z50.lan (93-181-165-181.internetia.net.pl. [93.181.165.181]) by smtp.gmail.com with ESMTPSA id 139sm3925258ljj.1.2016.06.15.15.30.58 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 15 Jun 2016 15:30:59 -0700 (PDT) From: Janusz Krzysztofik To: Mauro Carvalho Chehab , Guennadi Liakhovetski , Greg Kroah-Hartman Cc: Hans Verkuil , Amitoj Kaur Chawla , Arnd Bergmann , Lee Jones , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, Janusz Krzysztofik Subject: [PATCH 2/3] staging: media: omap1: fix sensor probe not working anymore Date: Thu, 16 Jun 2016 00:29:49 +0200 Message-Id: <1466029790-31094-3-git-send-email-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1466029790-31094-1-git-send-email-jmkrzyszt@gmail.com> References: <1466029790-31094-1-git-send-email-jmkrzyszt@gmail.com> 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 After clock_start() removal from from soc_camera_probe() (commit 9aea470b39 '[media] soc-camera: switch I2C subdevice drivers to use v4l2-clk', introduced in v3.11), it occurred omap1_camera's sensor can't be probed successfully without its clock being turned on in advance. Fix that by surrounding soc_camera_host_register() invocation with clock_start() / clock_stop(). Created and tested on Amstrad Delta against Linux-4.7-rc3 with 'staging: media: omap1: fix null pointer dereference in omap1_cam_probe()' applied. Signed-off-by: Janusz Krzysztofik --- drivers/staging/media/omap1/omap1_camera.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/omap1/omap1_camera.c b/drivers/staging/media/omap1/omap1_camera.c index dc35d30..9b6140a 100644 --- a/drivers/staging/media/omap1/omap1_camera.c +++ b/drivers/staging/media/omap1/omap1_camera.c @@ -1650,7 +1650,11 @@ static int omap1_cam_probe(struct platform_device *pdev) pcdev->soc_host.v4l2_dev.dev = &pdev->dev; pcdev->soc_host.nr = pdev->id; - err = soc_camera_host_register(&pcdev->soc_host); + err = omap1_cam_clock_start(&pcdev->soc_host); + if (!err) { + err = soc_camera_host_register(&pcdev->soc_host); + omap1_cam_clock_stop(&pcdev->soc_host); + } if (err) return err;