From patchwork Tue Oct 17 20:35:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 154510 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4385188vqb; Tue, 17 Oct 2023 13:35:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHYzN5zXHVIkU8zDSqiaNcmxlJoHWvTBSDRQPWUe5nuLDpjvbu33gNmng6IEtTvvoXbVpYB X-Received: by 2002:a17:903:2601:b0:1ca:549c:cd72 with SMTP id jd1-20020a170903260100b001ca549ccd72mr3335450plb.6.1697574949698; Tue, 17 Oct 2023 13:35:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697574949; cv=none; d=google.com; s=arc-20160816; b=kTg2OOKQta76dyaK66QliCr+8TzZJYeVbJD7EldPXrEdl5Y7EYn4OKsHb1trq9YrXm v0n0FZ0a8ItrzNflYgS+qh8lPWXxht5BbkO6B5xiaubokBaHyVtmXmfe1vCqCv8ADmlX n6DV9ftFY6a00ePXgYNUhF65767a0Cz5oaNURwmIXdQyC5xm/pzMpshuPII2J7o7EVKX Pzqz4ejidy72KPogo4sjobvn6RRSsl+My2TmKgo7mZ9OIVlTuxShp2R0hkcCKTPDTCrS R7S7WwzTOnbEDMP0uQ8B21DHFYM/dKmhCMkpKEBhgPZH36aKSO8OR3jb2K2/PDJ8u7i4 RDFQ== 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=7r4zvpxf0zoLFhu7nkZPQCVPha50v5M0zuANIOxnVjs=; fh=f7kKwzmL5vxF4veDVPOUXfdfrXE6R1bevnyo30p5Vps=; b=RCxDtARA/QOje3WNccZ5YgalAFIHSHu7kn15gR+2LZVg1nr/KFFGr1x9FAJhBdfmJz NvtOMV/jttXxnpPDLkv+buYN1et/VNUucapVx8QDeSHWOE1tcvGvOBOxyRay7kGoI4yS sxI3UMfmtpVGJhDN+1sk4a0o33Bf1NTh6gb0Zk+nl8//cW0Z6N9guL7PpjhO1n1fIuB+ AYebw4zDx5WZBCmdMGYz2WM5h/kOpI0RAFbpeS5WYSGgl9Edgd7MYi64nlA9fyL8krBT 7BLvzN1y4O4cOxLadsmuoWlklByzks854awO5N5rewX25ZdzZd2v6o3nK083W0DWntf4 /4mw== 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 Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id x18-20020a170902ea9200b001c9d4f08c3asi2484306plb.277.2023.10.17.13.35.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 13:35:49 -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 3EB4C80BB562; Tue, 17 Oct 2023 13:35:47 -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 S1343950AbjJQUfe (ORCPT + 21 others); Tue, 17 Oct 2023 16:35:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231149AbjJQUfd (ORCPT ); Tue, 17 Oct 2023 16:35:33 -0400 Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1F1192 for ; Tue, 17 Oct 2023 13:35:31 -0700 (PDT) Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-6c63117a659so3729426a34.0 for ; Tue, 17 Oct 2023 13:35:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697574931; x=1698179731; 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=7r4zvpxf0zoLFhu7nkZPQCVPha50v5M0zuANIOxnVjs=; b=XKVseqAwqdeTCRVLjbP4ZAd51SNehjtWSNjxVfAX93qK8RE1PafyyhL4wD6aaWhzak oCQ0YTLA3aUS8Hxj344ukr9Qqg/bK8te9lpYizmRc5enJlwQ4tjAI2hUg6/vygfzRiuw PCbxILziEncSdQLNNPxJ52XkAdVmj7H6BfuYnBShnxtzl3ppv3GS0gzxzchFy7zYjqa8 MW1O0WwL22IA7m2mHa+5k3AXox7V+4Z6gwxz45oyyOwRlgjsIGyuTUERKaSaBP/Bm4sI 0zcyOXZ3tvfGnV2TJFtusdS0h1aCAMe0XNiqHeNoZ0XH59A4KSFIySknbfll0yrgJ0iP CK/Q== X-Gm-Message-State: AOJu0YwKu2PFr6kd9H2PFtGO1IaLB0BY34VqgqnYAThKnLvrdKf1rakg mFFugC+3n/n9+PnkZLNwfIaFVxFaQQ== X-Received: by 2002:a9d:6858:0:b0:6bc:bd1a:26d with SMTP id c24-20020a9d6858000000b006bcbd1a026dmr3379663oto.15.1697574930932; Tue, 17 Oct 2023 13:35:30 -0700 (PDT) Received: from herring.priv (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id d19-20020a9d72d3000000b006b96aee5195sm389500otk.11.2023.10.17.13.35.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 13:35:30 -0700 (PDT) Received: (nullmailer pid 2700205 invoked by uid 1000); Tue, 17 Oct 2023 20:35:28 -0000 From: Rob Herring To: Support Opensource , Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org Subject: [RESEND PATCH] regulator: Drop unnecessary of_match_device() calls Date: Tue, 17 Oct 2023 15:35:06 -0500 Message-ID: <20231017203507.2699826-1-robh@kernel.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 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:35:47 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780036350438804524 X-GMAIL-MSGID: 1780036350438804524 If probe is reached, we've already matched the device and in the case of DT matching, the struct device_node pointer will be set. Therefore, there is no need to call of_match_device() in probe. Signed-off-by: Rob Herring --- drivers/regulator/da9210-regulator.c | 12 +----------- drivers/regulator/max1586.c | 9 +-------- drivers/regulator/tps51632-regulator.c | 11 ----------- 3 files changed, 2 insertions(+), 30 deletions(-) diff --git a/drivers/regulator/da9210-regulator.c b/drivers/regulator/da9210-regulator.c index 252f74ab9bc0..02b85ca4a6fc 100644 --- a/drivers/regulator/da9210-regulator.c +++ b/drivers/regulator/da9210-regulator.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include @@ -135,16 +135,6 @@ static int da9210_i2c_probe(struct i2c_client *i2c) struct regulator_dev *rdev = NULL; struct regulator_config config = { }; int error; - const struct of_device_id *match; - - if (i2c->dev.of_node && !pdata) { - match = of_match_device(of_match_ptr(da9210_dt_ids), - &i2c->dev); - if (!match) { - dev_err(&i2c->dev, "Error: No device match found\n"); - return -ENODEV; - } - } chip = devm_kzalloc(&i2c->dev, sizeof(struct da9210), GFP_KERNEL); if (!chip) diff --git a/drivers/regulator/max1586.c b/drivers/regulator/max1586.c index 90aa5b723c03..0f133129252e 100644 --- a/drivers/regulator/max1586.c +++ b/drivers/regulator/max1586.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #define MAX1586_V3_MAX_VSEL 31 @@ -213,16 +213,9 @@ static int max1586_pmic_probe(struct i2c_client *client) struct regulator_config config = { }; struct max1586_data *max1586; int i, id, ret; - const struct of_device_id *match; pdata = dev_get_platdata(&client->dev); if (client->dev.of_node && !pdata) { - match = of_match_device(of_match_ptr(max1586_of_match), - &client->dev); - if (!match) { - dev_err(&client->dev, "Error: No device match found\n"); - return -ENODEV; - } ret = of_get_max1586_platform_data(&client->dev, &pdata_of); if (ret < 0) return ret; diff --git a/drivers/regulator/tps51632-regulator.c b/drivers/regulator/tps51632-regulator.c index d8a856c1587a..5199e0437388 100644 --- a/drivers/regulator/tps51632-regulator.c +++ b/drivers/regulator/tps51632-regulator.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -255,16 +254,6 @@ static int tps51632_probe(struct i2c_client *client) int ret; struct regulator_config config = { }; - if (client->dev.of_node) { - const struct of_device_id *match; - match = of_match_device(of_match_ptr(tps51632_of_match), - &client->dev); - if (!match) { - dev_err(&client->dev, "Error: No device match found\n"); - return -ENODEV; - } - } - tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL); if (!tps) return -ENOMEM;