Skip to content

Commit 9f58744

Browse files
robherringlag-linaro
authored andcommitted
mfd: motorola-cpcap: Drop unnecessary of_match_device() call
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 831d1af commit 9f58744

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

drivers/mfd/motorola-cpcap.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <linux/irq.h>
1212
#include <linux/kernel.h>
1313
#include <linux/module.h>
14-
#include <linux/of_device.h>
14+
#include <linux/mod_devicetable.h>
1515
#include <linux/regmap.h>
1616
#include <linux/sysfs.h>
1717

@@ -290,14 +290,9 @@ static const struct mfd_cell cpcap_mfd_devices[] = {
290290

291291
static int cpcap_probe(struct spi_device *spi)
292292
{
293-
const struct of_device_id *match;
294293
struct cpcap_ddata *cpcap;
295294
int ret;
296295

297-
match = of_match_device(cpcap_of_match, &spi->dev);
298-
if (!match)
299-
return -ENODEV;
300-
301296
cpcap = devm_kzalloc(&spi->dev, sizeof(*cpcap), GFP_KERNEL);
302297
if (!cpcap)
303298
return -ENOMEM;

0 commit comments

Comments
 (0)