Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11793061pjo; Thu, 2 Jan 2020 14:22:32 -0800 (PST) X-Google-Smtp-Source: APXvYqz21Pqgu7f/PlYIDnPcyJlqSWKuCkR5DbT/cP4mkJyIoIy6IEvgF7I5OuzNe2v2qvPonu6d X-Received: by 2002:a05:6830:1385:: with SMTP id d5mr65312229otq.61.1578003752718; Thu, 02 Jan 2020 14:22:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578003752; cv=none; d=google.com; s=arc-20160816; b=vzFL60rSwL5KypTQxqOLF5mZBVneTPw7sm216ByeVJQSv3XtTlj78qEQNV4cY8rr2C 8+rud6E/WQRJWTo9S1mmkeFkmKfNElGek7aSj2f6bxwqr3HVP2uENH5myCaNhi0wxtpG fmM0mes/RRFbBuNp4OgXPKXVMTNmyVCF0O7GYGh7uMgR2xyWECTYkgO1i4ic2TTOEqCB 6TeE2gBd9a7teagkeGhmY/+/6MFsC84mKXXAwEIrBoP0rd9MooFRqRqoxNGIZfocsEn3 jxTTLC192qC2BRcdl8rGUH5olO2iXiWkGfj7cMfOayYwV2sL7w30fNsnTj0j+/qu/I+F qVig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pSNqwACbdH5PczYEFPjVATr4mnO+DtC7b+VJAh63iXU=; b=yhHoFaXX7x2sCJCHUDoxzw9FMwrl+S34a1HhzNn0uoLPcuwdlyGlyK+pLW4zhEnnLF QAqL6IW40RhlEpYAny9pSToB9Rx7NEAgz4HhUbcsvq3A/SOzK4edQVGCGFMiN4h3rAYX Kpdca6U2CsNqZTH77XIX0N37M/LUdlrj1nOds8Q4zxLU7g+HeRzUekP5UveuL9hO/qF9 SwRanEOWVQUhGZ4DxZ/DnRhDeGOw7PavymONhb66Ia7YBV3VbjybOrDXQcXfwOuATMb3 od05/adc9YV3TZjB95/5ldwvZyr/iF5l0s6NwsDRKWXZRrsolE+3Y4QsF6bKaVpbBpYx pDXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T0SgWwUP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d11si28108260oti.325.2020.01.02.14.22.21; Thu, 02 Jan 2020 14:22:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T0SgWwUP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728863AbgABWUo (ORCPT + 99 others); Thu, 2 Jan 2020 17:20:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:38646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728852AbgABWUm (ORCPT ); Thu, 2 Jan 2020 17:20:42 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6C92A2253D; Thu, 2 Jan 2020 22:20:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003641; bh=8VqzkoxjJLB3l5GP5JBQCAJeVpBqdl9yDEo2CnjKTCU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T0SgWwUP2QDCCq+VF9+XwvkOFAuLy6trnoTXmXm82OqAcSdZo/OF+cAP1wtE5SlRd TH09pPgYGH6foHCs+HtsuzPWPlN/QUA7nnG81zDldfLHBDfTEpfTKNCThjPbutOY0S XiAJBd9BUzSHfJEKrEKCDoNq2CecrYvMUAuzbc5A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Guido=20G=C3=BCnther?= , Pavel Machek , Dan Murphy , Sasha Levin Subject: [PATCH 4.19 017/114] leds: lm3692x: Handle failure to probe the regulator Date: Thu, 2 Jan 2020 23:06:29 +0100 Message-Id: <20200102220030.874892409@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220029.183913184@linuxfoundation.org> References: <20200102220029.183913184@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guido Günther [ Upstream commit 396128d2ffcba6e1954cfdc9a89293ff79cbfd7c ] Instead use devm_regulator_get_optional since the regulator is optional and check for errors. Signed-off-by: Guido Günther Acked-by: Pavel Machek Reviewed-by: Dan Murphy Signed-off-by: Pavel Machek Signed-off-by: Sasha Levin --- drivers/leds/leds-lm3692x.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/leds/leds-lm3692x.c b/drivers/leds/leds-lm3692x.c index 4f413a7c5f05..d79a66a73169 100644 --- a/drivers/leds/leds-lm3692x.c +++ b/drivers/leds/leds-lm3692x.c @@ -337,9 +337,18 @@ static int lm3692x_probe_dt(struct lm3692x_led *led) return ret; } - led->regulator = devm_regulator_get(&led->client->dev, "vled"); - if (IS_ERR(led->regulator)) + led->regulator = devm_regulator_get_optional(&led->client->dev, "vled"); + if (IS_ERR(led->regulator)) { + ret = PTR_ERR(led->regulator); + if (ret != -ENODEV) { + if (ret != -EPROBE_DEFER) + dev_err(&led->client->dev, + "Failed to get vled regulator: %d\n", + ret); + return ret; + } led->regulator = NULL; + } child = device_get_next_child_node(&led->client->dev, child); if (!child) { -- 2.20.1