Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp797431rwe; Thu, 1 Sep 2022 07:47:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR6bRxhTHVM94kURFWaXdnXTmP2nq+KOFdI35cMr8yAlzIrXJO2plAh9gy8CUPEDOV3wWykE X-Received: by 2002:a05:6a00:2341:b0:538:2fca:4759 with SMTP id j1-20020a056a00234100b005382fca4759mr20316189pfj.28.1662043658374; Thu, 01 Sep 2022 07:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662043658; cv=none; d=google.com; s=arc-20160816; b=pCycIgq9KdI9qNMXs20fWaFVOAPMJIPbYeaVr/wkSdD+GcVcf75BmwLbY8CwSnORm0 v1uniNZKgAP0ik4iud6w7Vgwu/VQLxMwrSicxZpYgRUgv1FbHpyMgRyQtU2BfRBurqXv 4iNu1fDZ9dS+WkWSFG43Z5Vt4o4BMaMA4zxqvO8BCoi+J35mUWYn2yvB7/nu8yDmpDVn Tpx5HF1xXhKlihGiDe/iV0CrJEV8FOISrjfjOmEfp1hK5/zNRk0hp28ZTJYazyqn2wbs fNKb6qGAioH+QhLxugtqGbRQiJItqRHkZ8sHuPjz3zmz7H7y2dJLv2BWgDESC/LGKv4D Ipmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:sender:dkim-signature; bh=eFXvBBMNEEghXLQat18msWPtHrh19tRiTeT65ddGseE=; b=fqw9NCAnnKTe4U51AKeSJZ3LX2NLpdF0opuZIQeDSU/9AFEsVP/WDIdjT7tg5wAzCa bf5vTDYhW1oKKV8BUWZdickOZU6O792nnz6kBkdaHVs1WPWAanISsVJjRGWZ+jZPRrDz gLFCiAweF/fi886LgVIV3xL977mvAn8NJ8eQNm/76sVG1ecrbQgjxgOjRyEC6UQUwcJ/ 48iKy8ltFSL5jrBATxnLIN49OjXe2jbA+PDFWZh4Oe7PDmzsQo43qXrV13h7f2L/h3Tu Z0K4y2jhGG8GtECnNSMAV8ThiQ58izpBbAY2BKD7WKVJ1Yd/66qeHcXMhqtq0Cq9iS34 +Z4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eOzHQG4b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mw4-20020a17090b4d0400b001f31da6b2d2si5122194pjb.154.2022.09.01.07.47.17; Thu, 01 Sep 2022 07:47:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eOzHQG4b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234702AbiIAO3J (ORCPT + 99 others); Thu, 1 Sep 2022 10:29:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234868AbiIAO2s (ORCPT ); Thu, 1 Sep 2022 10:28:48 -0400 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAEC66B154; Thu, 1 Sep 2022 07:28:44 -0700 (PDT) Received: by mail-pg1-x529.google.com with SMTP id bh13so16542565pgb.4; Thu, 01 Sep 2022 07:28:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :from:to:cc:subject:date; bh=eFXvBBMNEEghXLQat18msWPtHrh19tRiTeT65ddGseE=; b=eOzHQG4b4dp+fdDR3chQsix8YHi0GhSy0VJxAZyOXW5iv4W+uW7IMvCRBnEpGiLKAR TrV8/7LFKaL1iIW3CxLpt6mBTdagjJqnJguOh/Uo4uA5vCQCn8p1uhNzB8oyJjXziK9a OQBSuJJCUzR1RnD1esKAYNaH/NvtFJ/jnxwooOiXHZ2LfzD8mYoC4ddQTDQMUVcGxVyp CMiCec+Fq4B6Y2a18jwc27sFPXi0PwMmzLW/KtjTFICr6rq7p6oAj1O9U0UginPDysKF Az1OiFGOWV7jOPMC7H6jwLWBHgF19r8XOwmDrPJs+FvFC0pXxCkYvaYTAp6XccLkySA3 Mtyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date; bh=eFXvBBMNEEghXLQat18msWPtHrh19tRiTeT65ddGseE=; b=NWbM8P+dBsnElBqcDPdvYGqvvhmbnEFkNzbVU/A52WSikTqTKWQ57o3dH+cIvOGhCa nDb84OK9MK3AnCzdj9Iz11/uW0CSxDBqlx55uFITwFCzYuHdwL0vNrzf26PbVZZVwFmz NOa6AOSzhPWro3qaxL7HGf4Rm03pK4F6k+4K80m7oENixXQYW4EoeF7+P+OIPl0arv91 Zm7pnPdJlZXAWFRB2G6qdWJTJMpewTOOcODxZnwBZEwhKanXUf8NycnyFpJwEpV/sBge ObSr7JUZvRvUGAVBJEd6+/Hd8FA+KnCyxZBv9vZnayBMxKGhFBsjS1EPI18TOdGbhGnL /DCQ== X-Gm-Message-State: ACgBeo12cAwvuz4zL2xdD4S4qm2gbFxPk/bXssR686F8jmEq1TNN1KNe oBepjXF8M/OhOKm+DnOcL8Y= X-Received: by 2002:a63:fc11:0:b0:430:41b4:acf5 with SMTP id j17-20020a63fc11000000b0043041b4acf5mr5826867pgi.408.1662042523411; Thu, 01 Sep 2022 07:28:43 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id i72-20020a62874b000000b0052e987c64efsm13849428pfe.174.2022.09.01.07.28.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Sep 2022 07:28:41 -0700 (PDT) Sender: Guenter Roeck Date: Thu, 1 Sep 2022 07:28:39 -0700 From: Guenter Roeck To: "Farber, Eliav" Cc: Andy Shevchenko , jdelvare@suse.com, robh+dt@kernel.org, p.zabel@pengutronix.de, rtanwar@maxlinear.com, linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, talel@amazon.com, hhhawa@amazon.com, jonnyc@amazon.com, hanochu@amazon.com, ronenk@amazon.com, itamark@amazon.com, shellykz@amazon.com, shorer@amazon.com, amitlavi@amazon.com, almogbs@amazon.com, dkl@amazon.com Subject: Re: [PATCH v3 18/19] hwmon: (mr75203) add debugfs to read and write temperature coefficients Message-ID: <20220901142839.GA3477025@roeck-us.net> References: <20220830192212.28570-1-farbere@amazon.com> <20220830192212.28570-19-farbere@amazon.com> <646af681-38b0-1268-3798-c5434ca30bee@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <646af681-38b0-1268-3798-c5434ca30bee@amazon.com> X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 01, 2022 at 09:54:21AM +0300, Farber, Eliav wrote: > On 8/31/2022 3:14 PM, Andy Shevchenko wrote: > > On Tue, Aug 30, 2022 at 07:22:11PM +0000, Eliav Farber wrote: > > > This change adds debugfs to read and write temperature sensor > > > coefficients > > > - g, h, j and cal5. > > > > > > The coefficients can vary between product and product, so it can be very > > > useful to be able to modify them on the fly during the calibration > > > process. > > > > > > e.g.: > > > > > > cat /sys/kernel/debug/940f23d0000.pvt/ts_coeff_cal5 > > > 4096 > > > > > > echo 83000 > sys/kernel/debug/940f23d0000.pvt/ts_coeff_g > > > > ... > > > > > +???? pvt->dbgfs_dir = debugfs_create_dir(dev_name(dev), NULL); > > > > > +???? if (!pvt->dbgfs_dir) { > > > +???????????? dev_err(dev, "Failed to create dbgfs_dir\n"); > > > +???????????? return -EINVAL; > > > +???? } > > > > No, just don't check the return value of debugfs API calls. > > > Do you mean that I should just do: > debugfs_create_dir(dev_name(dev), NULL); > Can you please explain why it's OK to ignore the return value? > Because that is how debugfs code is supposed to be implemented. Other debugfs code checks if the dir parameter passed to it is NULL and do nothing if it is. This reduces code size overall by avoiding unnecessary error checks. Guenter