Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp487438rwe; Thu, 1 Sep 2022 03:04:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR4kDJssA7k42nZqfL/Y13BJd5VUg9pkFQBitZXuwp3ICCXLpKyxlp9k6hSMM/OxFG07FfYB X-Received: by 2002:a05:6402:34cd:b0:448:8286:23f0 with SMTP id w13-20020a05640234cd00b00448828623f0mr14343875edc.40.1662026649689; Thu, 01 Sep 2022 03:04:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662026649; cv=none; d=google.com; s=arc-20160816; b=HAsQLWw5kXNWkX8dVemrdmevC521W8vAg3MmIctOwEqDK23kuWYJClhnkkLIQVjA5y /T2qhl9Cgp2oU/6pvfpwf+cKuTJsjljC2+UG05ytN7PJASKKKC+1VvC2uR/7Smz8bJ77 Xmu1n/c4zxFV85VVCKNRzyXjZPn0mBp93nI3jgAIHh2ou9mjgngqllkKWJCK9OQza2IG HzkIrqeyFpWj+MMHILrWVpzIfgSS/P5N3X/9D1HVjeC1gy+BxhOZyYOchrGwcPtKAL+w AHAkIRpHu5zoRmNKBw1Cgk/zsaHFCIejg9JI3LU4NVnlJrjpnTQmIcji6aXUSlfXARyc e0ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:user-agent:mime-version:date :message-id:subject:dkim-signature; bh=NX3N/paYyQqUhforgxYacBUvwbAZreQsVJx7Uym+9Mc=; b=w3fdMCGek2f5voIL24Bkr9p94UOs13vNKd8dODZbNXZP4N8TR0+nuYVEoS0e3caeSl 5Ird5/aYlV33TQwi7xY7fybE45w/4d+nnKfiEhX96qnE8Df7ojxFO9kkrCzmFtYPrJ3R MPZrgrMcQJ8ykH63z3vQ2hjHE9RtrmjJcID69cCDqOBtqB9FPvWdyZkVZM0QXf8jViBA LBG3q1qV6+7equiPAG1zk69cFIBZmwgeWBelxnRzVGR5Etc47k4iR0ouZV1aIaEcvbYh iCorrWVRBjgJKFd5psobhVJzhvsmKydgLCGzgO/qxdWjJHfpcoJ7X0dNzQzcsR09ma3S klEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=AlEW7bea; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd13-20020a1709069b8d00b00730e5c46ed9si14321727ejc.15.2022.09.01.03.03.30; Thu, 01 Sep 2022 03:04:09 -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=@amazon.com header.s=amazon201209 header.b=AlEW7bea; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233046AbiIAJzB (ORCPT + 99 others); Thu, 1 Sep 2022 05:55:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233997AbiIAJy5 (ORCPT ); Thu, 1 Sep 2022 05:54:57 -0400 Received: from smtp-fw-9102.amazon.com (smtp-fw-9102.amazon.com [207.171.184.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 607DF133; Thu, 1 Sep 2022 02:54:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1662026094; x=1693562094; h=message-id:date:mime-version:to:cc:references:from: in-reply-to:content-transfer-encoding:subject; bh=NX3N/paYyQqUhforgxYacBUvwbAZreQsVJx7Uym+9Mc=; b=AlEW7beam5cKi6q9nIgO9MzwfSNljBYHImX3bgbC5BVDwmDs03s2ujpK zdYHdgGZCIysDlKjhOGcrNS/auEAfvBwxB/Zy4Kid0Ee4Gpuj1R7ilson vHXu0vZN+de77RUNPV7zPxYB09z6fffek82wxpRZzSaSZL4iEpmVquE98 4=; X-IronPort-AV: E=Sophos;i="5.93,280,1654560000"; d="scan'208";a="255127260" Subject: Re: [PATCH v3 17/19] hwmon: (mr75203) parse temperature coefficients from device-tree Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO email-inbound-relay-pdx-2c-51ba86d8.us-west-2.amazon.com) ([10.25.36.210]) by smtp-border-fw-9102.sea19.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2022 09:54:35 +0000 Received: from EX13MTAUWA001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-pdx-2c-51ba86d8.us-west-2.amazon.com (Postfix) with ESMTPS id 00471121491; Thu, 1 Sep 2022 09:54:34 +0000 (UTC) Received: from EX19D013UWA001.ant.amazon.com (10.13.138.253) by EX13MTAUWA001.ant.amazon.com (10.43.160.58) with Microsoft SMTP Server (TLS) id 15.0.1497.38; Thu, 1 Sep 2022 09:54:33 +0000 Received: from EX13MTAUWB001.ant.amazon.com (10.43.161.207) by EX19D013UWA001.ant.amazon.com (10.13.138.253) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1118.12; Thu, 1 Sep 2022 09:54:32 +0000 Received: from [192.168.93.228] (10.85.143.172) by mail-relay.amazon.com (10.43.161.249) with Microsoft SMTP Server id 15.0.1497.38 via Frontend Transport; Thu, 1 Sep 2022 09:54:27 +0000 Message-ID: Date: Thu, 1 Sep 2022 12:54:26 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 To: Andy Shevchenko CC: , , , , , , , , , , , , , , , , , , , "Farber, Eliav" References: <20220830192212.28570-1-farbere@amazon.com> <20220830192212.28570-18-farbere@amazon.com> Content-Language: en-US From: "Farber, Eliav" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_SPF_WL autolearn=ham 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 8/31/2022 3:11 PM, Andy Shevchenko wrote: > On Tue, Aug 30, 2022 at 07:22:10PM +0000, Eliav Farber wrote: >> Use thermal coefficients from the device tree if they exist. >> Otherwise, use default values according to the series (5 or 6). >> All coefficients can be used or only part of them. >> >> The coefficients shall be used for fine tuning the default values since >> coefficients can vary between product and product. > > ... > >> +     ret = of_property_read_u32(np, "moortec,ts-coeff-h", &coeff_h); > > of_ ?! Ditto for the rest. Fixed for v4. I replaced it with device_property_read_u32(). >> +     if (!ret) >> +             ts_coeff->h = coeff_h; > > ... > >> +     ret = of_property_read_s32(np, "moortec,ts-coeff-j", &coeff_j); >> +     if (!ret) >> +             ts_coeff->j = coeff_j; > > You may avoid conditional: > >        _property_read_s32(..., "moortec,ts-coeff-j", &ts_coeff->j); Fixed for v4. I removed the condition. > ... > >> +     ret = of_property_read_u32(np, "moortec,ts-coeff-cal5", >> &coeff_cal5); >> +     if (!ret) { > >> +             if (coeff_cal5 == 0) { >> +                     dev_err(dev, "moortec,ts-coeff-cal5 can't be >> 0\n"); >> +                     return -EINVAL; >> +             } > > Code shouldn't be a YAML validator. Drop this and make sure you have > correct > DT schema. Fixed for v4. I dropped the validation check. The YAML already mentions that it can't be 0. >> +             ts_coeff->cal5 = coeff_cal5; >> +     } -- Thanks, Eliav