Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3431108rdb; Sun, 10 Dec 2023 05:39:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IEBolQ2Q0HMjLdhsG+ccM6vCGtc688e5EGLjCC/mDE0w5jwV3oILWgieiwVn/X7g8zCl9l5 X-Received: by 2002:a17:902:e749:b0:1d0:92a0:4914 with SMTP id p9-20020a170902e74900b001d092a04914mr1236683plf.84.1702215563683; Sun, 10 Dec 2023 05:39:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702215563; cv=none; d=google.com; s=arc-20160816; b=K88VSvxsdLdnb2q+wasbdbcKcWlFGwbLESl/A8sM+3aCcW/V/4tZZktmgMY37v7zOF QJl/0IUCZPZnTDLVLHwoQRPGjfC4c50lhyQWdzqp4XePEaahLpD1rlosN3N8CYJh7kJo Yhh8K8Cy8SkCeclQW9PZ5nW0K/6jK1V0XEObXsIDLvw0iB7q1w766AfXfobCWqH3fQGa IqYC0g4spfW2p+mfTOHFRRcn9lUjBkV9D4i1lDUGg+kEMnNlUSJJnHJ618VycpGLcnPl uGbkReEBU2+oIuzd6fxAzGensUkp+Hea7hmexQ0YYR0XM97VcxIN+mkm591aHJgc56wQ ik7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=CSvSABJG7uLYDZBA02OzUlHqFdlW+df+PCmVUmlwYqc=; fh=JP59zb28mRBFAoOP53jkh1BQcrTUxlt2+xTFXHNLV0Y=; b=iLla1DJhvaNu4YTgREv4PqoIPE0eEe+LLX/W07ohvJllnHliQMP575I4uRtadu0Onp /dnMJTOmCHLBZlKbCuaxmm6QtwkMHpSMpcYC5QK9NUIJ/o/VWO+mFMoeqw51P5HJOxnQ Rqn7aujsTiSyHHSpqFEoQmg5brQFjJCy4FEI+F1sC5vtJesd9uw3BoCL55Ug9Po8l/FT cErmtTQkYmjEQp/PWe/C2GbcVkM/7fWL5fAK6ehdTEC6DiAK3HyYgrfgQvl49SiO/68Y 32C9OXdio91TFKvmW0tBKPkC6VZTLqaOGBh8CG5ZwORiyEeFidmhhE4LzxO1rJdqJeLB bMjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c+u5501+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id bh8-20020a170902a98800b001c9c83947d1si4434073plb.645.2023.12.10.05.39.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 05:39:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c+u5501+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 2E3128078676; Sun, 10 Dec 2023 05:39:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232347AbjLJNjG (ORCPT + 99 others); Sun, 10 Dec 2023 08:39:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231778AbjLJNjF (ORCPT ); Sun, 10 Dec 2023 08:39:05 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 749D9FE for ; Sun, 10 Dec 2023 05:39:12 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE144C433C8; Sun, 10 Dec 2023 13:39:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702215552; bh=avQGx1khJq85b1wqGdR8Nraqua+bOgRavFBFOL0oL0g=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=c+u5501+Z7AkUNDfgRWa6dbaByLXiqMukJRuFtnLzBvS69MfOyQRkAM+xGjeeWelk S9Bx5gJ1HA+LuhPzWiJ9bcUCmR1ep71GdfXK06Q+MxJOwYdmXkp3MD4EwrsPdGOVta Uhk4ETWGtDWRX9GFuuArs7uHGE1OJXTsBVEQMMTEhqf6RKXFGrOQb1hSHBWeJn94ZN D2VePs2y/Dd6igp1wBhV1B/9CyDadpTyRYncVay7PE8VUSLipEYo7OCsw4W1WqiJ/w 1NCHHH7kXT14eHmCRyifkEqcHda3VrRqe+1CuPqSIXm1+DJ8CIRQMQCJ1izU1UbO1l 4thf5+f1Ee2Tg== Date: Sun, 10 Dec 2023 13:39:06 +0000 From: Jonathan Cameron To: Anshul Dalal Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, Conor Dooley , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , linux-kernel-mentees@lists.linuxfoundation.org Subject: Re: [PATCH v3 2/2] iio: light: driver for Lite-On ltr390 Message-ID: <20231210133906.3050a145@jic23-huawei> In-Reply-To: <20231208102211.413019-2-anshulusr@gmail.com> References: <20231208102211.413019-1-anshulusr@gmail.com> <20231208102211.413019-2-anshulusr@gmail.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sun, 10 Dec 2023 05:39:21 -0800 (PST) On Fri, 8 Dec 2023 15:52:10 +0530 Anshul Dalal wrote: > Implements driver for the Ambient/UV Light sensor LTR390. > The driver exposes two ways of getting sensor readings: > 1. Raw UV Counts directly from the sensor > 2. The computed UV Index value with a percision of 2 decimal places > > [NOTE] Ambient light sensing has not been implemented yet. > > Driver tested on RPi Zero 2W > > Datasheet: https://optoelectronics.liteon.com/upload/download/DS86-2015-0004/LTR-390UV_Final_%20DS_V1%201.pdf > Signed-off-by: Anshul Dalal I fixed up the case where you use dev_err_probe() in a path called from places other than the probe() callback. Applied to the togreg branch of iio.git and initially pushed out as testing for 0-day to take a look and see if it can find things we missed Thanks, Jonathan > + > +static int ltr390_register_read(struct ltr390_data *data, u8 register_address) > +{ > + struct device *dev = &data->client->dev; > + int ret; > + u8 recieve_buffer[3]; > + > + guard(mutex)(&data->lock); > + > + ret = regmap_bulk_read(data->regmap, register_address, recieve_buffer, > + sizeof(recieve_buffer)); > + if (ret) > + return dev_err_probe(dev, ret, dev_err_probe() is only intended for use in probe() and functions that are only called from probe() > + "failed to read measurement data"); > + > + return get_unaligned_le24(recieve_buffer); > +}