From patchwork Mon Sep 21 21:53:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Dewar X-Patchwork-Id: 255677 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1AC67C4727F for ; Mon, 21 Sep 2020 21:54:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CCD9123A61 for ; Mon, 21 Sep 2020 21:54:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JcBjfG5v" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728251AbgIUVyz (ORCPT ); Mon, 21 Sep 2020 17:54:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726644AbgIUVyy (ORCPT ); Mon, 21 Sep 2020 17:54:54 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C9B0C061755; Mon, 21 Sep 2020 14:54:54 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id x23so1069046wmi.3; Mon, 21 Sep 2020 14:54:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=z3OVW099mqaL6VHBm46aQM/bYxWoZUj5xOibh7mUBIs=; b=JcBjfG5v++B4xBESN/8LbH5HNalPKqeId89ycgMpRgUPqeGjlMG6Iu2io64EAT6Ktv fEvL/NhH7whVyqJWfPv74OGREYFkr+ZggR+Jshmj/rHybWhgm1xI9AS2eI7SY7/wTsKy dySKayRDgjyKD2TQ0vfEBlXXRNt4kxjo9xeVWv14bBG3b86mOpc+4i1uDsoLMK3NATXZ zzTx2VXmusTKRP00RtFl2Q398z78oQzfVkMHb1GJe8eJJS2y/R/RyPr5eWTngB9sSezE eQgl3b9AxnY8nVuMmYz46vFLUSctejk0xWndkaBpOO6lo4QDRYPDiocnv7FJ7zc8Bbv/ xklg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=z3OVW099mqaL6VHBm46aQM/bYxWoZUj5xOibh7mUBIs=; b=hjtgpMr4NjLNkBy0sLqoiMRQrc73ot3ieATmzwBPXZGW7yXr+ttqRpe4avRRDHdV1E VmkEFTLiBTY9+8G1h7yBW3VyhvdivXhTkY2aU9x94RPPiwVPV4CkfH/Mx3GrbQi4DY7d ZwhrhH+CcF8GoDiiLsn8EeOroRGtk6LpOgqqLsGukzjJG6VAvHZVQAseDcdAVbj4W8FS ng8BGJooSttCEjIP0DvPtjrSdRWdyGe1+69nHwtzFBZtZ8FBvoJ/fH0uVyW6Hb2FActP BJ+mDwdPrzIUYQb+oYhvRASPeqZui4Vhyx1vlylTsOj4df33Cz+QwKiWJE6aDk3KE4fK JWFg== X-Gm-Message-State: AOAM530IovfeS84kUSAmegAKYA8ujQhxxuSJc7kbZ4AbviXdS0hTn7z1 8jmJacjwH8PmKH5nmXYf0sU= X-Google-Smtp-Source: ABdhPJxOnLPCBexCpj4xZ+md7j1W5MQ97wYWxB815btr+cdwiXrp8zS2kb+5jYiiPRgBxaWVjEL1uQ== X-Received: by 2002:a1c:dd45:: with SMTP id u66mr1276800wmg.117.1600725292950; Mon, 21 Sep 2020 14:54:52 -0700 (PDT) Received: from localhost.localdomain (cpc83661-brig20-2-0-cust443.3-3.cable.virginm.net. [82.28.105.188]) by smtp.gmail.com with ESMTPSA id t124sm1282200wmg.31.2020.09.21.14.54.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2020 14:54:52 -0700 (PDT) From: Alex Dewar To: Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , Alex Dewar , Dan Carpenter , Linus Walleij , Alan Cox , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND 2/5] staging: media: atomisp: Remove unhelpful info message Date: Mon, 21 Sep 2020 22:53:53 +0100 Message-Id: <20200921215359.45003-3-alex.dewar90@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921215359.45003-1-alex.dewar90@gmail.com> References: <20200921215359.45003-1-alex.dewar90@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org We don't really need to know that the LED pin reset successfully. Signed-off-by: Alex Dewar --- drivers/staging/media/atomisp/i2c/atomisp-lm3554.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c b/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c index cca10a4c2db0..d78014847e67 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c @@ -771,7 +771,6 @@ static int lm3554_gpio_init(struct i2c_client *client) ret = gpiod_direction_output(pdata->gpio_reset, 0); if (ret < 0) return ret; - dev_info(&client->dev, "flash led reset successfully\n"); if (!pdata->gpio_strobe) return -EINVAL; From patchwork Mon Sep 21 21:53:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Dewar X-Patchwork-Id: 255676 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C50B6C4727C for ; Mon, 21 Sep 2020 21:55:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 81ED423A60 for ; Mon, 21 Sep 2020 21:55:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PINJawvQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728518AbgIUVzk (ORCPT ); Mon, 21 Sep 2020 17:55:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726497AbgIUVzh (ORCPT ); Mon, 21 Sep 2020 17:55:37 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2417BC061755; Mon, 21 Sep 2020 14:55:37 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id m6so14593521wrn.0; Mon, 21 Sep 2020 14:55:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=t6IkKnXa5tIfj0pEtiHch/id+y7KfUWCLs3pBM4+7Bw=; b=PINJawvQ9e9dquFTGr3zZx+5fm9L2BiwpAHxL74wVdUTWTQ89n3Kvz10/lWMYxqiY2 xBYnD7L8FxZ7/R4caI6NUzLRu/mjXbSxlQ72Hg7c9skBQon3JaNsZZ/dZ+iUT7oUPUae P4zBqty9tOvDZEI/SBo72+1RWJPm9O/4e1ijPOi/4NA2qPOCP1C1B9VMaaLMzLo4nMFp 6l/zp3Nl6a4SrEDiRFVU4FKXHIOl0+CeAbivhoM38DO6prMPg0bVyjEJpxCIfai6RV6L LBwSDQNcgoa/J4ukll6YHth/9asvcPFtlOsUUa42kCDDOtBAJCqq+8exPpT/Egr2rBQH pU1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=t6IkKnXa5tIfj0pEtiHch/id+y7KfUWCLs3pBM4+7Bw=; b=TDSbpRMTeoMlhyKlet9Byoy04bCSadOgzJzv3N+yN2L0HAXHJ9FCEPzQR/sELIkc6p oKgcqtNqn3YYAjb2XwbrmNHzYSXgfyFDlDdFdxZF7VpnEiijuSSS1VzKgbCASbbqe0Yt 9g3aGemwTV2kwkQzFio5nb2piJxVkX6eXOfxq22up8LAL4qZkdZdAu/BbvsZn0PjWCXA sAFQl8IHGP1XjlJk/hKWQgar2rJcLyjk4k5HKJY0mnxZdvyLjeUqI62m4TxJRQyGXopm 36Gwct0GHrmBPy5br7DfFfXX4AW590P684E9hdKw/1KonYa5XC3MzEpBTiga8ileqn83 H84Q== X-Gm-Message-State: AOAM5336m0AWV+9MVNz3rcRXTUuYSLEHTYh6J9N2QlRP5JlSippjxANR gmz7EpN5M7LXMxUwS6/YUfw= X-Google-Smtp-Source: ABdhPJwWDNjkSOFG5QNhQ+EcOhRxbhHygXIASP2+2Z2iIZMH8zrj0Y480HY7ngQKNF4hGEBQ7ZqT6A== X-Received: by 2002:adf:ef4f:: with SMTP id c15mr1994655wrp.390.1600725335846; Mon, 21 Sep 2020 14:55:35 -0700 (PDT) Received: from localhost.localdomain (cpc83661-brig20-2-0-cust443.3-3.cable.virginm.net. [82.28.105.188]) by smtp.gmail.com with ESMTPSA id t124sm1282200wmg.31.2020.09.21.14.55.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2020 14:55:35 -0700 (PDT) From: Alex Dewar To: Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , Alex Dewar , Linus Walleij , Dan Carpenter , Alan Cox , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND 4/5] staging: media: atomisp: Don't abort on error in module exit path Date: Mon, 21 Sep 2020 22:53:57 +0100 Message-Id: <20200921215359.45003-5-alex.dewar90@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921215359.45003-1-alex.dewar90@gmail.com> References: <20200921215359.45003-1-alex.dewar90@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The function lm3554_remove() checks for the return code for lm3554_gpio_uninit() even though this is on the exit path and exits the function, leaving the variable flash unfreed. Instead, print a warning and free flash unconditionally. Signed-off-by: Alex Dewar --- .../staging/media/atomisp/i2c/atomisp-lm3554.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c b/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c index d78014847e67..d446ee8e93db 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c @@ -782,7 +782,7 @@ static int lm3554_gpio_init(struct i2c_client *client) return 0; } -static int lm3554_gpio_uninit(struct i2c_client *client) +static void lm3554_gpio_uninit(struct i2c_client *client) { struct v4l2_subdev *sd = i2c_get_clientdata(client); struct lm3554 *flash = to_lm3554(sd); @@ -791,13 +791,13 @@ static int lm3554_gpio_uninit(struct i2c_client *client) ret = gpiod_direction_output(pdata->gpio_strobe, 0); if (ret < 0) - return ret; + dev_err(&client->dev, + "gpio request/direction_output fail for gpio_strobe"); ret = gpiod_direction_output(pdata->gpio_reset, 0); if (ret < 0) - return ret; - - return 0; + dev_err(&client->dev, + "gpio request/direction_output fail for gpio_reset"); } static void *lm3554_platform_data_func(struct i2c_client *client) @@ -907,7 +907,6 @@ static int lm3554_remove(struct i2c_client *client) { struct v4l2_subdev *sd = i2c_get_clientdata(client); struct lm3554 *flash = to_lm3554(sd); - int ret; media_entity_cleanup(&flash->sd.entity); v4l2_ctrl_handler_free(&flash->ctrl_handler); @@ -917,16 +916,11 @@ static int lm3554_remove(struct i2c_client *client) del_timer_sync(&flash->flash_off_delay); - ret = lm3554_gpio_uninit(client); - if (ret < 0) - goto fail; + lm3554_gpio_uninit(client); kfree(flash); return 0; -fail: - dev_err(&client->dev, "gpio request/direction_output fail"); - return ret; } static const struct dev_pm_ops lm3554_pm_ops = {