From patchwork Sat May 4 14:40:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10929855 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E8C72933 for ; Sat, 4 May 2019 14:40:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D88F12874B for ; Sat, 4 May 2019 14:40:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC73228751; Sat, 4 May 2019 14:40:49 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 7C8332874B for ; Sat, 4 May 2019 14:40:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727208AbfEDOks (ORCPT ); Sat, 4 May 2019 10:40:48 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:44067 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726217AbfEDOks (ORCPT ); Sat, 4 May 2019 10:40:48 -0400 Received: by mail-qk1-f196.google.com with SMTP id d14so495439qkl.11; Sat, 04 May 2019 07:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=T9Qs8dTZ1+gMY4BQD6SwkkWyhPjLDwG2kkm+LN85fx0=; b=ksTBJY1213GTBbMM3y7iooIrrJ/7TMSG/ib5hXOS/fvb4cIq54oJi6M+r3yyP0+ace Qn9xkpl9RtoOiCzGO1vKihP90+LKIkCHv40ZbzsvXY50+lGKqaB6b3R9OJe1j7VLuIxf nH+ZzUZ4O2XDl5UByDjoWa4SuYv4XBmcAGgWkl4PyR0pnib/UbSRSbnHEgTQZoWKiu+L fCZSKykVi+FR/fWUeq/uH9idlnkJjGuudMgP1cv5oROE/rDNS6MUFWSrqc3c+bZhE9vd bXfyVTFszMijFHpD7wsVeuequhIxe3tw01nSt1JgVl9jIUsSlm1T3Z80hHXK1ndu7zMN Oa6Q== 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:in-reply-to :references; bh=T9Qs8dTZ1+gMY4BQD6SwkkWyhPjLDwG2kkm+LN85fx0=; b=EdKU4zK9FtyBNfJ8Lj/UKpBiCPybOgLkLZnyTtoaLuN3xHh06C3yKnCQXl/bX4F2aQ tjL5JGNNadUbk/O8GWjQd+oUT5cYa+LZtj/w69wOgCz0A3FIc7kq40qY16P3+KlWFWM9 HSTBQYO+JY5DYGhr0m1vJNOB2LW4z461CBZoxxEqitzNZlLcA2yb06AuLZj5wgLT+pYQ JfZ5IZC/cU3boS9XmUYg7gcHYFyPhIvkv2d08CWoEn7Xb9Cp08QosXHfy6LL1tkPjEm5 rEvpJ7+lknJbQuRMRQkiEv/kMgf3pO1Lw0j/DbBWX37gyRVQ4+mGeQhB4yjVflnQrMix U28A== X-Gm-Message-State: APjAAAUh662KfO1RZIPZK5oNX7vlHnWm92Y7V1LEo+dNnSQw1hN60Mxk yzfDCxcNb1MY8rLjPm3zSTI= X-Google-Smtp-Source: APXvYqx4hj2r5faOcYdJTUiZ4nIztf8EvEeeyzCqxm47vGhHdpTvj3OcfKciVSHec+GS/Nzutoy7Rw== X-Received: by 2002:a37:6005:: with SMTP id u5mr11720796qkb.255.1556980847346; Sat, 04 May 2019 07:40:47 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:482:3c8:56cb:1049:60d2:137b]) by smtp.gmail.com with ESMTPSA id 67sm2536815qtc.29.2019.05.04.07.40.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 May 2019 07:40:46 -0700 (PDT) From: Fabio Estevam To: hverkuil-cisco@xs4all.nl Cc: rui.silva@linaro.org, slongerbeam@gmail.com, p.zabel@pengutronix.de, linux-media@vger.kernel.org, sebastien.szymanski@armadeus.com, otavio@ossystems.com.br, robh+dt@kernel.org, devicetree@vger.kernel.org, Fabio Estevam Subject: [PATCH 1/8] media: dt-bindings: imx7-csi: Document a single CSI clock Date: Sat, 4 May 2019 11:40:25 -0300 Message-Id: <20190504144027.31920-6-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190504144027.31920-1-festevam@gmail.com> References: <20190504144027.31920-1-festevam@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 As per the i.MX7D Reference Manual only the MCLK is used for the CSI block, so only document this single clock. Signed-off-by: Fabio Estevam Tested-by: Rui Miguel Silva Reviewed-by: Rui Miguel Silva Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/media/imx7-csi.txt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/media/imx7-csi.txt b/Documentation/devicetree/bindings/media/imx7-csi.txt index 3c07bc676bc3..443aef07356e 100644 --- a/Documentation/devicetree/bindings/media/imx7-csi.txt +++ b/Documentation/devicetree/bindings/media/imx7-csi.txt @@ -14,8 +14,7 @@ Required properties: - interrupts : should contain CSI interrupt; - clocks : list of clock specifiers, see Documentation/devicetree/bindings/clock/clock-bindings.txt for details; -- clock-names : must contain "axi", "mclk" and "dcic" entries, matching - entries in the clock property; +- clock-names : must contain "mclk"; The device node shall contain one 'port' child node with one child 'endpoint' node, according to the bindings defined in: @@ -32,10 +31,8 @@ example: compatible = "fsl,imx7-csi"; reg = <0x30710000 0x10000>; interrupts = ; - clocks = <&clks IMX7D_CLK_DUMMY>, - <&clks IMX7D_CSI_MCLK_ROOT_CLK>, - <&clks IMX7D_CLK_DUMMY>; - clock-names = "axi", "mclk", "dcic"; + clocks = <&clks IMX7D_CSI_MCLK_ROOT_CLK>; + clock-names = "mclk"; port { csi_from_csi_mux: endpoint { From patchwork Sat May 4 14:40:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10929845 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 99FE2912 for ; Sat, 4 May 2019 14:40:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8362A2874C for ; Sat, 4 May 2019 14:40:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 737E02874B; Sat, 4 May 2019 14:40:30 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 4E1FD2874B for ; Sat, 4 May 2019 14:40:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726647AbfEDOk2 (ORCPT ); Sat, 4 May 2019 10:40:28 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:35135 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726217AbfEDOk1 (ORCPT ); Sat, 4 May 2019 10:40:27 -0400 Received: by mail-qt1-f196.google.com with SMTP id e5so10060372qtq.2; Sat, 04 May 2019 07:40:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=XBwAXDcmDgX0kUshD3oX+4mA2FacWSdfBk0R5YYOPXI=; b=mpVNicx0/PdEOYFoPk1IlwGxfVGyf06VnpVQuEnztgb4J/0fUXUmBWGx2L1Tu3NiOK cH/ZKUskfvLDVEBFC+graKrBFIfT+aNUwhR5S7XSVe0aoScP0iyG4M6V+mCVzdptGFNB svlO9xbNycvEpfPmtUAarNuy+vsIR/5BWjilPaxeAOt6o+2JewrJLaPsbjq/RD2kna+b JVmjqP2jzrCoYBgDYsJJhHmOHnr2TUklhnpcwFlkkTNtp16PMQfRTEXMVv6diBGYbU3F mgf9wX8BLnWyvgGwu0diIu26jCd+mlHejRJ0bpR2bdU4KJYm215p1mBXwfI1V2qyGOOR ZB8Q== 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; bh=XBwAXDcmDgX0kUshD3oX+4mA2FacWSdfBk0R5YYOPXI=; b=oXTsbYJfTB3nxx4ksU4m0Hg+hKCtNEIkQj0kGkQ4LbylzepG/JygElT7essYGBvjBx fsRP82zLuXe0kQjJGDxT66B8HtY/xVPNodet5uaFhQBGZ9pLR0vVBO5EceIDI3f0O94e 4fVpxs5BNm4/UOsVi/XJxbu0fZLx/eCEErtS7g2GOvmgLdG1WCAfn60I+jF/CyoBW29g 2Pt81i5WMkg6Bp1cAy3tV62ZBaVb6lZPOXns8Esw/x+V4oMsFJnCJYhmHg0jEU8WYg8z Uy9qs/BzL8htijFb8MkXLX6tCcFkslTRLQxTyswLyzNxNovdOz4hVLT9UJqYVG9KmQQJ 54jg== X-Gm-Message-State: APjAAAVlwnxiFt3QTrHpXsyJqQmZnPOuUVq3xeOk67WX6TMUhCvZG5aL JyJ+0clSxhTg0kDLrv4PXSQ= X-Google-Smtp-Source: APXvYqwB2DNeqRiD37TbKyG0CWA3VfmLr/CMaXELLEFcYWOYqFjIUGzjhYhM90nLOhOMh/JLvwE6JA== X-Received: by 2002:ac8:2bcc:: with SMTP id n12mr13846968qtn.53.1556980826495; Sat, 04 May 2019 07:40:26 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:482:3c8:56cb:1049:60d2:137b]) by smtp.gmail.com with ESMTPSA id 67sm2536815qtc.29.2019.05.04.07.40.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 May 2019 07:40:25 -0700 (PDT) From: Fabio Estevam To: hverkuil-cisco@xs4all.nl Cc: rui.silva@linaro.org, slongerbeam@gmail.com, p.zabel@pengutronix.de, linux-media@vger.kernel.org, sebastien.szymanski@armadeus.com, otavio@ossystems.com.br, robh+dt@kernel.org, devicetree@vger.kernel.org, Fabio Estevam Subject: [PATCH 2/8] media: imx7-media-csi: Acquire a single clock Date: Sat, 4 May 2019 11:40:20 -0300 Message-Id: <20190504144027.31920-1-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 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 As per the i.MX7D Reference Manual only the MCLK is used for the CSI block, so only handle this single clock. Signed-off-by: Fabio Estevam --- drivers/staging/media/imx/imx7-media-csi.c | 51 ++++------------------ 1 file changed, 8 insertions(+), 43 deletions(-) diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index 18eb5d3ecf10..3e02cfa2f07c 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -152,8 +152,6 @@ #define CSI_CSICR18 0x48 #define CSI_CSICR19 0x4c -static const char * const imx7_csi_clk_id[] = {"axi", "dcic", "mclk"}; - struct imx7_csi { struct device *dev; struct v4l2_subdev sd; @@ -180,9 +178,7 @@ struct imx7_csi { void __iomem *regbase; int irq; - - int num_clks; - struct clk_bulk_data *clks; + struct clk *mclk; /* active vb2 buffers to send to video dev sink */ struct imx_media_buffer *active_vb2_buf[2]; @@ -204,20 +200,6 @@ struct imx7_csi { #define imx7_csi_reg_write(_csi, _val, _offset) \ __raw_writel(_val, (_csi)->regbase + (_offset)) -static void imx7_csi_clk_enable(struct imx7_csi *csi) -{ - int ret; - - ret = clk_bulk_prepare_enable(csi->num_clks, csi->clks); - if (ret < 0) - dev_err(csi->dev, "failed to enable clocks\n"); -} - -static void imx7_csi_clk_disable(struct imx7_csi *csi) -{ - clk_bulk_disable_unprepare(csi->num_clks, csi->clks); -} - static void imx7_csi_hw_reset(struct imx7_csi *csi) { imx7_csi_reg_write(csi, @@ -413,7 +395,7 @@ static void imx7_csi_init(struct imx7_csi *csi) if (csi->is_init) return; - imx7_csi_clk_enable(csi); + clk_prepare_enable(csi->mclk); imx7_csi_hw_reset(csi); imx7_csi_init_interface(csi); imx7_csi_dmareq_rff_enable(csi); @@ -429,7 +411,7 @@ static void imx7_csi_deinit(struct imx7_csi *csi) imx7_csi_hw_reset(csi); imx7_csi_init_interface(csi); imx7_csi_dmareq_rff_disable(csi); - imx7_csi_clk_disable(csi); + clk_disable_unprepare(csi->mclk); csi->is_init = false; } @@ -1200,24 +1182,6 @@ static int imx7_csi_parse_endpoint(struct device *dev, return fwnode_device_is_available(asd->match.fwnode) ? 0 : -EINVAL; } -static int imx7_csi_clocks_get(struct imx7_csi *csi) -{ - struct device *dev = csi->dev; - int i; - - csi->num_clks = ARRAY_SIZE(imx7_csi_clk_id); - csi->clks = devm_kcalloc(dev, csi->num_clks, sizeof(*csi->clks), - GFP_KERNEL); - - if (!csi->clks) - return -ENOMEM; - - for (i = 0; i < csi->num_clks; i++) - csi->clks[i].id = imx7_csi_clk_id[i]; - - return devm_clk_bulk_get(dev, csi->num_clks, csi->clks); -} - static int imx7_csi_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -1233,10 +1197,11 @@ static int imx7_csi_probe(struct platform_device *pdev) csi->dev = dev; - ret = imx7_csi_clocks_get(csi); - if (ret < 0) { - dev_err(dev, "Failed to get clocks"); - return -ENODEV; + csi->mclk = devm_clk_get(&pdev->dev, "mclk"); + if (IS_ERR(csi->mclk)) { + ret = PTR_ERR(csi->mclk); + dev_err(dev, "Failed to get mclk: %d", ret); + return ret; } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); From patchwork Sat May 4 14:40:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10929847 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8E07C933 for ; Sat, 4 May 2019 14:40:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7CF822874B for ; Sat, 4 May 2019 14:40:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 70BFD28751; Sat, 4 May 2019 14:40:32 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 1F2A12874B for ; Sat, 4 May 2019 14:40:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726776AbfEDOkb (ORCPT ); Sat, 4 May 2019 10:40:31 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:41017 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726217AbfEDOkb (ORCPT ); Sat, 4 May 2019 10:40:31 -0400 Received: by mail-qk1-f194.google.com with SMTP id g190so1383071qkf.8; Sat, 04 May 2019 07:40:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OePHcTegD5FLNIpc+vZjgQ+IKj2BBIUebfiBxqKweyI=; b=FLCAnSnHKbtHJ1ga9WGXoatBWU3wYfNRq3deo+PSUpVVFaEeWRz566/5zy4EdNqs63 wsT+k1KW1T/Swpv8FCu2gSYikebTicNhSc1uFzohPI+fO/8WhlvIoC/qoOd8JGECZvXy IR8diozMrXZS+9aecD8Df49wCaTK4Ge2FM3i55sFtLfCSaISOAiKIefBm+CR4vGDpI3E i4nonlwnK8FlS1BHuaCpKlYmJzYjdZ601ovh7+KOpgwf3u1ngm/c7I8CTOyFiBnKsqRl Kv+zh+BHs9jnlLbukYGhbYdhCwtSpKO59inB5JeXvE6kMdDT/ktn7wpBrC1+ADka6obD ShTg== 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:in-reply-to :references; bh=OePHcTegD5FLNIpc+vZjgQ+IKj2BBIUebfiBxqKweyI=; b=CpkHTU0LIKTvI9i3WjJEQheOtIXdG+VuzDX7z+1kY28qaRvtXknF1gCNqS6zeDnUje Mz0mHyQj+Xjdhgc5BWSUxfYkyukbSA//oGvx8cN5yjlOsGQT+r0VW4btKrHeUDw/YDE3 QPZt0uxDM3R4dH45Z23itgED1BFd93GQFNn4r9wqXNypVeqsnkn/A0L1/zPo8sRTJUf7 fw/55wjqABtA9S6WnLPlhu0OevmOXi+PeHUbET3MTx5n6Nk8HMrWCv+jhXQ3BafuigwM gO4khVxmh0JhpOSGsH3zKwibyDd7ESCx2DsNzz59qRmRhktMYtdLvW+dexrC0zL6cHXE Ctcg== X-Gm-Message-State: APjAAAUHSjcU4DKao4e4QUwZFB/M1C4GlX72g3Yia18w0mNdQb/N/LC/ B7KgaGhTeLKAsBm6fN/+u5o= X-Google-Smtp-Source: APXvYqzt09i2kWVAA3JhTqrCDNqjs97k05edJmZeC/YcOODs8ZqqkL7mAnOnz2nKyj5x+pJ1nejA3A== X-Received: by 2002:a37:80c6:: with SMTP id b189mr12790321qkd.144.1556980830333; Sat, 04 May 2019 07:40:30 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:482:3c8:56cb:1049:60d2:137b]) by smtp.gmail.com with ESMTPSA id 67sm2536815qtc.29.2019.05.04.07.40.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 May 2019 07:40:29 -0700 (PDT) From: Fabio Estevam To: hverkuil-cisco@xs4all.nl Cc: rui.silva@linaro.org, slongerbeam@gmail.com, p.zabel@pengutronix.de, linux-media@vger.kernel.org, sebastien.szymanski@armadeus.com, otavio@ossystems.com.br, robh+dt@kernel.org, devicetree@vger.kernel.org, Fabio Estevam Subject: [PATCH 3/8] media: imx7-media-csi: Use devm_platform_ioremap_resource() Date: Sat, 4 May 2019 11:40:21 -0300 Message-Id: <20190504144027.31920-2-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190504144027.31920-1-festevam@gmail.com> References: <20190504144027.31920-1-festevam@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 Use devm_platform_ioremap_resource() to simplify the code a bit. While at it, propagate the real error value in case of devm_platform_ioremap_resource() failure. Signed-off-by: Fabio Estevam --- drivers/staging/media/imx/imx7-media-csi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index 3e02cfa2f07c..e0286c322fad 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -1188,7 +1188,6 @@ static int imx7_csi_probe(struct platform_device *pdev) struct device_node *node = dev->of_node; struct imx_media_dev *imxmd; struct imx7_csi *csi; - struct resource *res; int ret; csi = devm_kzalloc(&pdev->dev, sizeof(*csi), GFP_KERNEL); @@ -1204,17 +1203,16 @@ static int imx7_csi_probe(struct platform_device *pdev) return ret; } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); csi->irq = platform_get_irq(pdev, 0); - if (!res || csi->irq < 0) { + if (csi->irq < 0) { dev_err(dev, "Missing platform resources data\n"); return -ENODEV; } - csi->regbase = devm_ioremap_resource(dev, res); + csi->regbase = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(csi->regbase)) { dev_err(dev, "Failed platform resources map\n"); - return -ENODEV; + return PTR_ERR(csi->regbase); } spin_lock_init(&csi->irqlock); From patchwork Sat May 4 14:40:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10929849 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0A33C933 for ; Sat, 4 May 2019 14:40:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED85D2874B for ; Sat, 4 May 2019 14:40:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0F6C28751; Sat, 4 May 2019 14:40:36 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 8AD5D2874B for ; Sat, 4 May 2019 14:40:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726996AbfEDOkf (ORCPT ); Sat, 4 May 2019 10:40:35 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:36954 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726217AbfEDOkf (ORCPT ); Sat, 4 May 2019 10:40:35 -0400 Received: by mail-qk1-f194.google.com with SMTP id c1so717826qkk.4; Sat, 04 May 2019 07:40:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pCuThotQDyC8AKpqAGJcTioH0PThWO88athp0JOGagU=; b=hOLgLf4ak0S/BlcjZYPHDuRxVuYx3mL8PTS9F/n1G2vlwPjwNjwtmV5pT4ZdUJ1B40 CyTE0tQwowerLvpkDxzWOX0wIkstsUHahiQZt2PKmbqKOSHbjDVQBk3Zkgvsjj4ywoc2 xK121hHvzC2yG1tYH5MImxwStTXIbnE2Ib5cCFfK5aeBRd5o0X2hqKBg298qmt1kiocw A8HBQEDyCr6/90duLRhMVqz8HxSnPoEVj6rZgzLJjIjZiXD8NCrQZo15l94+T3SYL9wF aoA+Bht9Y4Ffi57T2cNg85VqlFWU+EoMkGPTANHsbVP+61Cec683ci0+XV9lGK4Y/1dV otMQ== 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:in-reply-to :references; bh=pCuThotQDyC8AKpqAGJcTioH0PThWO88athp0JOGagU=; b=K7IHQ7qMCNea7l4EoY5jKUd5w9I/xxueskdM+kye6AlZYzFaumEcLE66aNhPf2IreN fewprr+aC/WOaEV0rFA1Xst107Dzls7LBzKqP/7b0bs+6iIPP8ORUvKI7TTphDPKc8YI LEQpzmCaYQyBvRP8QBSWdEXMj4pXjlj5dO0gHe+efEEl40HdX8dTg8miU7NdS2IMqYpM Scs8Eioeb3c654IkfKdUPH9aYKxK7kqa6QqWHi7aP+gcCguaTrJEF66/xYcBT392YeLs 81zmzY3SQ0+JHnemH45Ar23LTosbOfEj+I56YlNprQVM5lT6D3vt/oTzl3SG/sGQJfGF 5hYw== X-Gm-Message-State: APjAAAVBwPzK46AaVgyQsD7WNmp+b7bdIaPkmlPrsRhk3FfXzNs7mYpB byt/f9tcpHCScLTOyBl41Ug= X-Google-Smtp-Source: APXvYqxAmDILa2GTtMpK6FT3DvxdWJog3gLnZWQHZ9CotS6MH0HHqW2VcthhQr9M1Oi+k6gFjzntDQ== X-Received: by 2002:a37:5945:: with SMTP id n66mr769201qkb.295.1556980834641; Sat, 04 May 2019 07:40:34 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:482:3c8:56cb:1049:60d2:137b]) by smtp.gmail.com with ESMTPSA id 67sm2536815qtc.29.2019.05.04.07.40.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 May 2019 07:40:33 -0700 (PDT) From: Fabio Estevam To: hverkuil-cisco@xs4all.nl Cc: rui.silva@linaro.org, slongerbeam@gmail.com, p.zabel@pengutronix.de, linux-media@vger.kernel.org, sebastien.szymanski@armadeus.com, otavio@ossystems.com.br, robh+dt@kernel.org, devicetree@vger.kernel.org, Fabio Estevam Subject: [PATCH 4/8] media: imx7-media-csi: Propagate the correct error for platform_get_irq() Date: Sat, 4 May 2019 11:40:22 -0300 Message-Id: <20190504144027.31920-3-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190504144027.31920-1-festevam@gmail.com> References: <20190504144027.31920-1-festevam@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 In the case of platform_get_irq() failure, let's propagate the real error code instead of a fake one. Signed-off-by: Fabio Estevam --- drivers/staging/media/imx/imx7-media-csi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index e0286c322fad..a4cc9a342674 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -1206,7 +1206,7 @@ static int imx7_csi_probe(struct platform_device *pdev) csi->irq = platform_get_irq(pdev, 0); if (csi->irq < 0) { dev_err(dev, "Missing platform resources data\n"); - return -ENODEV; + return csi->irq; } csi->regbase = devm_platform_ioremap_resource(pdev, 0); From patchwork Sat May 4 14:40:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10929851 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5860F912 for ; Sat, 4 May 2019 14:40:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 476DD2874B for ; Sat, 4 May 2019 14:40:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B5F728751; Sat, 4 May 2019 14:40:41 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 DE6FF2874B for ; Sat, 4 May 2019 14:40:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727066AbfEDOkk (ORCPT ); Sat, 4 May 2019 10:40:40 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:39995 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726217AbfEDOkj (ORCPT ); Sat, 4 May 2019 10:40:39 -0400 Received: by mail-qt1-f195.google.com with SMTP id k24so6240001qtq.7; Sat, 04 May 2019 07:40:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=c7G9mJrY8Tv8lVtdImCY5iGpFlSSDAqtE39f9pCz3/E=; b=DF6RQdlwOAX/Xcd8h9ZqprdPrTnGaUajmILD6byS2HoxbQ5nnQNOe1+w9kwOX0WBIV oTPRd7nftajG4ki/F9Rj0yMWaLBUL03v9CobPTY3ua8jyLqa5W/Fz2FgD6taRojX33HN HkHf8Y/H8IX1703dQEwCmWxdBZD08duhDvY1ZlsyQPuWvsMG3VrkhyuiD9LgjauuhTyI ZKezncCXa2KjNuzC6lWflwhYWZZzmkj1zQhbjYWs01ilS258YLf3aC6RPYiSt70GDt17 h4T9Ph7YoIfqBfUtqKEzcivYSS+MnVXsGfDTR69vSmmObQHfAq8U/Xw4RFkCi+cez2q6 bw3A== 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:in-reply-to :references; bh=c7G9mJrY8Tv8lVtdImCY5iGpFlSSDAqtE39f9pCz3/E=; b=AveLiosC6/zDnYvCJugDiP6wbpaJRBJBZDG2k0UOYto3hmFF2ljZ520tOP6MPnsLIi 8/wx8QWGwsCHmZy/4rfxjDtkVLxiUHR1IITJ59f+EYY45M9gnjygPWl0MW8fiXX+XX7w PPrkCd0pXuniepimWmnYTARuKhxqVWA3P6FFp7TRBHo9rgondFIQhXxl6lGaA6z61ucY 7N0oDBEMJJZbc1KH4//b630/Sw9ub9FI05Q1KKilYp1E/i3sUbexQwHpxmxj1utyddVu /pt4BPAtczpt3kvClnmzNFVzHffiLFW4gkvx47bTwLXFJ8CFmmZ0MlLQKJb+kNaro7Rf 0CrQ== X-Gm-Message-State: APjAAAW8UVfWB+Xmhaprf+2dGNbDhHjF03IhAOIW/2QNb/0VfTxwmFw3 UB6+3g2uYhuBfyFVclF2Qu8= X-Google-Smtp-Source: APXvYqzPapuCQF3gZ9dvRLfluvZFIeS2tzskxXz1C1OQgZnoIe64DsJYLIRDKDzk0JbQgcTl1WDb4w== X-Received: by 2002:a0c:81c7:: with SMTP id 7mr12616654qve.2.1556980838814; Sat, 04 May 2019 07:40:38 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:482:3c8:56cb:1049:60d2:137b]) by smtp.gmail.com with ESMTPSA id 67sm2536815qtc.29.2019.05.04.07.40.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 May 2019 07:40:38 -0700 (PDT) From: Fabio Estevam To: hverkuil-cisco@xs4all.nl Cc: rui.silva@linaro.org, slongerbeam@gmail.com, p.zabel@pengutronix.de, linux-media@vger.kernel.org, sebastien.szymanski@armadeus.com, otavio@ossystems.com.br, robh+dt@kernel.org, devicetree@vger.kernel.org, Fabio Estevam Subject: [PATCH 5/8] media: imx7-media-csi: Propagate the correct error for devm_request_irq() Date: Sat, 4 May 2019 11:40:23 -0300 Message-Id: <20190504144027.31920-4-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190504144027.31920-1-festevam@gmail.com> References: <20190504144027.31920-1-festevam@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 In the case of devm_request_irq() failure, let's propagate the real error code instead of a fake one. Signed-off-by: Fabio Estevam --- drivers/staging/media/imx/imx7-media-csi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index a4cc9a342674..88265cd133ab 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -1223,7 +1223,6 @@ static int imx7_csi_probe(struct platform_device *pdev) (void *)csi); if (ret < 0) { dev_err(dev, "Request CSI IRQ failed.\n"); - ret = -ENODEV; goto destroy_mutex; } From patchwork Sat May 4 14:40:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10929853 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E91D9933 for ; Sat, 4 May 2019 14:40:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8F7E2874B for ; Sat, 4 May 2019 14:40:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD93628751; Sat, 4 May 2019 14:40:44 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 892CE2874B for ; Sat, 4 May 2019 14:40:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727127AbfEDOko (ORCPT ); Sat, 4 May 2019 10:40:44 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:45623 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726217AbfEDOko (ORCPT ); Sat, 4 May 2019 10:40:44 -0400 Received: by mail-qk1-f195.google.com with SMTP id d5so243856qko.12; Sat, 04 May 2019 07:40:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SrbMTnJl3HCplwHOOFkZixgCnFnnvAU6jaUDQIXmhpQ=; b=ZxKkU9CvTswkNappRJA5MWu5roKbvuxcsiGJC4dNNMfUPQGxhih86il2xDSL2lXN1Q 9HGlBKAIooorTs9G6B3qsLTTDvPCcdoWkRsjvzf5YKibJC66ePemywjmcvXub+4bh8Kg P22qDDqgmW2tuYo2/K07uIW83LSj4Em25uJ/CLj2kHQ+XM6rjC4BeeblP2AWIP7DH9T2 +vuqAkiFHX0wewzLPVBMD9cUe5wVZ+uhPeF+X0GK60mJkCzprAl0ZNW7QIdzPUCQQRdB njLYUr50LDCBEPjgDk4FhKM3gnkmKziX6djJ+cS/HH0HZSscmuNc9FQeSmc1iINaNLuq 8WWg== 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:in-reply-to :references; bh=SrbMTnJl3HCplwHOOFkZixgCnFnnvAU6jaUDQIXmhpQ=; b=EH64jjh/XRni1SVjHZZZltpO15JiKi0FxIZoKjh4rgJDW9K5TT/hI12/75vfkbwOq8 OTeaaGtUKFFH/yi9WOpuh+lHo91ECd6o8vI3+JeCl+JCyUd66jdJ58Jy1avsWqvkTZ5z s0vuyALYT0MHXnsbstSzPnyRuAo8oSxbXYgveceJZUi2NJV99J0f/I2xGNXJKEjNAw50 4K7nuShv/bCAE0ak/bskin3gOUhHi+wK2DtRhW2Ime9grebuZc0XIE4845eBvAFnOrMU bpz4D0+A9YfnBnrYeD711fGMHpUb6vXjiUJQeL6CKKaj181AOdPmTUYkE3QqmGfV8OEt PylQ== X-Gm-Message-State: APjAAAUXA/E6EG9m4TMHZILCZLzHE44bA0+Ih+zvB98Box/O4Qup7fRR mvwvB5qp4ZvsmRSkLN1p19M= X-Google-Smtp-Source: APXvYqzswW/uQ1pR+oDDlJzMrVpT5W7LCGRSI6GHEHmKZK/mWnogKeEKK1V3B7ccxFAzFIOewVEelg== X-Received: by 2002:ae9:ec04:: with SMTP id h4mr12335616qkg.1.1556980842994; Sat, 04 May 2019 07:40:42 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:482:3c8:56cb:1049:60d2:137b]) by smtp.gmail.com with ESMTPSA id 67sm2536815qtc.29.2019.05.04.07.40.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 May 2019 07:40:42 -0700 (PDT) From: Fabio Estevam To: hverkuil-cisco@xs4all.nl Cc: rui.silva@linaro.org, slongerbeam@gmail.com, p.zabel@pengutronix.de, linux-media@vger.kernel.org, sebastien.szymanski@armadeus.com, otavio@ossystems.com.br, robh+dt@kernel.org, devicetree@vger.kernel.org, Fabio Estevam Subject: [PATCH 6/8] media: imx7-media-csi: Remove unneeded break Date: Sat, 4 May 2019 11:40:24 -0300 Message-Id: <20190504144027.31920-5-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190504144027.31920-1-festevam@gmail.com> References: <20190504144027.31920-1-festevam@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 Remove unneeded 'break' right after the 'return' statement as pointed out by checkpatch. Signed-off-by: Fabio Estevam --- drivers/staging/media/imx/imx7-media-csi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index 88265cd133ab..d1ecdcfc792e 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -1003,7 +1003,6 @@ static int imx7_csi_try_fmt(struct imx7_csi *csi, break; default: return -EINVAL; - break; } return 0; } From patchwork Sat May 4 14:40:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10929857 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 26FA8912 for ; Sat, 4 May 2019 14:40:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 119E02874B for ; Sat, 4 May 2019 14:40:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05B0128751; Sat, 4 May 2019 14:40:54 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 AA8352874B for ; Sat, 4 May 2019 14:40:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727219AbfEDOkw (ORCPT ); Sat, 4 May 2019 10:40:52 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:42490 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726217AbfEDOkw (ORCPT ); Sat, 4 May 2019 10:40:52 -0400 Received: by mail-qt1-f194.google.com with SMTP id p20so10016169qtc.9; Sat, 04 May 2019 07:40:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rWFbpbNrzQ1y2PIHtjx8Zisl8LLVI1Mr9vzfhnCkPAA=; b=PFwFQHDtTkN/931PrOlDp8Qf7U/eH5jEzr7s9xkqngFKNPbDEQLmTPlkwLv7Euplb9 lnVo5i6kjPvYLGclNKNTvmFGH0h+k+pw2f0DZ8xTN9Mjc432Pi2mqeldIOORZTkKgTjN xsR5xfhVeKwN0Fz3VbnA7Qb7PUuhKjHbtDdWr/3lnylrofWH6VGBKRcQoPyZIEGMS1EX sbQRJo1Xq9LQcyiz1vdhBOp+gbMHgOs0XegCmtDGbnYDdM+IFNgkYo0pykZoYLweR7p+ oemL0tdWEvbnocaa1SBFGOr1NCdhM2KWKbxDQh2xPUkzVKMfSne4wKdRXF66Uy9VCbCL RR7A== 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:in-reply-to :references; bh=rWFbpbNrzQ1y2PIHtjx8Zisl8LLVI1Mr9vzfhnCkPAA=; b=nc2CmqRi48a56KICI9qfFPMSs94jlIVTeaxzxgQYQEaKOv8jMYF2OsTqCewChzPNdp BejCKaQALhdSjjSI5b54Vy7Ul68AKX0zSiiqS/e0rUh8qVMjt6knzSe5r3rvPJIQLddw zW++xaxUEjjcfnWnOgnHOXeQj+FMd8twbqLiqqrBv94YRjwdP0RKwobyEWYVuDCfc4jY DccGeh3OVV+3Z4x0igErdyACTddQzQfJe1ht2FKGaAid67Gn/kebLfbmChmJ0QzGtzJX cMBe+qwXm9d/AfA9FFKARKPTfB3lnN+6WqIV5BwPYuz+HosdRbTPngEXrTwZTJuq6Y7V 0PpQ== X-Gm-Message-State: APjAAAXRShCS0iMPZSfVamJJaQCcfaedUzU7VrULQ7jS5Yf+KnV18wKP psjtFOQhE8/1J6dZUfLPJII= X-Google-Smtp-Source: APXvYqzcyNISvmNu+UTcTQzmt9RYZyQvCh8y5tuZzCyBAqzkVddR7lL6SUZp1zaOukNUbWFiYIITJQ== X-Received: by 2002:a0c:b05b:: with SMTP id l27mr12899413qvc.162.1556980851372; Sat, 04 May 2019 07:40:51 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:482:3c8:56cb:1049:60d2:137b]) by smtp.gmail.com with ESMTPSA id 67sm2536815qtc.29.2019.05.04.07.40.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 May 2019 07:40:50 -0700 (PDT) From: Fabio Estevam To: hverkuil-cisco@xs4all.nl Cc: rui.silva@linaro.org, slongerbeam@gmail.com, p.zabel@pengutronix.de, linux-media@vger.kernel.org, sebastien.szymanski@armadeus.com, otavio@ossystems.com.br, robh+dt@kernel.org, devicetree@vger.kernel.org, Fabio Estevam Subject: [PATCH 7/8] media: imx7-media-csi: Check the return value from clk_prepare_enable() Date: Sat, 4 May 2019 11:40:26 -0300 Message-Id: <20190504144027.31920-7-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190504144027.31920-1-festevam@gmail.com> References: <20190504144027.31920-1-festevam@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 clk_prepare_enable() may fail, so we should better check its return value and propagate it in the case of error. Signed-off-by: Fabio Estevam --- drivers/staging/media/imx/imx7-media-csi.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index d1ecdcfc792e..dcc6027fe32b 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -390,17 +390,23 @@ static void imx7_csi_error_recovery(struct imx7_csi *csi) imx7_csi_hw_enable(csi); } -static void imx7_csi_init(struct imx7_csi *csi) +static int imx7_csi_init(struct imx7_csi *csi) { + int ret; + if (csi->is_init) - return; + return 0; - clk_prepare_enable(csi->mclk); + ret = clk_prepare_enable(csi->mclk); + if (ret < 0) + return ret; imx7_csi_hw_reset(csi); imx7_csi_init_interface(csi); imx7_csi_dmareq_rff_enable(csi); csi->is_init = true; + + return 0; } static void imx7_csi_deinit(struct imx7_csi *csi) @@ -513,7 +519,7 @@ static int imx7_csi_link_setup(struct media_entity *entity, init: if (csi->sink || csi->src_sd) - imx7_csi_init(csi); + ret = imx7_csi_init(csi); else imx7_csi_deinit(csi); From patchwork Sat May 4 14:40:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10929859 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B7FDF912 for ; Sat, 4 May 2019 14:40:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4C512874B for ; Sat, 4 May 2019 14:40:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 962D928751; Sat, 4 May 2019 14:40:57 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 4C8B12874B for ; Sat, 4 May 2019 14:40:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727312AbfEDOk4 (ORCPT ); Sat, 4 May 2019 10:40:56 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:36261 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726217AbfEDOk4 (ORCPT ); Sat, 4 May 2019 10:40:56 -0400 Received: by mail-qk1-f193.google.com with SMTP id c14so1644429qke.3; Sat, 04 May 2019 07:40:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xu38cRaLtpnqYuurbo6CWspS+gIr3m1joWBLVxT3VQA=; b=nkzXoV4AxU3SGKXtSy42c6ZXNaBHglADNYXaXokmwRgmqZp0zaWpXM579zcxFQhQKj vlgmWJTxf2O4ZILm4VpZlyrxkNSFoeA8oPkAJiocRx+BY8tOUzzmAnmnfF/tl4TnPC9X mvbuAj9kseO7oeqtnPXKzB+nXA2KBeQpjI2s0XyTxBTecC82qggq+arV6OwoVn7UOx+I 9l6sxoyG8I/1JQY/qyxqlXUqkC3PfQgeTXARgs3DXKgTfbTDKJiXewwth4MKMENHy3hA ASUG1wRmtzwRnMt31I5KPUV5EtVhN6FPQxxyowpEKpqvmb7+aMKHT80Bn1cYpSjCvVaT +cvQ== 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:in-reply-to :references; bh=xu38cRaLtpnqYuurbo6CWspS+gIr3m1joWBLVxT3VQA=; b=YM1tb34BK8DJ0UfZ+gu3D+6pSxPzs9iERZ8l4JeY7Bu3/lmnbUp35EsFOONBKNa3GA /JkzTaOg+fcMZl4MvFpXr5ZFpAn3LKw802UgwhZYEv+OWMsagu+n3Ia7ueHwkJ1M2IGh rnNY4//aK3oBVQ4ORLlk7rSEF118QNOSgWeOCk0HK0g4qZqEvissIF+hOxO/cyx5D8w1 dlnAoGY9qjYIRc1PxAM02YvbQe+fHj6F1WAX2gxsU8h9Lkr7/ky+f3/gz27OeMHwIQZf rhVf3UIvNeliCR/JdPvVQS4RdlVpPfIynoMZemPJg9dx3lLYTSrKaZ5KhXMu1l90YPc2 meJg== X-Gm-Message-State: APjAAAVvRcveeHJOZKxOGVU/mlnOsN2uN++jRz4MUvkxjsyAcpkcOKZT kr1ty+eBCF+50tNF4OqsSsI= X-Google-Smtp-Source: APXvYqyWAYwH5Ber7i35gLcncyKZIE9FdNcmSHuccNVyBNZ+HZ7xNCikYoQoQw0NpsnmSG5fGriwGg== X-Received: by 2002:a05:620a:141a:: with SMTP id d26mr12478633qkj.238.1556980855673; Sat, 04 May 2019 07:40:55 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:482:3c8:56cb:1049:60d2:137b]) by smtp.gmail.com with ESMTPSA id 67sm2536815qtc.29.2019.05.04.07.40.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 May 2019 07:40:55 -0700 (PDT) From: Fabio Estevam To: hverkuil-cisco@xs4all.nl Cc: rui.silva@linaro.org, slongerbeam@gmail.com, p.zabel@pengutronix.de, linux-media@vger.kernel.org, sebastien.szymanski@armadeus.com, otavio@ossystems.com.br, robh+dt@kernel.org, devicetree@vger.kernel.org, Fabio Estevam Subject: [PATCH 8/8] media: imx7-media-csi: Change imx7_csi_enable() to void Date: Sat, 4 May 2019 11:40:27 -0300 Message-Id: <20190504144027.31920-8-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190504144027.31920-1-festevam@gmail.com> References: <20190504144027.31920-1-festevam@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 imx7_csi_enable() always return 0 and its return value is never checked, so convert it to void. Signed-off-by: Fabio Estevam --- drivers/staging/media/imx/imx7-media-csi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index dcc6027fe32b..0f51791f788a 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -799,7 +799,7 @@ static int imx7_csi_configure(struct imx7_csi *csi) return 0; } -static int imx7_csi_enable(struct imx7_csi *csi) +static void imx7_csi_enable(struct imx7_csi *csi) { imx7_csi_sw_reset(csi); @@ -807,10 +807,7 @@ static int imx7_csi_enable(struct imx7_csi *csi) imx7_csi_dmareq_rff_enable(csi); imx7_csi_hw_enable_irq(csi); imx7_csi_hw_enable(csi); - return 0; } - - return 0; } static void imx7_csi_disable(struct imx7_csi *csi)