Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp211585rdb; Thu, 19 Oct 2023 02:02:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDMswqPXjGDYsoM0SjRGwBbiQFdeNRflgqhg2uGsv2NA0I638CfNfr91e8jmVJFLhEh0SU X-Received: by 2002:a17:902:db0c:b0:1c9:bf02:664b with SMTP id m12-20020a170902db0c00b001c9bf02664bmr2030373plx.7.1697706153352; Thu, 19 Oct 2023 02:02:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697706153; cv=none; d=google.com; s=arc-20160816; b=Ujnvh9GNnZoN5HwEm/qNVy/lIInJOU54S6ffQF9FenFDhgk2AttBPqOfoeT9bvRGZv k1cgOAwokf7sT/SK5WQDhww/kYdj+VSGmuonsW6TEIFWiaSRuAlqnYtCSFcswknfj3LW NYMsVTnq0Sg1cGG62Sm9ztq9N117naBFi1U13p0vH/teluy28pnjvJVh1ryOIG98b7Or AxkjFQa/33XC/2OMYbGvOaFaxZVQ09XowkkwjfTV0A8HWjvKjxmhdEEorDtfY0g/xKbZ eRS/8PTGK9kRqgnvO7XZpwiiWZ82ceNennf8LqBpgcRRwPVO5o6RkYSF5yW7NEvY712b fS5A== 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=Sk9NQQyJeBXT6Ol7GG+VsgF3Sb2L3l2NxoYE0zAyB7Y=; fh=HJOEJ+1NVvtVnuIMWeT1OywsaidefjPxO+0zJVj3/z8=; b=ydWaJHIZbcT8kw5tawftl+ax0npru7GaOoa9ze1RYKZuBEI8AHrJg3NFqA8q8yTicf g0eKeU/u8GvddoNFq74wGxdc4mDjTJiOq8zkihMZdDu0vAhlP8NNeqsrpFoKHpA+DiMs jcnenH4783T67zOySRXjv5VhetYGwQbr6pyjeS7L7vw5yPoVwh6iRIO9WNgRc9cSgzDN ynfGErVCIM+KsfLh8x2b4YEHa2I71U1mzQI3ng2VdQpo+qdJee2WHPOjligNW5nH93ta +gm5BOpTzaejYnJ/Zbv75j30KUT0N5jDJ86wXoklbBZB+rs5fyXJXZuKy47sXQBdAdSp D0PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XBmsi3ug; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id k4-20020a170902d58400b001c9c9514db7si1734654plh.604.2023.10.19.02.02.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 02:02:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XBmsi3ug; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A9BFF822CAE1; Thu, 19 Oct 2023 02:02:31 -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 S1344949AbjJSJC3 (ORCPT + 99 others); Thu, 19 Oct 2023 05:02:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232876AbjJSJC0 (ORCPT ); Thu, 19 Oct 2023 05:02:26 -0400 Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B84312A; Thu, 19 Oct 2023 02:02:25 -0700 (PDT) Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-777719639adso180183885a.3; Thu, 19 Oct 2023 02:02:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697706144; x=1698310944; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Sk9NQQyJeBXT6Ol7GG+VsgF3Sb2L3l2NxoYE0zAyB7Y=; b=XBmsi3ugdFmtjgaaaqxGewgMvjah8ALh+ojOFpIpgujGYnwMav513m7o7p1j1riTJf Bw7B1FRlJGSwXuejzIuhNj8JRGD8HlIj3bJ45HSq3qAJjCh6U0fK+UVVPC5EVHiEhchx 6720Nhjq8GFZ4AgJtp6TXsYs7aoZMYw/Xaj0uXlRVgp0vsRA9GnZXaBAq2f9G+gyTRGx c3sNX1hu1WJug192PCemjYGA+wXBXyEByyzs6wS21p6CZw26Bg+4EdFGtYqULeMze3yh XMYwcHrvLTxpjHR52QTx2K3My3FNEHD+4bzF27OXbGcO7fM5UekanZbxWT8TmQYkK+6s +ZIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697706144; x=1698310944; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Sk9NQQyJeBXT6Ol7GG+VsgF3Sb2L3l2NxoYE0zAyB7Y=; b=hlr65v3HO8/4Zy5EKcHeQ363sCMtwCAdmtEhMOHngfsZ1Li1Msu6MJRjaupRcwixzI LjpVqzk3lAaOnVG7mirhuAPfUGbBYIE3zWgRtmKNa6GPs/73Ss62fOQk/Eldy83k4Uw+ W4ITATQCYkJbI90vlRyTrelpWyV0L/hz8FOgm53W1T/lFF4IBS84/F4o1hcReND6tPhZ gPiSOLKkKS48AQYz6pyjdh2n3hT9mOCf6j4rurAeDLY5GfrkCDFG6w5umnyTL9xKiWsc x8VHn0vpFyXgBnzyjxSiNfmJCgPxs43V/DtQTAIsz+r7EvyK9xk8jo8Yom8Ja7Ut9WbA QhqQ== X-Gm-Message-State: AOJu0YyhPKxQnwJxrojdRhJAXvHt8HdeDZ9OuuL9NYbu/5MyiT+uPM4k uvZqgFEqjd1Vc/K9stauTiVI5VrbVWWY7kUXTrU= X-Received: by 2002:a05:6214:2421:b0:66d:10fd:4abb with SMTP id gy1-20020a056214242100b0066d10fd4abbmr1782016qvb.16.1697706144215; Thu, 19 Oct 2023 02:02:24 -0700 (PDT) MIME-Version: 1.0 References: <20231018182943.18700-1-ddrokosov@salutedevices.com> <20231018182943.18700-5-ddrokosov@salutedevices.com> In-Reply-To: <20231018182943.18700-5-ddrokosov@salutedevices.com> From: Andy Shevchenko Date: Thu, 19 Oct 2023 12:01:48 +0300 Message-ID: Subject: Re: [PATCH v2 04/11] leds: aw200xx: calculate dts property display_rows in driver To: Dmitry Rokosov Cc: lee@kernel.org, pavel@ucw.cz, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, kernel@sberdevices.ru, rockosov@gmail.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, George Stark 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_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 02:02:31 -0700 (PDT) On Wed, Oct 18, 2023 at 9:30=E2=80=AFPM 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 =3D fwnode_property_read_u32(child, "reg", &source); > + if (ret || source >=3D chip->cdef->channels) Perhaps a warning? dev_warn(dev, "Unable to read from %pfw or apply a source channel number\n", child); > + continue; > + > + max_source =3D max(max_source, source); > + } ... > + chip->display_rows =3D max_source / chip->cdef->display_size_colu= mns + 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? --=20 With Best Regards, Andy Shevchenko