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>
Link: https://lore.kernel.org/r/20231017203537.2700340-1-robh@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
#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>
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;