From patchwork Sat Nov 5 12:51:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13033043 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10827C4332F for ; Sat, 5 Nov 2022 12:51:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229529AbiKEMv0 (ORCPT ); Sat, 5 Nov 2022 08:51:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbiKEMvZ (ORCPT ); Sat, 5 Nov 2022 08:51:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAF1926130 for ; Sat, 5 Nov 2022 05:51:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 60DBCB81CC0 for ; Sat, 5 Nov 2022 12:51:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BC2AC433C1; Sat, 5 Nov 2022 12:51:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667652682; bh=z3bakntnLpwk0wf1kbFb07a/JsroO2LkBq8WCH3O7+o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hv8P5mNVuPoX2EId/CIxGQpZ/A93NWxaejHdiNp2Eln06Sn4tHXUCRbKdp/IgtUFy JkNyxaJJ0DB045xEg5VobFYspKi0F5Vs+NWHcHtCX2naqJMEMFDjamtZ6GM37++4tj RGlD6Xay0QFj2unNFscECUAuNb9bVFhCgUcPjbffvbKrdYwomnHA1R9lAkkKBJSTjp uEm1h4Pnb0Rd/gPMLAejUkLcootHR1NAUQOjXOyolIMJUAS/Ck85/AQk/pxGzgVD47 1H1vrennt87ZGpzmt6tOPTlZeOrvtjau4c359FUIv4kZxaZX/gIk5u+bu7syS6nAVP TUXywO0IZN1vg== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Crt Mori Cc: coverity-bot , Jonathan Cameron , coverity-bot Subject: [PATCH 1/2] iio: temperature: mlx90632: Add error handling for devm_pm_runtime_enable() Date: Sat, 5 Nov 2022 12:51:07 +0000 Message-Id: <20221105125108.383193-2-jic23@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221105125108.383193-1-jic23@kernel.org> References: <20221105125108.383193-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron This call can fail so handling is necessary even if it is very unlikely. Reported-by: coverity-bot Addresses-Coverity-ID: 1527134 ("Error handling issues") Fixes: c83d3e5ca97f ("iio: temperature: mlx90632 Add runtime powermanagement modes") Signed-off-by: Jonathan Cameron --- drivers/iio/temperature/mlx90632.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c index a17fe5f4967a..7572ae3f8432 100644 --- a/drivers/iio/temperature/mlx90632.c +++ b/drivers/iio/temperature/mlx90632.c @@ -1267,7 +1267,10 @@ static int mlx90632_probe(struct i2c_client *client, pm_runtime_get_noresume(&client->dev); pm_runtime_set_active(&client->dev); - devm_pm_runtime_enable(&client->dev); + ret = devm_pm_runtime_enable(&client->dev); + if (ret) + return ret; + pm_runtime_set_autosuspend_delay(&client->dev, MLX90632_SLEEP_DELAY_MS); pm_runtime_use_autosuspend(&client->dev); pm_runtime_put_autosuspend(&client->dev); From patchwork Sat Nov 5 12:51:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13033044 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D8FDC4332F for ; Sat, 5 Nov 2022 12:51:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229563AbiKEMv2 (ORCPT ); Sat, 5 Nov 2022 08:51:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbiKEMv1 (ORCPT ); Sat, 5 Nov 2022 08:51:27 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36CE226130 for ; Sat, 5 Nov 2022 05:51:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 8FB1ECE0B88 for ; Sat, 5 Nov 2022 12:51:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87543C433D7; Sat, 5 Nov 2022 12:51:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667652683; bh=X8zARHHEFGL++JOLXrJ9/ZpJfEgsTUHSU0HOyaDXJdE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ccM9KSP8M1Wwk7B0wqkL1S9vKzgErWOPThIFdio3tV2eXHa3gEcqtnqKjLiNuZuuJ 7jRCAHmzpP+vGenGrdyL9Cp0vepm89hk1iBDBZxYUEkcHYKbbM2wtZEpbi94UobvKw qWvZjOvha7BQ04gVecI4zSZK7wRGtRpCBL2hWtyXjrpFfW6J5hLxJxEwV4+TifX/Dp DTyKSYaLbz3y94IcbM7hz73IKB8EDTHVX/UHUu8DiZOdf0I/soSDSerrT2Kxqzw+8g n1hGuWossYaqziQrOHaED/h4ndENnzUcwF9wDLUdx9/Bu7i8zB8u58hLY5R8+CrlDC DpRHDwZ9do6Sw== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Crt Mori Cc: coverity-bot , Jonathan Cameron Subject: [PATCH 2/2] iio: temperature: mlx90632: Add missing static marking on devm_pm_ops Date: Sat, 5 Nov 2022 12:51:08 +0000 Message-Id: <20221105125108.383193-3-jic23@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221105125108.383193-1-jic23@kernel.org> References: <20221105125108.383193-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Only used within this file, so should be marked static. Fixes: c83d3e5ca97f ("iio: temperature: mlx90632 Add runtime powermanagement modes") Signed-off-by: Jonathan Cameron --- drivers/iio/temperature/mlx90632.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c index 7572ae3f8432..f1f5ebc145b1 100644 --- a/drivers/iio/temperature/mlx90632.c +++ b/drivers/iio/temperature/mlx90632.c @@ -1326,7 +1326,7 @@ static int mlx90632_pm_runtime_suspend(struct device *dev) return mlx90632_pwr_set_sleep_step(data->regmap); } -const struct dev_pm_ops mlx90632_pm_ops = { +static const struct dev_pm_ops mlx90632_pm_ops = { SYSTEM_SLEEP_PM_OPS(mlx90632_pm_suspend, mlx90632_pm_resume) RUNTIME_PM_OPS(mlx90632_pm_runtime_suspend, NULL, NULL) };