Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp592818pxh; Tue, 9 Nov 2021 15:50:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQaYXADSvP+X9GM4/q5opj9iKBkRz/qVUtQ95GykJlDXX0NymlhidQKkHEFslhlratX2v1 X-Received: by 2002:a05:6638:613:: with SMTP id g19mr9017149jar.77.1636501849890; Tue, 09 Nov 2021 15:50:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636501849; cv=none; d=google.com; s=arc-20160816; b=J9cEwBzUngOJJDk5AN31deT/11n2DAqmB0RwYTY3hwIUTVLQVVh8er1FlUbPrUCGAZ szhbeh53FRYmZvZNoete+omqcWOvj3iJZ02CMhv5RD8NDjw/C2v8AokIkaOoIUU2PFM7 kUG44xhPpvTaWdbUnnEdLK9rPmQa+QfAnxAyHrxNQS12IiTxN+yzz5jyxd8UulzfgaGZ K/vLXKMwYTJyEBvzKxVm4UQP9eXHIJ+OJ+iFcNgZZMHykG/AWzvpBAAs7ig+jzd3BOp9 surJzY7jMghAN8eX9LAVUgOcCSq3wwMigJg9d0QvPpVVYfadXLdlpQVH3rjmsKy6N3DA 1Erw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=sUbjpkSUx2cFtR7SVylrDxV7vdaDyvFTkfks2GHj+mg=; b=HGI4K1ndXxK3JN4uGpHHsbVWZgL8QwxfOMnnSNL2yZ858yoT5KDv6KZPwZP/PXNyxK eBawbgpkAMrVC/Pv2I0GfRHz5NETLS30dJKIJRW+CLqduf0jbXcgnlphQTMNyt66VCaO PH9+CHqW5RnWH+27bjY7igye/4bq2kQbymkmRWL3g/oloM3L6r0Bg+t1jIF33gr+2AJw 6McrqtylfyCWVctzVBtcNEvE9CsOywh6OrYQHBCjrdVu4qKa0JlTYmq95V7clDg05eXy qiLSDgDv7dwWqyl9DbcczqEXhyLbYFGy75wS2M6FwM6eKk7DMaWV/By81XIOX9k7QAcj +K7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=puri.sm Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q13si28816565ilm.150.2021.11.09.15.50.37; Tue, 09 Nov 2021 15:50:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=puri.sm Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234407AbhKINNf (ORCPT + 97 others); Tue, 9 Nov 2021 08:13:35 -0500 Received: from comms.puri.sm ([159.203.221.185]:47342 "EHLO comms.puri.sm" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229998AbhKINNd (ORCPT ); Tue, 9 Nov 2021 08:13:33 -0500 Received: from localhost (localhost [127.0.0.1]) by comms.puri.sm (Postfix) with ESMTP id 1B7C1E03CC; Tue, 9 Nov 2021 05:10:48 -0800 (PST) Received: from comms.puri.sm ([127.0.0.1]) by localhost (comms.puri.sm [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9rq4FAoVgiPD; Tue, 9 Nov 2021 05:10:47 -0800 (PST) From: Martin Kepplinger To: sakari.ailus@linux.intel.com, mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@puri.sm, Martin Kepplinger Subject: [PATCH v1 1/2] media: i2c: hi846: check return value of regulator_bulk_disable() Date: Tue, 9 Nov 2021 14:10:12 +0100 Message-Id: <20211109131013.2684058-2-martin.kepplinger@puri.sm> In-Reply-To: <20211109131013.2684058-1-martin.kepplinger@puri.sm> References: <20211109131013.2684058-1-martin.kepplinger@puri.sm> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org regulator_bulk_disable can fail and thus suspend() can. Handle that error gracefully. Signed-off-by: Martin Kepplinger --- drivers/media/i2c/hi846.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/media/i2c/hi846.c b/drivers/media/i2c/hi846.c index 4b94bdf2e5cb..ed55c3894284 100644 --- a/drivers/media/i2c/hi846.c +++ b/drivers/media/i2c/hi846.c @@ -1858,7 +1858,7 @@ static int hi846_power_on(struct hi846 *hi846) return ret; } -static void hi846_power_off(struct hi846 *hi846) +static int hi846_power_off(struct hi846 *hi846) { if (hi846->rst_gpio) gpiod_set_value_cansleep(hi846->rst_gpio, 1); @@ -1867,7 +1867,7 @@ static void hi846_power_off(struct hi846 *hi846) gpiod_set_value_cansleep(hi846->shutdown_gpio, 1); clk_disable_unprepare(hi846->clock); - regulator_bulk_disable(HI846_NUM_SUPPLIES, hi846->supplies); + return regulator_bulk_disable(HI846_NUM_SUPPLIES, hi846->supplies); } static int __maybe_unused hi846_suspend(struct device *dev) @@ -1879,9 +1879,7 @@ static int __maybe_unused hi846_suspend(struct device *dev) if (hi846->streaming) hi846_stop_streaming(hi846); - hi846_power_off(hi846); - - return 0; + return hi846_power_off(hi846); } static int __maybe_unused hi846_resume(struct device *dev) -- 2.30.2