Skip to content

Commit c412d7a

Browse files
andy-shevgroeck
authored andcommitted
hwmon: (jc42) Drop of_match_ptr() protection
This prevents use of this driver with ACPI via PRP0001 and is an example of an anti pattern I'm trying to remove from the kernel. Hence drop from this driver. Also switch of.h for mod_devicetable.h include given use of struct of_device_id which is defined in that header. Reported-by: Konstantin Aladyshev <[email protected]> Closes: https://lore.kernel.org/r/CACSj6VW7WKv5tiAkLCvSujENJvXq1Mc7_7vtkQsRSz3JGY0i3Q@mail.gmail.com Signed-off-by: Andy Shevchenko <[email protected]> Message-ID: <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
1 parent 2e5bdf8 commit c412d7a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/hwmon/jc42.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include <linux/bitops.h>
1313
#include <linux/bitfield.h>
14+
#include <linux/mod_devicetable.h>
1415
#include <linux/module.h>
1516
#include <linux/init.h>
1617
#include <linux/slab.h>
@@ -19,7 +20,6 @@
1920
#include <linux/hwmon.h>
2021
#include <linux/err.h>
2122
#include <linux/mutex.h>
22-
#include <linux/of.h>
2323
#include <linux/regmap.h>
2424

2525
/* Addresses to scan */
@@ -595,20 +595,18 @@ static const struct i2c_device_id jc42_id[] = {
595595
};
596596
MODULE_DEVICE_TABLE(i2c, jc42_id);
597597

598-
#ifdef CONFIG_OF
599598
static const struct of_device_id jc42_of_ids[] = {
600599
{ .compatible = "jedec,jc-42.4-temp", },
601600
{ }
602601
};
603602
MODULE_DEVICE_TABLE(of, jc42_of_ids);
604-
#endif
605603

606604
static struct i2c_driver jc42_driver = {
607605
.class = I2C_CLASS_HWMON,
608606
.driver = {
609607
.name = "jc42",
610608
.pm = JC42_DEV_PM_OPS,
611-
.of_match_table = of_match_ptr(jc42_of_ids),
609+
.of_match_table = jc42_of_ids,
612610
},
613611
.probe = jc42_probe,
614612
.remove = jc42_remove,

0 commit comments

Comments
 (0)