From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E90DD396B9A; Tue, 2 Jun 2026 19:02:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780426968; cv=none; b=HAkrkCiF+7AKC1b4vAVEfk3s3LWti/xVTcy1yga3yMVaCWZbwzyw0kpEbWSuvpAV2NNa/lrZtZGyPhoRyNC5Oykfrq7eTewRnEaJ8NBIkm2OfPvlxwR0ZM/urQUz0nTt5m+dg+CKNNV3BrtYgXWgM9OsN9gpLEVu0txN189lCMc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780426968; c=relaxed/simple; bh=/u1xXNGlVpEJUvCd6E2pa3ofnqfvGpTtYoYhyqQ+eWE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=drYHWJHUCyg5Tv8MyBYTYyAmaNsk0Hqw8K+OQ0Z/G3OxtMJO9KkxhQL3tv24fU9cbArULdPOvGq4QrTrn1uhdjlLyOhTMj0WA0TNvK/RfFMQmw4E9W0RbmO1Fbxo77MxDMwCN7ICGj6rSzYZJY3+oHIfqVkFyv21EWdvg+AMS78= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=B1hnLdFg; arc=none smtp.client-ip=192.198.163.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="B1hnLdFg" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1780426966; x=1811962966; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=/u1xXNGlVpEJUvCd6E2pa3ofnqfvGpTtYoYhyqQ+eWE=; b=B1hnLdFgypGxed3bwN0Uy1ko3Im1shCAEsviyXnzXTe1BCViqjfMGjVc vk0zgNxgPFPQJHhwwk6tOFTlAdNktV4TaeaztbIA/aivBYK6ck18kHH8c XRHhdHiTOEWcCD5sV+0BRZsXYeajLusFd03wPGalGiFBF0cWQOTT+qGGf bgwwMKTbEhdheYlG67UUbsg6QFilo/TCEUMzs0VCoY6da+ZJx3jl1ZxX/ ZPOWf/VayKEI9oE9gKVvVPXx22MhbcRtKBvXnDHgEMvCorEI0otQ7d6DF ES+at4XDnaXCQKXLBQFXqjYxQDIUllCg0gg2eQ3jhIkzjbvADUbevsHJo Q==; X-CSE-ConnectionGUID: hcNyYqVLSZ2veQ05qF3A2g== X-CSE-MsgGUID: jFx8dJgqQUWORQ29mtPiag== X-IronPort-AV: E=McAfee;i="6800,10657,11805"; a="92604261" X-IronPort-AV: E=Sophos;i="6.24,183,1774335600"; d="scan'208";a="92604261" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2026 12:02:45 -0700 X-CSE-ConnectionGUID: fEA8PSRYRTyo2m39nk+amw== X-CSE-MsgGUID: mBgqNq96RlWugG4ZhGL6Tg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,183,1774335600"; d="scan'208";a="245804668" Received: from mkosciow-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.245.229]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2026 12:02:41 -0700 Date: Tue, 2 Jun 2026 22:02:39 +0300 From: Andy Shevchenko To: rodrigo.alencar@analog.com Cc: Michael Auchter , linux@analog.com, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Michael Hennerich , Jonathan Cameron , David Lechner , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , Kees Cook , "Gustavo A. R. Silva" Subject: Re: [PATCH 05/12] iio: dac: ad5686: add support for missing power supplies Message-ID: References: <20260602-ad5686-new-features-v1-0-691e01883d27@analog.com> <20260602-ad5686-new-features-v1-5-691e01883d27@analog.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260602-ad5686-new-features-v1-5-691e01883d27@analog.com> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Tue, Jun 02, 2026 at 05:33:52PM +0100, Rodrigo Alencar via B4 Relay wrote: > > Get and enable regulators for vdd, vlogic and vref input power pins. Vdd > is the input power supply, while vlogic powers the digital side. vref is > replacing vcc, which is being deprecated, but still supported. The value > of vref_mv is checked so that a device without internal voltage reference > cannot proceed without an explicit supply. For correct operation, vdd and > vlogic are required, then devm_regulator_get_enable() is used so the > driver can still work without them by using the stub/dummy regulators. > Error report uses dev_err_probe(), which helps debugging an init issue. ... > + ret = devm_regulator_get_enable_read_voltage(dev, "vref"); > + if (ret == -ENODEV) /* vcc-supply is deprecated, but supported still */ > + ret = devm_regulator_get_enable_read_voltage(dev, "vcc"); > if (ret < 0 && ret != -ENODEV) It can be deduplicated now with else if (ret < 0) > - return ret; > + return dev_err_probe(dev, ret, "failed to read vref voltage\n"); > > st->use_internal_vref = ret == -ENODEV; > st->vref_mv = st->use_internal_vref ? st->chip_info->int_vref_mv : ret / 1000; > Drop this blank line as the assignment and check are coupled. > + if (!st->vref_mv) > + return dev_err_probe(dev, -EINVAL, > + "invalid or not provided vref voltage\n"); -- With Best Regards, Andy Shevchenko