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 52745C43602 for ; Thu, 2 Jul 2026 16:13:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 965AD10EA45; Thu, 2 Jul 2026 16:13:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="iGC65vUG"; dkim-atps=neutral Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id D0D4010EA45 for ; Thu, 2 Jul 2026 16:12:58 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 9D39242A03; Thu, 2 Jul 2026 16:12:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4CEC1F000E9; Thu, 2 Jul 2026 16:12:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783008777; bh=jgZ5PGASijShP5pC5l8zHhdOpozcuS9KxV5TuCHWvA4=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=iGC65vUGDqogOIGJx6iAzvePK4nQgsbNW6n2puBfcxRlF/iW6l85Ti0n4337btxCs AAhgmXx0m+4kppoTDcvJUeuFBYvHbveuMHtPWIDt/aLgi/W5g766w4uHI4NCNLbY+Y o55EovSIK51IrXtGhUckpB+JwHC/yjMiyxVG9I3HanKrV69OXNsstHmewI3Lk7N+9H pr04fOotyHQtLJ29VRJPP56stS74kaIr7IL2eOM6AeMlWINKJJ75OVokh38/8Auf08 9hDw9O4qyE8W2H15CY0fDS69UReoN+tPNueMI79ooE1XbbQNBgcic36HvhYi35cUzn 8Vdoq7K2fGplg== Date: Thu, 2 Jul 2026 17:12:51 +0100 From: Lee Jones To: Andy Shevchenko Cc: Svyatoslav Ryhel , Daniel Thompson , Jingoo Han , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Cameron , David Lechner , Nuno =?iso-8859-1?Q?S=E1?= , Andy Shevchenko , Helge Deller , Johan Hovold , 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 02/14] mfd: lm3533: Remove driver specific regmap wrappers Message-ID: <20260702161251.GA2108533@google.com> References: <20260617080031.99156-1-clamor95@gmail.com> <20260617080031.99156-3-clamor95@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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, 17 Jun 2026, Andy Shevchenko wrote: > On Wed, Jun 17, 2026 at 11:00:19AM +0300, Svyatoslav Ryhel wrote: > > Remove driver-specific regmap wrappers in favor of using regmap helpers > > directly. > > OK, let's go with this variant. > Reviewed-by: Andy Shevchenko > > Some side notes below for the record. > > ... > > > struct lm3533_led *led = to_lm3533_led(led_cdev); > > unsigned enable; > > Oh, besides using the old way of declaring unsigned int, it most likely > just needs to be kstrtobool(). > > > u8 reg; > > - u8 mask; > > - u8 val; > > int ret; > > > > if (kstrtouint(buf, 0, &enable)) > > return -EINVAL; > > We should unshadow error codes (it may return more than -EINVAL). Right, this masks -ERANGE. We should fix that. > > reg = lm3533_led_get_lv_reg(led, LM3533_REG_CTRLBANK_BCONF_BASE); > > - mask = LM3533_REG_CTRLBANK_BCONF_ALS_EN_MASK; > > > > - if (enable) > > - val = mask; > > - else > > - val = 0; > > - > > ... > > > - if (kstrtou8(buf, 0, &val)) > > + if (kstrtou32(buf, 0, &val)) > > return -EINVAL; > > Like in the previous case we should unshadow error codes. > > -- > With Best Regards, > Andy Shevchenko > > -- Lee Jones