public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH] mfd: motorola-cpcap: Drop unnecessary of_match_device() call
@ 2023-10-17 20:35 Rob Herring
  2023-10-19 12:33 ` (subset) " Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Herring @ 2023-10-17 20:35 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel

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 <robh@kernel.org>
---
 drivers/mfd/motorola-cpcap.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/mfd/motorola-cpcap.c b/drivers/mfd/motorola-cpcap.c
index a19691ba8d8b..d8243b956f87 100644
--- a/drivers/mfd/motorola-cpcap.c
+++ b/drivers/mfd/motorola-cpcap.c
@@ -11,7 +11,7 @@
 #include <linux/irq.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
 #include <linux/regmap.h>
 #include <linux/sysfs.h>
 
@@ -290,14 +290,9 @@ static const struct mfd_cell cpcap_mfd_devices[] = {
 
 static int cpcap_probe(struct spi_device *spi)
 {
-	const struct of_device_id *match;
 	struct cpcap_ddata *cpcap;
 	int ret;
 
-	match = of_match_device(cpcap_of_match, &spi->dev);
-	if (!match)
-		return -ENODEV;
-
 	cpcap = devm_kzalloc(&spi->dev, sizeof(*cpcap), GFP_KERNEL);
 	if (!cpcap)
 		return -ENOMEM;
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: (subset) [RESEND PATCH] mfd: motorola-cpcap: Drop unnecessary of_match_device() call
  2023-10-17 20:35 [RESEND PATCH] mfd: motorola-cpcap: Drop unnecessary of_match_device() call Rob Herring
@ 2023-10-19 12:33 ` Lee Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2023-10-19 12:33 UTC (permalink / raw)
  To: Lee Jones, Rob Herring; +Cc: linux-kernel

On Tue, 17 Oct 2023 15:35:36 -0500, Rob Herring wrote:
> 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.
> 
> 

Applied, thanks!

[1/1] mfd: motorola-cpcap: Drop unnecessary of_match_device() call
      commit: de083f0eb4fe7f1f1d6cc0bad676a5adc38be8d5

--
Lee Jones [李琼斯]


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-19 12:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-17 20:35 [RESEND PATCH] mfd: motorola-cpcap: Drop unnecessary of_match_device() call Rob Herring
2023-10-19 12:33 ` (subset) " Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox