Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp454688rdb; Sat, 30 Sep 2023 10:59:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHUTDdRIJ0dNcYW0LrQmiurzrd3gn1BfbNlc6KB0/v0fTimjtu0cvHxT7qwq0PDmdYdaDwM X-Received: by 2002:a05:6a20:8403:b0:15d:c1a8:c329 with SMTP id c3-20020a056a20840300b0015dc1a8c329mr9815597pzd.48.1696096767276; Sat, 30 Sep 2023 10:59:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696096767; cv=none; d=google.com; s=arc-20160816; b=ewthNJhOpAXsFqJ/D3oadclVeISww59ThVjwqdVrbzqIWmLVcUb/ReokFirDBRSCJH d+4uMS8BwpTgwLTd8rZsH26+4dMRx5o/0jjzdkSFxFKik/RH4eOGL0puPO2VRHmbpakF NQ4NC2O45AdWdilo5VTibltkuQDTsvdiEynVKiiXEXjVqsdj9GarCW7/rf3PKVwYLtas s7Jt5ZGvMsSU0EFPb/7APlylcu3xkvaA8hKo7uk11c7iyLOcA1pQ9eWsBDIpWpuG5wcM Xc7yhuWpmGYaj+yVzKpe7kLH7/EvKgKYR6vCbpRzm/bRSf6sBe3LABCt2TMwzlGSw0Fi at/g== 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=ywY9/R8kcr5RaPO8b2BQ4pCql/IQs2+9E9MFzEyG3HE=; fh=r6Qhp0LT7Kf9zXNJMg+nKK/99bcL/1J+D8BN6ItCqm4=; b=fCmtcSZsfz5S66E5gHTNl1gGy1KPYKilRZBY7FHas8eOuw2/dxsU6KwhZ0K1N8TlS5 AQK7XflRHG2HyOonoK5womQXUquU+GvaWcp9HrioU4JvoNWBoasZye6t8TkKqRtXfuPl YgPJhHmFrB4Js4M4dCKrvLuHVvMY6dxaFrkY2cha0Snsmi/zrEzDJOzqVtQie3eopG2N CvN60k/MPriQAZkjVbRKolwuDU2XiYCtvYPvOD59G+p9o+GYtqtH77QM5x/MnyGRjaSP jCPa81JYB/IzyH/MHU1OLaleaiQbTa3DJeVXJYqyA8rYvvqkwcahiacy4TUjxGxzWOLw Xh6w== 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:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id b21-20020a17090acc1500b002774aec6805si3916674pju.68.2023.09.30.10.59.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 10:59:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 3EBFE81143E6; Sat, 30 Sep 2023 10:57:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234707AbjI3R43 (ORCPT + 99 others); Sat, 30 Sep 2023 13:56:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234703AbjI3R42 (ORCPT ); Sat, 30 Sep 2023 13:56:28 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2D940D3; Sat, 30 Sep 2023 10:56:26 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.03,190,1694703600"; d="scan'208";a="177759859" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 01 Oct 2023 02:56:25 +0900 Received: from localhost.localdomain (unknown [10.226.92.9]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 9BEEE4005B37; Sun, 1 Oct 2023 02:56:23 +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 v3 2/2] leds: pca955x: Cleanup OF/ID table terminators Date: Sat, 30 Sep 2023 18:56:15 +0100 Message-Id: <20230930175615.13301-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230930175615.13301-1-biju.das.jz@bp.renesas.com> References: <20230930175615.13301-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,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 (howler.vger.email [0.0.0.0]); Sat, 30 Sep 2023 10:57:19 -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 Reviewed-by: Andy Shevchenko --- v2->v3: * Added Rb tag from Andy. 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 7a83e84be6db..6720e1c7a8d9 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