From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 99488C44500 for ; Fri, 3 Jul 2026 09:55:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C323710E5AC; Fri, 3 Jul 2026 09:55:27 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="dyh2XrQW"; dkim-atps=neutral Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id AFC4910E5AC for ; Fri, 3 Jul 2026 09:55:26 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 18AB96001A; Fri, 3 Jul 2026 09:55:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC5AF1F000E9; Fri, 3 Jul 2026 09:55:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783072525; bh=YpZ1jfCWhrVBcLjBi9vDokGbQRvmdQp3uAcCE7337Xk=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=dyh2XrQWeiEVFwIupCu8VvprLM0VyKHl84pR00aKeg+cAMJUq9hiOSn4OSBgRwpxF Hfl45KLAqY84ELk2Vg8bEuk6RVCOswSlgMfLc8tsAG7sPZXopuI4Ay7fvxsFxu7i8v Y56smDvKTM1lZIIqmENZ6Pvq/SLQ/3rIZn6SN5Uwqp9I3AcSOpilh/mNry1gEIXaM9 4zvns/YNjW7wGY/qzHI0/rdfsFhKcGF+ZN+yGa9E1KGcBX8w64joEdSy++LyFsXvPY BRacyv5IKFgPT+9EAIzlnZToHYqi+xlDLiGyihmYFLUr1QtNJyXSPOQ7mgFx1wLHZp yfSwghHm754ww== Received: from johan by xi.lan with local (Exim 4.99.3) (envelope-from ) id 1wfacF-00000000i1C-1qOY; Fri, 03 Jul 2026 11:55:23 +0200 Date: Fri, 3 Jul 2026 11:55:23 +0200 From: Johan Hovold To: Svyatoslav Ryhel Cc: Lee Jones , Daniel Thompson , Jingoo Han , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Cameron , David Lechner , Nuno =?utf-8?B?U8Oh?= , Andy Shevchenko , Helge Deller , dri-devel@lists.freedesktop.org, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-fbdev@vger.kernel.org Subject: Re: [PATCH v5 05/14] iio: light: lm3533-als: Remove redundant pdata helpers Message-ID: References: <20260617080031.99156-1-clamor95@gmail.com> <20260617080031.99156-6-clamor95@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260617080031.99156-6-clamor95@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed, Jun 17, 2026 at 11:00:22AM +0300, Svyatoslav Ryhel wrote: > The lm3533_als_set_input_mode() and lm3533_als_set_resistor() functions > are used only in lm3533_als_setup(). Incorporate their code into > lm3533_als_setup() directly to simplify driver readability. That's a debatable claim. > Signed-off-by: Svyatoslav Ryhel > --- > drivers/iio/light/lm3533-als.c | 56 ++++++++++------------------------ > 1 file changed, 16 insertions(+), 40 deletions(-) > > diff --git a/drivers/iio/light/lm3533-als.c b/drivers/iio/light/lm3533-als.c > index a9af8e2b965f..69bac1b202f1 100644 > --- a/drivers/iio/light/lm3533-als.c > +++ b/drivers/iio/light/lm3533-als.c > -static int lm3533_als_setup(struct lm3533_als *als, > - const struct lm3533_als_platform_data *pdata) > -{ > - int ret; > - > - ret = lm3533_als_set_input_mode(als, pdata->pwm_mode); > + pdata->r_select); > if (ret) > - return ret; > - > - /* ALS input is always high impedance in PWM-mode. */ > - if (!pdata->pwm_mode) { > - ret = lm3533_als_set_resistor(als, pdata->r_select); > - if (ret) > - return ret; > - } > + return dev_err_probe(dev, ret, "failed to set resistor\n"); > return 0; > } There's nothing hard to read about the above. To the contrary the logic is more obvious this way. You also remove the high-impedance comment for no good reason. Johan