Skip to content

Commit b926548

Browse files
eeprom: at24: use of_match_ptr()
JIRA: https://issues.redhat.com/browse/RHEL-47160 Conflicts: * Avoiding commit <f050bb8f56c64> ("misc: Switch i2c drivers back to use .probe()") to avoid drop the .probe_new() call-back type * Small context adjustments due to f050bb8 commit 2b0eee4 Author: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Date: Thu Nov 23 11:30:32 2023 +0100 eeprom: at24: use of_match_ptr() This driver does not depend on CONFIG_OF so using of_match_ptr() makes sense to reduce the size a bit. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Signed-off-by: Alessandro Carminati <acarmina@redhat.com>
1 parent 109552b commit b926548

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/misc/eeprom/at24.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/module.h>
1919
#include <linux/mutex.h>
2020
#include <linux/nvmem-provider.h>
21+
#include <linux/of.h>
2122
#include <linux/of_device.h>
2223
#include <linux/pm_runtime.h>
2324
#include <linux/property.h>
@@ -242,7 +243,7 @@ static const struct i2c_device_id at24_ids[] = {
242243
};
243244
MODULE_DEVICE_TABLE(i2c, at24_ids);
244245

245-
static const struct of_device_id at24_of_match[] = {
246+
static const struct of_device_id __maybe_unused at24_of_match[] = {
246247
{ .compatible = "atmel,24c00", .data = &at24_data_24c00 },
247248
{ .compatible = "atmel,24c01", .data = &at24_data_24c01 },
248249
{ .compatible = "atmel,24cs01", .data = &at24_data_24cs01 },
@@ -837,7 +838,7 @@ static struct i2c_driver at24_driver = {
837838
.driver = {
838839
.name = "at24",
839840
.pm = &at24_pm_ops,
840-
.of_match_table = at24_of_match,
841+
.of_match_table = of_match_ptr(at24_of_match),
841842
.acpi_match_table = ACPI_PTR(at24_acpi_ids),
842843
},
843844
.probe_new = at24_probe,

0 commit comments

Comments
 (0)