Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp288490rdh; Sat, 23 Sep 2023 10:19:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFucMTAu1zr4dYHrTF0L5VxtMyqKUYMss48LBJtWBhEgC1O70AkS+jWTU0w88JfClks2jxB X-Received: by 2002:a17:903:18f:b0:1bb:35b6:448f with SMTP id z15-20020a170903018f00b001bb35b6448fmr2832621plg.15.1695489584707; Sat, 23 Sep 2023 10:19:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695489584; cv=none; d=google.com; s=arc-20160816; b=zVXVcfOnGnUA0B+IUehuJbbiwp6H4InV+41oxm5EnkQhD0kC1xRMrVlvODB4movGgf LPvKQlwclMxjieSHHY2j4yYICVBw7LxNYCs+Vf2rd3HtsYhhSWHrZK3prxOCIDia2420 ggq6SGQh9lx78X9k/kjUZLYCTv+8PJ+7GUoukvpgUxqkHxLIBAHj/Yz5soI4/eRcSfzH mocmcfg0lGbeZENxj5+Pnskkiz28ubnmiIaWe2cwR901wfEu1hporRn+TU6svS0oij0A 4Oxl0a9d139uTeTDwD9SRfZT96DhJLHsvkN63eY5ezlXQL3Emf3mCmPva0JEOY+lP2FF dIYA== 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; bh=By7hXJUe9XV3OJz5Cu+hUEcxHAS+sR3e1yWlSo82QI8=; fh=r6Qhp0LT7Kf9zXNJMg+nKK/99bcL/1J+D8BN6ItCqm4=; b=s8YdhYtIhqQLrq4eT4sA2gx2hC8YYxwI9gwMWNMl50WchfpUH6v+GF9/jxhJ/z2zAL bsYXZMrwlNdUxAvuEXJmpUZf+CWhfxgUQJQTzC4Wewiy9DcV+ALaZpPWeu68pqHlTlbG pvXAsEpWna6HiHRjgZ9REkqLW4xATCrTzonci2YeGMQfFJVh6uDpHwOHhkLOvC0qy70F A3m+HlVQqoTlAgEcl2usJApzHtb/n9raxZfz+iO/ePtYwKx2FFen16/MTbZ2/4bVEof2 fQn67K8CXJlnespY+l/hdUhDaflB/2YsqMQsBOr8I7PaS8qttERaAPqQ59E//i9jkuNb vX8A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id j10-20020a170902da8a00b001c563263222si6702687plx.376.2023.09.23.10.19.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 10:19:44 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C5DB8819DFC9; Sat, 23 Sep 2023 10:19:43 -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 S231363AbjIWRTn (ORCPT + 99 others); Sat, 23 Sep 2023 13:19:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230369AbjIWRTj (ORCPT ); Sat, 23 Sep 2023 13:19:39 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 91978100; Sat, 23 Sep 2023 10:19:33 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.03,171,1694703600"; d="scan'208";a="176996641" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 24 Sep 2023 02:19:33 +0900 Received: from localhost.localdomain (unknown [10.226.92.12]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 1D53F4000AAE; Sun, 24 Sep 2023 02:19:30 +0900 (JST) From: Biju Das To: Pavel Machek , Lee Jones Cc: Biju Das , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, Biju Das , Andy Shevchenko Subject: [PATCH v2 2/2] leds: pca955x: Cleanup OF/ID table terminators Date: Sat, 23 Sep 2023 18:19:21 +0100 Message-Id: <20230923171921.53503-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230923171921.53503-1-biju.das.jz@bp.renesas.com> References: <20230923171921.53503-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, 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]); Sat, 23 Sep 2023 10:19:44 -0700 (PDT) Some cleanups: * Remove the trailing comma in the terminator entry for the OF table making code robust against (theoretical) misrebases or other similar things where the new entry goes _after_ the termination without the compiler noticing. * Drop a space from terminator entry for ID table. While at it, move OF/ID table near to the user. Signed-off-by: Biju Das --- v2: * New patch. --- drivers/leds/leds-pca955x.c | 40 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/leds/leds-pca955x.c b/drivers/leds/leds-pca955x.c index 891cfc05301d..94a9f8a54b35 100644 --- a/drivers/leds/leds-pca955x.c +++ b/drivers/leds/leds-pca955x.c @@ -104,16 +104,6 @@ static const struct pca955x_chipdef pca955x_chipdefs[] = { }, }; -static const struct i2c_device_id pca955x_id[] = { - { "pca9550", (kernel_ulong_t)&pca955x_chipdefs[pca9550] }, - { "pca9551", (kernel_ulong_t)&pca955x_chipdefs[pca9551] }, - { "pca9552", (kernel_ulong_t)&pca955x_chipdefs[pca9552] }, - { "ibm-pca9552", (kernel_ulong_t)&pca955x_chipdefs[ibm_pca9552] }, - { "pca9553", (kernel_ulong_t)&pca955x_chipdefs[pca9553] }, - { } -}; -MODULE_DEVICE_TABLE(i2c, pca955x_id); - struct pca955x { struct mutex lock; struct pca955x_led *leds; @@ -457,16 +447,6 @@ pca955x_get_pdata(struct i2c_client *client, const struct pca955x_chipdef *chip) return pdata; } -static const struct of_device_id of_pca955x_match[] = { - { .compatible = "nxp,pca9550", .data = &pca955x_chipdefs[pca9550] }, - { .compatible = "nxp,pca9551", .data = &pca955x_chipdefs[pca9551] }, - { .compatible = "nxp,pca9552", .data = &pca955x_chipdefs[pca9552] }, - { .compatible = "ibm,pca9552", .data = &pca955x_chipdefs[ibm_pca9552] }, - { .compatible = "nxp,pca9553", .data = &pca955x_chipdefs[pca9553] }, - {}, -}; -MODULE_DEVICE_TABLE(of, of_pca955x_match); - static int pca955x_probe(struct i2c_client *client) { struct pca955x *pca955x; @@ -650,6 +630,26 @@ static int pca955x_probe(struct i2c_client *client) return 0; } +static const struct i2c_device_id pca955x_id[] = { + { "pca9550", (kernel_ulong_t)&pca955x_chipdefs[pca9550] }, + { "pca9551", (kernel_ulong_t)&pca955x_chipdefs[pca9551] }, + { "pca9552", (kernel_ulong_t)&pca955x_chipdefs[pca9552] }, + { "ibm-pca9552", (kernel_ulong_t)&pca955x_chipdefs[ibm_pca9552] }, + { "pca9553", (kernel_ulong_t)&pca955x_chipdefs[pca9553] }, + {} +}; +MODULE_DEVICE_TABLE(i2c, pca955x_id); + +static const struct of_device_id of_pca955x_match[] = { + { .compatible = "nxp,pca9550", .data = &pca955x_chipdefs[pca9550] }, + { .compatible = "nxp,pca9551", .data = &pca955x_chipdefs[pca9551] }, + { .compatible = "nxp,pca9552", .data = &pca955x_chipdefs[pca9552] }, + { .compatible = "ibm,pca9552", .data = &pca955x_chipdefs[ibm_pca9552] }, + { .compatible = "nxp,pca9553", .data = &pca955x_chipdefs[pca9553] }, + {} +}; +MODULE_DEVICE_TABLE(of, of_pca955x_match); + static struct i2c_driver pca955x_driver = { .driver = { .name = "leds-pca955x", -- 2.25.1