Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp572616rdb; Thu, 19 Oct 2023 12:24:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEmBwyLuaP6dDp585McS45VzfFp/ZVNzz/4wyX+SuXkA2b4f3ODr+8VhzuMk0Gz9qiPB4jg X-Received: by 2002:a17:90a:6d42:b0:27d:247b:2c3c with SMTP id z60-20020a17090a6d4200b0027d247b2c3cmr3215791pjj.23.1697743493669; Thu, 19 Oct 2023 12:24:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697743493; cv=none; d=google.com; s=arc-20160816; b=VeNzgQ27TDYfpMlx5Mox0nQqbNN60qNOPoxQVIkr6aQzRO1/0N5IQyq8Yb3Khx+42i 69KEjxpl/vJUDq8XKBbFRVMKsxBdoK1axFnUxL5ZA+r96OidCzz0Ib7Qy1WmdoSNNH1a EIvPCQFyfRVFh0b206+xyYVdKcyp6OZCNVel4yjG110Hd7zcdaI3i6kdQOhoUNFJV4Jw rYYdUPBY+mcXSDQe3v3GT+39CONYs67uxsCh46uIc5PUDBR95/+dZhGOQVp35KB77Wke lPh7nvovPGUjjcfkPCZ/dO0hoRco82s7Izp14/SZWfWHOfuD3PDYZWptH5YfffaXTQEs tdcg== 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 :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-filter; bh=Be562JGzGP+YllgBYA33JVdRpjxpxaXZ55LIwLAl360=; fh=LCmqoSD3hVo6PSZde6+NITB6MAmB0bhncjVI/8crINU=; b=zU2yjemZ8O9XalIMRdMvOlCmmtn9VP6yi40NSrUgKnAyF+5xjWg/LaixRTboRFXwq+ 5IlzM9x7HRuoCW8RstqeH/o3TBcpMJ/IDhXt+22kYI2236DekJ0jqwug9GOCIZ96Z6es mgu1BE1o6r0aESJ0+/nkeRmlhn5QXhi1rNGrVq/pqDfQxY0CKFP3TzCrGwlzzWIl2hR5 NmlIGQfSjQ/VGGUjLihiOWZ+dKhrWMHRRCMJMKIItor6nYbxKV3p2L7uCtak0kXbdA2o ceAkYvlLdTezaTli68dZz167zVAaQfbLbCP7wqTpauty5Q5sxkQoDA6c4m8tC+Zq+9mo xR6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=irFZvzH6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id ga16-20020a17090b039000b0027000086c93si272287pjb.102.2023.10.19.12.24.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 12:24:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=irFZvzH6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 6A2958273316; Thu, 19 Oct 2023 12:24:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346463AbjJSTYu (ORCPT + 99 others); Thu, 19 Oct 2023 15:24:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345878AbjJSTYs (ORCPT ); Thu, 19 Oct 2023 15:24:48 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB86DFA; Thu, 19 Oct 2023 12:24:43 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id BE787120010; Thu, 19 Oct 2023 22:24:40 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru BE787120010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1697743480; bh=Be562JGzGP+YllgBYA33JVdRpjxpxaXZ55LIwLAl360=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type:From; b=irFZvzH6HXUa4cY+msgQFg/kkD1srYMLIg5ybWJT94PFOf7i7evlioUluKkGEurty VGoVYyUXfYmG887hV9ijni6+PFHiSTOuMOuwJx31h0VWIuGlylS/YZiihvYQOGU8Sz FCqY6cxKLNLjgkSgGCRwnMv/M1fm6vuD41Odf31tqVeh+bqI+u5TNdtMnS0R/Us4xe OIhlrbGPS3E2ez26MpLozRmSENxB/nzWkPZ9hxqrpz34LB7XwehXcs17/mc1ZhI7il +bkaJf/5BC+sef+J+J4TbI8upnoGxcXvL5T4qh6JKuRt13qXL/2c/XoO17E21A3X0H tkPZ18Q4gTBTA== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Thu, 19 Oct 2023 22:24:40 +0300 (MSK) Received: from [192.168.1.127] (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Thu, 19 Oct 2023 22:24:40 +0300 Message-ID: <24ab7656-4358-9cca-0c3e-8f47a3468ef5@salutedevices.com> Date: Thu, 19 Oct 2023 22:25:01 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v2 04/11] leds: aw200xx: calculate dts property display_rows in driver Content-Language: en-US To: Andy Shevchenko , Dmitry Rokosov CC: , , , , , , , , , References: <20231018182943.18700-1-ddrokosov@salutedevices.com> <20231018182943.18700-5-ddrokosov@salutedevices.com> From: George Stark In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 180745 [Oct 19 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: gnstark@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 542 542 3d23828e213bab96daa5e52f9cef518f74e40214, {Tracking_from_domain_doesnt_match_to}, d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;salutedevices.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;127.0.0.199:7.1.2;100.64.160.123:7.1.2, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/10/19 17:46:00 #22233982 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_NONE,URIBL_BLOCKED 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 19 Oct 2023 12:24:51 -0700 (PDT) Hello Andy On 10/19/23 12:01, Andy Shevchenko wrote: > On Wed, Oct 18, 2023 at 9:30 PM Dmitry Rokosov > wrote: >> >> From: George Stark >> >> Get rid of device tree property "awinic,display-rows" and calculate it >> in driver using led definition nodes. display-row actually means number >> of current switches and depends on how leds are connected to the device. > > Still the commit message does not answer the question why it's safe > for the users that have this property enabled in their DTBs (note B > letter). > > ... > >> + device_for_each_child_node(dev, child) { >> + u32 source; >> + int ret; >> + >> + ret = fwnode_property_read_u32(child, "reg", &source); >> + if (ret || source >= chip->cdef->channels) > > Perhaps a warning? > > dev_warn(dev, "Unable to read from %pfw or apply a source channel > number\n", child); I skipped the warning intentionally because we have just the same loop several steps below and with the same check. There we have all proper warnings and aw200xx_probe_get_display_rows was intended to be short and lightweight. I'll redesign it to be even more simple. > >> + continue; >> + >> + max_source = max(max_source, source); >> + } > > ... > >> + chip->display_rows = max_source / chip->cdef->display_size_columns + 1; >> + if (!chip->display_rows) { >> + dev_err(dev, "No valid led definitions found\n"); >> + return -EINVAL; > > So, this part is in ->probe() flow only, correct? If so, > return dev_err_probe(...); > >> + } > > ... > >> + if (aw200xx_probe_get_display_rows(dev, chip)) >> + return -EINVAL; > > Why is the error code shadowed? > -- Best regards George