Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1406890rwb; Fri, 19 Aug 2022 03:12:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR6MpMyUX8gU4u5xmu/WMKJB0KNjzJDP8I+BxKC9tHawrhsyKJgU9RbW1Y6xZkCPd9hYry2i X-Received: by 2002:a05:6402:198:b0:442:da5a:6716 with SMTP id r24-20020a056402019800b00442da5a6716mr5472629edv.5.1660903931603; Fri, 19 Aug 2022 03:12:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660903931; cv=none; d=google.com; s=arc-20160816; b=rgnnkygcrS3tBs8dwMER5WLVDfGWXCXcBc7jGvfrKSKrZSL+Izya7kawzayMxrUPFi e9x/0SvaiIcCHVPynAA8UvwoGGeeUwtYnl2Cc1kKE+cOPGeDZTmTbs6VmFxE5js+QGco UOIqCL2XNMK3q5loJibbgGSGIsfK6/ZfYtwuHwr+RVViwBWCTs9mpru4cGv7SbGay8Uz caWCE1nB7wv1LyjaNEiTJkosX7xGzpwssba9hSO/E/RHgTUkCi/JLoJuf7lRCqtlerBJ P1wtvGFZ5LSrMaK5T+ESuL/j7UrbeyT6Y63k57GCq9QRy2n4IrPquTQ/6PkM5K9jllh0 36Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=/WIizd4+ASdkLn8xaORlftblvX7iF24VmukZ5lVBNU8=; b=fUVKoPkkGwAxmLNZVLhYJNuk0pWuNxQmz3AdiPk1L8T7bTfDnAlHXwbj4TYBhXxKU5 Pl9iaZq3sT311iRwNgKEan0KpGybgtTO5xfuNqUav0sD41TtQ0AfmZK3eXelu7cRLem2 AnvAiPduEB6/X3T2tDokB/Yz+tMCIkamMaeyXmtfaK7xH0UYzxYotZe9TgYhUJXdObxG gor9yXY6sCOrq1Ar891qyDff0uI9QdpPmIpjOntczOAjqPIDRr6HlBh/Q5v2OBMG5K6E b3ANlEF0uWIMjgfjYDHu4SgF5FiRIu00PAomAWGb2YtB5x5rgKN0b2TWWBMk/yNmfe5q XpXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WBQ19U1D; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c19-20020aa7d613000000b0043d0b64b70asi2586730edr.43.2022.08.19.03.11.45; Fri, 19 Aug 2022 03:12:11 -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=WBQ19U1D; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348289AbiHSJ6P (ORCPT + 99 others); Fri, 19 Aug 2022 05:58:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348306AbiHSJ57 (ORCPT ); Fri, 19 Aug 2022 05:57:59 -0400 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A811F4C9B; Fri, 19 Aug 2022 02:57:19 -0700 (PDT) Received: by mail-qk1-x734.google.com with SMTP id g16so2907633qkl.11; Fri, 19 Aug 2022 02:57:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc; bh=/WIizd4+ASdkLn8xaORlftblvX7iF24VmukZ5lVBNU8=; b=WBQ19U1DAzER9eiwrktnTik/2a3VJg3p0hPXXGFvEam0lUqNY7eD/DPZxcH4tnq3hs Kunc2r3YYnuK5MerOwDWN0gKBAFIak8Ry5LelPAGykEL9WcYIO+IJEIpFRn6Emr98geP DhXIXt/a3b9aqVP7/k3K11McCsl4noX7ErwTvu9wbAdthR4OkhScsX2AVz1SDeh+vI4y FzV4wE8pOJ4QK39BIDTOoUbgAqXbWKWNf8BiK2TYQtR+rfV0GUML9oScRLqAtANjxv4B 9KkopgiiCNa/LH/tTbhjgOhl8BmxzI2OBawfSRzZ4D6AW9U+x7oNK59HuRwRJ5f+TEz7 texQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=/WIizd4+ASdkLn8xaORlftblvX7iF24VmukZ5lVBNU8=; b=p9nT5/eSF9r6oP8cKgdq4CgJcPg9DM48mRNEnfiPmDuGdPP7vQe9Cd9dxvKoRQeKhq J8fYZhS0KzQl+i+Twr1iMYbAqi4aZgLaFRXxhBHZuOd0Mj/CjlZ4Eu8nJGKO4e7+J0sR 5BqmPQAt2/abbgeILoLi/Y6gi6zBevizjWDexZJTb2wz/Xr8meplfIz31ROO4C1dliEw AvudU6fHpMU4/MsIsWsOIAaXbOxWYDEGw2DMnJMTuVyxAQoOlEyun74TFXu0r4+HOmyI OqR/8NgpO5BatfxdluyEzG7fi026OxOgOIv6nQphbXCHu1wnYfuU/MxAK4EWwP9ReM8P hDuw== X-Gm-Message-State: ACgBeo2twVdL6fKj8bg8cQBKzANd6eRV5HTIaEdaMicVIOVEk/nhuWon 0gRRbdoEEfQVNrDXo+HzIbBYWHo/buNMWQdQ5BE= X-Received: by 2002:a05:620a:2987:b0:6ba:dc04:11ae with SMTP id r7-20020a05620a298700b006badc0411aemr4696051qkp.748.1660903038316; Fri, 19 Aug 2022 02:57:18 -0700 (PDT) MIME-Version: 1.0 References: <20220806152517.78159-1-andriy.shevchenko@linux.intel.com> <20220818232040.GA3505561@roeck-us.net> In-Reply-To: <20220818232040.GA3505561@roeck-us.net> From: Andy Shevchenko Date: Fri, 19 Aug 2022 12:56:42 +0300 Message-ID: Subject: Re: [PATCH v1 1/3] hwmon: (pwm-fan) Make use of device properties To: Guenter Roeck Cc: Andy Shevchenko , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Linux Documentation List , Linux Kernel Mailing List , linux-pwm@vger.kernel.org, linux-hwmon@vger.kernel.org, Jonathan Corbet , Thierry Reding , Jean Delvare , Bartlomiej Zolnierkiewicz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Fri, Aug 19, 2022 at 2:41 AM Guenter Roeck wrote: > On Sat, Aug 06, 2022 at 06:25:15PM +0300, Andy Shevchenko wrote: > > Convert the module to be property provider agnostic and allow > > it to be used on non-OF platforms. > > > > Add mod_devicetable.h include. > > > > Signed-off-by: Andy Shevchenko > > Acked-by: Uwe Kleine-K=C3=B6nig > > I had another look at this patch. A substantial part of the changes > is because device properties don't support of_property_read_u32_index(), > reworking the code to use device_property_read_u32_array() instead. > Sorry, I don't like it, it results in a substantial number of unnecessary > changes. Device properties should support the equivalent of > of_property_read_u32_index() instead to simplify conversions. Not all (device property) providers can have such API available. Are you suggesting to a) alloc memory for entire array; b) cache one for a given index; c) free a memory; d) loop as many times as index op is called. Sorry, this is way too far and non-optimal in comparison to the substantial number of unnecessary changes (two or three small refactorings?). Another way is to provide a pwm-fan-acpi, which will be the copy of the driver after this patch is applied. I don't think it's a very bright idea either. --=20 With Best Regards, Andy Shevchenko