Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11786270pjo; Thu, 2 Jan 2020 14:15:41 -0800 (PST) X-Google-Smtp-Source: APXvYqxMuPZz9TsLucvVNXEx47uBMfHoNc4EBOLrmfrjlskLm59/EB8chmVv77g/lgPLSaDOuzx9 X-Received: by 2002:aca:d887:: with SMTP id p129mr2949345oig.51.1578003341342; Thu, 02 Jan 2020 14:15:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578003341; cv=none; d=google.com; s=arc-20160816; b=E9tkGgmNuGTvfdEHnQXyiDWab4ReobqHG/GaQB4UMG2W9hM1ow+lm2q8lbKv9Rd7cW /A+iuTvmCDh8HAgI4arZbpkJnnFrOOQi9CiDr02Oi0dbrwyjmkRmPQXeJQkI6zaJDGHj RxH8bUkOm8eTqRORJ2ol9X1p6q/B5moibwiqdtYnY+KiAm17OnFHAQzDTH3l3aUFZWbd 8hw9Ncis1JrURnl4pXpagxUDdAIGszoe7S2Lp8JajByRII02YZ1Ckc46wwvXYVzvJmAZ mJwF0oeC+eq6SyDSe7uDrT9VPeiZpWp/IDZLobiLRIqgHNQFHCxfFGfY7WdRgGGEfbM6 CQNQ== 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=KxTyg7+O6zJFpgL99xyraEGxK/UK62IDYFUrJNvwGZE=; b=mLNCkltrh8gLfbLOIl4IgWELCPAxxq+wg5rY8hCyyn4kO03DoQvI7cQvOBtSCKhCfc iH5caAQmr8qRcmqH0i3KHxHrOf3xp4celvj0L9CIA9NElYLLHFT8/aW0ZTKqnbwEJCAX t3toci81WPaw2saaROWz0EgapDJq48xl86wDxVo6VHhC1vOMOZ6hgzJX/pBgCaKpt2dO Kh/8NIWoU7p5ur2YIpIygcO+e1qUmvrh7soMsiuxgN+82cIzY5uaYV50S6UUDZYtIRpQ sVMDSamRRovpZ36wLLJmB7+De30IH4u8qQasa6aOm5t7p9PHttXEjPhAVR4aJV7hF1El MUkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2AWkWagY; 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 17si12557235oix.22.2020.01.02.14.15.28; Thu, 02 Jan 2020 14:15:41 -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=2AWkWagY; 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 S1727656AbgABWNQ (ORCPT + 99 others); Thu, 2 Jan 2020 17:13:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:52862 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727632AbgABWNO (ORCPT ); Thu, 2 Jan 2020 17:13:14 -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 B64F921835; Thu, 2 Jan 2020 22:13:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003194; bh=bWieScTR+nkzZ01MDW5D8dk3AkB7khdSa4/5ypypEc8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2AWkWagYhhpk8FRPTIdIBYb+HVZTP4E2iOmnjbDw6YyKg6Yn24Qg8RVF0p5w3tkB7 x0MduW1yNNSIKofHM3aUvIdoiUaf5/z8ax6AKxEAV2j9XCtfXv04mj+1De2mwobPyG I6jc1ygchPgz9W+pl8V0FdqYjB7uYS27zwZW2DmA= 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 5.4 033/191] leds: lm3692x: Handle failure to probe the regulator Date: Thu, 2 Jan 2020 23:05:15 +0100 Message-Id: <20200102215833.543600929@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@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 3d381f2f73d0..1ac9a44570ee 100644 --- a/drivers/leds/leds-lm3692x.c +++ b/drivers/leds/leds-lm3692x.c @@ -334,9 +334,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