Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2407352pxb; Mon, 20 Sep 2021 21:41:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNhmadGJDbF1DuWcl9LzSqcnDadzv/vGFNFGrChKIWTYNNMpxEXGus1Ag7YtDM4QjNL78M X-Received: by 2002:a5d:9ad2:: with SMTP id x18mr21693871ion.182.1632199267518; Mon, 20 Sep 2021 21:41:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632199267; cv=none; d=google.com; s=arc-20160816; b=jTgk8HkiQTM4AYITuLKUwRmBvlKvSFAGm/VTyZvIHXQ7OPE2zx6H1ItuR3xT3kSWX1 Nb+lPD5VpGaqdIevjxdpWYNh0gv4Kz3+5COsiwgUq18puA5JGUTFdQxPedfxC3ehjztP drq2DuL04mGoFv405rt/hWlSNUqcnSBbKeDSvVsL+cjLqz6d8NBiargWVNIACZjUUbN+ 642fPDu5FekqliOs+Qh6laG3KPJjT1/yiduKB/vjGReVgPhZ0YyUo5rSJEOn1r47Phj1 794iajMwBuo0SUzY8SDj0O0A5LpP5R8XV4JwWoWkYLlB9pLGplY5BYn1SMBBlT7RcmvQ Nkpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=UMFOw7vbwhDOlT/6/dntbRu7oRn9RKWKLkg+EamTaYY=; b=uymYMf+SzwART95Gkwp3Ui5k2K4URFw6Bb932o6KECRN/A3CNmhyiFkQzJ5TcHz8nh aCBfphfYfZP1ZNG5O1p4Oq2WITVUT/FyWkAVzq9Hc+kxU/e1xP3fIhUbHHdDS1Y2P6pf 9s8sgzkFVOFbOCTSqOVJve0MXpHatjPORLP4yagvEQ8uhwOqfbohW5D8TmoKqUECMKIe w5Zu8Xa/z8gciJTl48fIkm23wxBzafjVtT3gRUYv/meRjhl0qILpPHRmFCbZBwnuv0NJ blJSKy09aKgL5xZLT8eOuyMvJd+HnTCf16H8lb6CdO45eb08BEROdvBH3FpyLDmwTEPl 3cEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm3 header.b=R0T9Pb5S; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="cP6M/PE0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q12si3544639jac.12.2021.09.20.21.40.56; Mon, 20 Sep 2021 21:41:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm3 header.b=R0T9Pb5S; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="cP6M/PE0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230345AbhIUElg (ORCPT + 99 others); Tue, 21 Sep 2021 00:41:36 -0400 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:60749 "EHLO wnew4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229988AbhIUEle (ORCPT ); Tue, 21 Sep 2021 00:41:34 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id BC2DB2B01433; Tue, 21 Sep 2021 00:40:05 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 21 Sep 2021 00:40:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=UMFOw7vbwhDOl T/6/dntbRu7oRn9RKWKLkg+EamTaYY=; b=R0T9Pb5SZ+4yxZc07SWcc2cgpW4Ei GjRBNl5luMuLSwhYzK0M6b4O289/LCQp1YHlC1W2v3LQddoi8xObda/Y2niNBp5V 49NjstgoULPBXBGG4raqp7ZGi0WOLB1QinMIJjco4FEPiQF23tX8AYBU4uHqbJ+V Y7OOMrRJybrTUutdYNN/Eha1NPKA3wCLg1S3Va8/7VPH8lv9rjrZpIZILWWAyGyq deFa4Sfrt0hUTPR7xAX9m7Oi+wWq8j1wzQHa1sHU+byowM/jhZbmkjx9/Ix94rmt joVqLmpMmure/uZsOj4Iinzxj9oWVG0iajwAwh7GblgnhjowH+QI43mXw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=UMFOw7vbwhDOlT/6/dntbRu7oRn9RKWKLkg+EamTaYY=; b=cP6M/PE0 +9ReKlONMlBaU4X07LBpC8imUWgWAK9IG8zLrxXudSrHJyk45CWJJlIC6GSTheja ILwrsx2fV+f2rYMMOyHJ/9iXEA/eCs1AA8ENhiktkJJOTtY8E913vz0FPJr4lOl/ 3doxcADRUGKCz5fSN6pmRs0NKFdHEYKkeT6vCEqZzIhhR6xRprclTwjyc2+fgq6k FulVx6ZayP7FhtrjdAdAL+swUjsFq9ok9fLko7cXdRO5brAGvPuDb9c1eFuvg/HQ 0NuaOs8FZwZtDRDDln1CWHFlh44+zdDWe5C1YMIDFx33lFm4IkvIBPFM5cbln/n9 k1+IDCcCYiervw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudeifedgkeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecuggftrfgrthhtvghrnhepjefgvdevheetkeevgeegleelgfelte etjeffleffvdduudevieffgeetleevhfetnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 21 Sep 2021 00:40:00 -0400 (EDT) From: Andrew Jeffery To: linux-leds@vger.kernel.org, linux-gpio@vger.kernel.org Cc: clg@kaod.org, robh+dt@kernel.org, joel@jms.id.au, pavel@ucw.cz, linus.walleij@linaro.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, andy.shevchenko@gmail.com Subject: [PATCH 2/2] leds: pca955x: Allow zero LEDs to be specified Date: Tue, 21 Sep 2021 14:09:36 +0930 Message-Id: <20210921043936.468001-3-andrew@aj.id.au> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210921043936.468001-1-andrew@aj.id.au> References: <20210921043936.468001-1-andrew@aj.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's valid to use the PCA955x devices just for GPIOs and not for LEDs. In this case, as PCA955X_TYPE_GPIO is now equivalent to PCA955X_TYPE_NONE, remove the test for whether we have any child nodes specified in the devicetree. A consequence of this is it's now possible to bind the driver to a PCA955x device when dynamically instantiated through the I2C subsystem's `new_device` interface. Signed-off-by: Andrew Jeffery --- drivers/leds/leds-pca955x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/leds/leds-pca955x.c b/drivers/leds/leds-pca955x.c index 77c0f461ab95..81aaf21212d7 100644 --- a/drivers/leds/leds-pca955x.c +++ b/drivers/leds/leds-pca955x.c @@ -429,7 +429,7 @@ pca955x_get_pdata(struct i2c_client *client, struct pca955x_chipdef *chip) int count; count = device_get_child_node_count(&client->dev); - if (!count || count > chip->bits) + if (count > chip->bits) return ERR_PTR(-ENODEV); pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL); -- 2.30.2