From patchwork Thu Sep 3 18:31:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Dewar X-Patchwork-Id: 11754479 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1B49B91F for ; Thu, 3 Sep 2020 18:32:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 003B5208C7 for ; Thu, 3 Sep 2020 18:32:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jK8kOjm7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728343AbgICScD (ORCPT ); Thu, 3 Sep 2020 14:32:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726990AbgICSb7 (ORCPT ); Thu, 3 Sep 2020 14:31:59 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55879C061244; Thu, 3 Sep 2020 11:31:55 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id a65so3819556wme.5; Thu, 03 Sep 2020 11:31:55 -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:mime-version :content-transfer-encoding; bh=t9ZH/j53GXlXtOl/BQ9uwkwhVkecvfT9moRmFWFXpuI=; b=jK8kOjm7roy6BVmdk2I0XcrgumAoHriXRTAEgOCIaT9dR3afbgSoRBjZVnmUDCrq3R IIZVjTH25331ZhAQyTN130aLDIbO6PZBuA925HlsU2WLY3OK/BHhWLDBKkBAslBfose1 PPiaM/39Zwc99SpbyZgoP8Kc18EbUClUXly9A66ALGnHqfaQyswKoKIjWUL2yOfzUagb hA7SBuYCWnOKLXhb/+I0jTK/7S25+cfXORgM8BkQZEIdpsiu9hwejBV7nxqa420fgDYp FG3RtoPpGtcVj++3YHkp3gR8XejAouFJgMgZtNmJC2K+wT/N7MHOSk02vpJJ8zEaqDer wuuw== 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=t9ZH/j53GXlXtOl/BQ9uwkwhVkecvfT9moRmFWFXpuI=; b=s67gVzMtPKFZ6oDmQUKr7q99JXPaiLvIfeKAM4q5nCTnoIH+bAu0O2tHD+b4Ox4yYN 0bfxQAPoA5aVBQB23vWEYuVJ4Y6zIm81Dz+R6lxKDqxSOv6dls8YOLCTTP180sjjCNky LIEX2t14QgHvyhLUC0F9vJQPiItC/ep3dX9PySvAmAwR3uUCst96C52Pu0CCwtZaYCVp k3z3FRcF/SnQR4ZyIn6/KUhzHPK1SDNUmYh0CN0YDNgVyTF4qTNmg2TlwIPnQkQImp6W rQoMECNjLc6DFNT2k7WjM6Wc+7102tNreUPmmvCHZmxHCTJ956qBuYvTRwTP31kiJhQh 0IgA== X-Gm-Message-State: AOAM5323ktyH5YIpIrzAuxR5pQN+1VQYtRAFqbxQOhj2wWJp8lmkf+3U qQ4Zj0pMcf5p3OtsDCSHv8w= X-Google-Smtp-Source: ABdhPJzFLj4rL1qlEO5LjfwC8tHQ4tlonDMT7uuWHldstzL2iP6tKtqQyVv/6QQ/mqzxzfy+2TiOeg== X-Received: by 2002:a1c:c910:: with SMTP id f16mr3770562wmb.82.1599157913902; Thu, 03 Sep 2020 11:31:53 -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 v12sm5812241wri.47.2020.09.03.11.31.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 11:31:53 -0700 (PDT) From: Alex Dewar Cc: Alex Dewar , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , Linus Walleij , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] staging: media: atomisp: Don't abort on error in module exit path Date: Thu, 3 Sep 2020 19:31:34 +0100 Message-Id: <20200903183145.720727-1-alex.dewar90@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org 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. Print a warning instead and free flash unconditionally. Signed-off-by: Alex Dewar --- .../staging/media/atomisp/i2c/atomisp-lm3554.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c b/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c index cca10a4c2db0..621555b0cf6b 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c @@ -783,7 +783,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); @@ -792,13 +792,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) @@ -918,16 +918,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 = { From patchwork Thu Sep 3 18:31:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Dewar X-Patchwork-Id: 11754481 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 74A11618 for ; Thu, 3 Sep 2020 18:32:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5A7EE208C7 for ; Thu, 3 Sep 2020 18:32:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gHIVbJ9o" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729145AbgICScP (ORCPT ); Thu, 3 Sep 2020 14:32:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726990AbgICScM (ORCPT ); Thu, 3 Sep 2020 14:32:12 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 749F0C061244; Thu, 3 Sep 2020 11:32:10 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id z4so4284963wrr.4; Thu, 03 Sep 2020 11:32:10 -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 :mime-version:content-transfer-encoding; bh=nZlFaUQfaJJWMFCcYk05F0yvxG2u/t/yre5shVIK7KI=; b=gHIVbJ9oSriqlHoFWjPkTanbtqPBByFRcKhKU7auhizwrXjLqPYZNCx8CYzN0YtlCM KgymGB5DkBACD2njVMbQAM5pRQJK8IlwESyCWXD6uB4SzeW7GQZmsEKWnql/Q8b176zO 8UkPY8xcCx79PVsSRc9WwLwX0hPisqiQOYcQa4uaGMheM05PTEsmwFkOAiF/yYau+5HN Eora7TL3yzFmQpjUyuJmy+nUQtQAeqNLGsjn/37K8nzh6I4XvjCtu5xlK1n79s228mJl Q04K4kYteu4ArKjrl+wyiaNoIaAzdvg8qvqedy3Z5bC5wVbJbXRVZrGIW8/2wdms0YFT XOlQ== 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:mime-version:content-transfer-encoding; bh=nZlFaUQfaJJWMFCcYk05F0yvxG2u/t/yre5shVIK7KI=; b=kULym0h+eEzo9rZGelnEAxuCCYSpJ2QP+oanbk8OE5Du9oZZtA7yvmaFjJbpBhzPzq Ol3TfTwPrKm6zSAKazrqbFSlkRqmGYqbQ8QQlh6JyC/aX3WU0Yq+PuCKacb1Y5fSae3X spfccyNru7O/UrEFqlGTyK27na5I+lRarCD6szba21+m70EKILAcj5N+VtQKe6rNi7Sk IaYEibSuZjRejFnJMOpMaphn2yz6Km576BaDKZCppytswNL/myLIbnmB2dXbn0k2GhgI elZBM0/vweRLfYxbN+zBv96mtE0DJ/jqiT7VvVDJzxVcF9tvBsUULMraMf03Te/7/FWt GBcg== X-Gm-Message-State: AOAM531pHigV/FYZL4W3JVzWXhu29rZYEmRXQ0hPtyIfDO3S6HH4VTV9 +PudCmYss8D+9pPBfrIGYJ8= X-Google-Smtp-Source: ABdhPJwH1D9z5Su4/YaDQmrHE/SrdVgmIm5oEcQPysCfCqeDKRnP1O8ku5IIaSbKciAfSfFkiunUMA== X-Received: by 2002:adf:c983:: with SMTP id f3mr3770266wrh.348.1599157928427; Thu, 03 Sep 2020 11:32:08 -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 v12sm5812241wri.47.2020.09.03.11.32.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 11:32:08 -0700 (PDT) From: Alex Dewar Cc: Alex Dewar , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , Linus Walleij , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] staging: media: atomisp: Remove unhelpful info message Date: Thu, 3 Sep 2020 19:31:35 +0100 Message-Id: <20200903183145.720727-2-alex.dewar90@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200903183145.720727-1-alex.dewar90@gmail.com> References: <20200903183145.720727-1-alex.dewar90@gmail.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org 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 621555b0cf6b..77b7f59e62d7 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;