Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3401129rdg; Tue, 17 Oct 2023 13:36:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRwiLZFKcpeeJ8frENUCxiRQeW5rdYhkmCt7weshiWfLTgSftboyoAzE+kjUFNgSQYNrbE X-Received: by 2002:a17:902:fb0e:b0:1ca:7a4c:8356 with SMTP id le14-20020a170902fb0e00b001ca7a4c8356mr3247660plb.27.1697575013717; Tue, 17 Oct 2023 13:36:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697575013; cv=none; d=google.com; s=arc-20160816; b=JgFZQaVszgnNx1IlK99yh+oLhpcsDECfif6ZAzMXxYYZXTaG31CVMUO+Tx26O9lGt8 BXSg1yD+FgohL46ihtanw5O0+XFUNv8M6lHzLI8vKO98+55ZzB+PeLMXvXmCZ8M2R32n LOeV7aYqeBFKh3QGo5D6TiUAJjcByJDBidK9lmOR7pbn2yUx6oOgmtWgZsm/nwU8vDep O/q9ByR9iJstb0CDswGNQrvLiBwVnpp01izxgZyAzwocNU7nw+HATb4s21sbxAD9QhDE WsX4n8/5Whu94Nmti0t2UJ+YWCYKTLI6kRA0nrQKWKECtbrZx4v4FJl6cHCpYiCLNxhL Y2ig== 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 :message-id:date:subject:cc:to:from; bh=tlXWKbsf5/gUFLRD8MZ8nhq2WyOrSzkHVURrmbpQ9bU=; fh=Udu9zRpGU/cb9bb/pYbz8fHI1LaOJsHp0GVZO5caJoM=; b=ecEHScdOf+WIjEivlDsA0Cf0GPN/KaqEoOhDIg9/JjLT7kweSkBZ2Ryj8rpQ7XxEFp 7xIzCGqU5T+Agb82g20dg5OA4stjrom4SVyfAXKtTq6Wo17mhA/+lZ5Elc/OcgiR9RT/ LsNNQKOkI7gPqMJY1IWi1702EfXR3UDTGQ/n7JcVtlcDsc8lFO7tWHBNXwUyrrOkGIRK UkxyFfTB1+gOJDOseeqaZcPdfjDqUQAJiKkEpz7xWh+EwnBI386gStw9tRhmyKycE2tJ 9g0kiSWIFKpdgA+irqnKSd3pjJUHBTRXZhVU+cJVLlbUc5i8w6uqNw4SVHVXgbzGtmFI 1gxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id m16-20020a170902db1000b001c4660cd474si2623520plx.634.2023.10.17.13.36.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 13:36:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id AC163804C6D0; Tue, 17 Oct 2023 13:36:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344254AbjJQUgE (ORCPT + 99 others); Tue, 17 Oct 2023 16:36:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235016AbjJQUgC (ORCPT ); Tue, 17 Oct 2023 16:36:02 -0400 Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 815B2C4 for ; Tue, 17 Oct 2023 13:36:00 -0700 (PDT) Received: by mail-ot1-f52.google.com with SMTP id 46e09a7af769-6c4b9e09521so4058196a34.3 for ; Tue, 17 Oct 2023 13:36:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697574960; x=1698179760; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tlXWKbsf5/gUFLRD8MZ8nhq2WyOrSzkHVURrmbpQ9bU=; b=Z+YxWqHxWB/2tJP0Sj3+as/1m9EQ0Sf1yC6lvCLkxnpV/beQwmj+zLIV6kpN8DRylN ih3eZBmzoJzPgrYH3EFrv0MX1ehu1siSRUG6HmjAZDTZqeTo4g3NLkbZjq5An7osqf3/ SHKfIDOD/mYxcnXabs4Dy67nbfIx2zgN8J3SFvK7PR+f9yOj4stHO9WbCCnC3QnB3C4x g6D+1hF95nqzlkDPsAEfOJDhU0xPdkzg3AlWr9vfWUNjo3wUNRRXQoVlBFJID1YOGyc1 9DdrdQykop5BpeZjoyn0raXejD76sYs5Cq82lynx7Tx6RDulYEAggs0G78SIeMwzwlJ6 i58w== X-Gm-Message-State: AOJu0YxQG7l1ufCG5TbWZJ87cixKgybSITE1PJSb3/b/8lZG59lIjBPm H2fujltxBQr1xFYYStn8bqvsXhNrZg== X-Received: by 2002:a05:6808:23cf:b0:3af:a72a:96dc with SMTP id bq15-20020a05680823cf00b003afa72a96dcmr4211210oib.3.1697574959735; Tue, 17 Oct 2023 13:35:59 -0700 (PDT) Received: from herring.priv (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id ec6-20020a056808638600b003b2e4754cc2sm113093oib.26.2023.10.17.13.35.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 13:35:59 -0700 (PDT) Received: (nullmailer pid 2700789 invoked by uid 1000); Tue, 17 Oct 2023 20:35:58 -0000 From: Rob Herring To: Lee Jones Cc: linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: [RESEND PATCH] mfd: Use spi_get_device_match_data() Date: Tue, 17 Oct 2023 15:35:49 -0500 Message-ID: <20231017203550.2700601-1-robh@kernel.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Tue, 17 Oct 2023 13:36:28 -0700 (PDT) Use preferred spi_get_device_match_data() instead of of_match_device() and spi_get_device_id() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring --- drivers/mfd/mc13xxx-spi.c | 14 ++------------ drivers/mfd/wm831x-spi.c | 16 ++++------------ 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/drivers/mfd/mc13xxx-spi.c b/drivers/mfd/mc13xxx-spi.c index f70d79aa5a83..c973e2579bdf 100644 --- a/drivers/mfd/mc13xxx-spi.c +++ b/drivers/mfd/mc13xxx-spi.c @@ -8,13 +8,12 @@ */ #include +#include #include #include #include #include #include -#include -#include #include #include @@ -151,16 +150,7 @@ static int mc13xxx_spi_probe(struct spi_device *spi) return ret; } - if (spi->dev.of_node) { - const struct of_device_id *of_id = - of_match_device(mc13xxx_dt_ids, &spi->dev); - - mc13xxx->variant = of_id->data; - } else { - const struct spi_device_id *id_entry = spi_get_device_id(spi); - - mc13xxx->variant = (void *)id_entry->driver_data; - } + mc13xxx->variant = spi_get_device_match_data(spi); return mc13xxx_common_init(&spi->dev); } diff --git a/drivers/mfd/wm831x-spi.c b/drivers/mfd/wm831x-spi.c index 76be7ef5c970..54c87267917b 100644 --- a/drivers/mfd/wm831x-spi.c +++ b/drivers/mfd/wm831x-spi.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -21,21 +20,14 @@ static int wm831x_spi_probe(struct spi_device *spi) { struct wm831x_pdata *pdata = dev_get_platdata(&spi->dev); - const struct spi_device_id *id = spi_get_device_id(spi); - const struct of_device_id *of_id; struct wm831x *wm831x; enum wm831x_parent type; int ret; - if (spi->dev.of_node) { - of_id = of_match_device(wm831x_of_match, &spi->dev); - if (!of_id) { - dev_err(&spi->dev, "Failed to match device\n"); - return -ENODEV; - } - type = (uintptr_t)of_id->data; - } else { - type = (enum wm831x_parent)id->driver_data; + type = (uintptr_t)spi_get_device_match_data(spi); + if (!type) { + dev_err(&spi->dev, "Failed to match device\n"); + return -ENODEV; } wm831x = devm_kzalloc(&spi->dev, sizeof(struct wm831x), GFP_KERNEL); -- 2.42.0