Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp278251rdb; Sat, 2 Sep 2023 08:51:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMQFWiucgT6Ln/1EVVRkJtZS/uW8BTl7RIMei6NUyHoCZgfE36lbYAgY5oyWTeCesIhmuq X-Received: by 2002:a17:903:22c2:b0:1c0:b82a:b0d9 with SMTP id y2-20020a17090322c200b001c0b82ab0d9mr5928318plg.29.1693669888972; Sat, 02 Sep 2023 08:51:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693669888; cv=none; d=google.com; s=arc-20160816; b=zU5Kj9sEQD9VThva7T3ZiE6LGiLiqZxEDL9GCv27SWb488Hi+R8XpK1qCBBgzT9kPo yXxpItzMTD16a4zJFCm5OWsoAhTqS8hGwEkbJZLrfk4kqwnSZKwpVMQ+V36TgsI2wlDB RujkjdaHZ6431YHLguMU9A+rFjU+4oM9ZQk36assAEOiKyG26BWwo31hITBRP3vuw50a uzRPIW/eyu4A5u4V7NW4aQHHhzKguG+iifqWrLXMq6L6IGYQfXtxeXZSpO5vMIhafQ4N OxmtTBPhxacayHh3xZ6I1xjUtgLoNlZLUk5/CEq2k/pyI+CKFyTuGDZIf4lffm8z/5In sppw== 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=R8BQCICKWJnMQDe+mbWt5Ubl2a3zfVUPEX7gu8ll7Qo=; fh=xeSrQ7kCdgcCVb2zAn5rBkDAdtmCo24cOODwKpU9NDo=; b=PGYhjsknC/LSwOBWONL834NNWff8F1pXlodBZUf6ABL+bbhds9nXJVrEsoJzvF3kSo e88GhnNH+xKpStpNUqRr911cGGuuJEba6z/HIrKQ0y0K9M5ymEgXKgFUm9p2LEFk5J5O 12N4peZ3/LOLi0Gc+fGq5w94zjh+M/LwpnWcp5NoHLwkFDhm0XQcAUyis9FoVRp8aopX k04PmNlCFCO6rQ7LtgptTxLj4D7/VIbORXUUPHF/Y9FC/QsoqV9H04g4HHTG1SYBJEIE X0h6mXRjOqSYHYCvBkyPxtQPnMZxENRsEU6LANPR8xYZqYl2CwlLJ1iav6aRJkkin+xt i8HQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y22-20020a17090264d600b001b8b2cb7359si4386032pli.627.2023.09.02.08.51.15; Sat, 02 Sep 2023 08:51:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351917AbjIBJJs (ORCPT + 99 others); Sat, 2 Sep 2023 05:09:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229513AbjIBJJs (ORCPT ); Sat, 2 Sep 2023 05:09:48 -0400 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F2A5B1709; Sat, 2 Sep 2023 02:09:44 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,222,1688396400"; d="scan'208";a="178490887" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 02 Sep 2023 18:09:44 +0900 Received: from localhost.localdomain (unknown [10.226.92.16]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 401B34005B30; Sat, 2 Sep 2023 18:09:41 +0900 (JST) From: Biju Das To: Linus Walleij Cc: Biju Das , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Biju Das , Andy Shevchenko Subject: [PATCH 1/2] pinctrl: mcp23s08: Extend match support for OF tables Date: Sat, 2 Sep 2023 10:09:36 +0100 Message-Id: <20230902090937.32195-2-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230902090937.32195-1-biju.das.jz@bp.renesas.com> References: <20230902090937.32195-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 The driver has OF match table, still it uses ID lookup table for retrieving match data. Currently the driver is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID. The correct approach is to have an OF device ID table using of_device_match_data() if the devices are registered via OF. Signed-off-by: Biju Das --- drivers/pinctrl/pinctrl-mcp23s08_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl-mcp23s08_i2c.c b/drivers/pinctrl/pinctrl-mcp23s08_i2c.c index 3dd1bd8e73eb..393d9b099cc5 100644 --- a/drivers/pinctrl/pinctrl-mcp23s08_i2c.c +++ b/drivers/pinctrl/pinctrl-mcp23s08_i2c.c @@ -10,9 +10,8 @@ static int mcp230xx_probe(struct i2c_client *client) { - const struct i2c_device_id *id = i2c_client_get_device_id(client); struct device *dev = &client->dev; - unsigned int type = id->driver_data; + unsigned int type; struct mcp23s08 *mcp; int ret; @@ -20,6 +19,7 @@ static int mcp230xx_probe(struct i2c_client *client) if (!mcp) return -ENOMEM; + type = (uintptr_t)i2c_get_match_data(client); switch (type) { case MCP_TYPE_008: mcp->regmap = devm_regmap_init_i2c(client, &mcp23x08_regmap); -- 2.25.1