Skip to content

Commit f25f405

Browse files
andy-shevBartosz Golaszewski
authored andcommitted
eeprom: at24: Drop of_match_ptr() and ACPI_PTR() protections
These result in a very small reduction in driver size, but at the cost of more complex build and slightly harder to read code. In the case of of_match_ptr() it also prevents use of PRP0001 ACPI based identification. In this particular case we have a valid ACPI/PNP ID that should be used in preference to PRP0001 but doesn't mean we should prevent that route. With this done, drop unneeded of*.h inclusions and __maybe_unused markers. Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 0348089 commit f25f405

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/misc/eeprom/at24.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
#include <linux/module.h>
1919
#include <linux/mutex.h>
2020
#include <linux/nvmem-provider.h>
21-
#include <linux/of.h>
22-
#include <linux/of_device.h>
2321
#include <linux/pm_runtime.h>
2422
#include <linux/property.h>
2523
#include <linux/regmap.h>
@@ -252,7 +250,7 @@ static const struct i2c_device_id at24_ids[] = {
252250
};
253251
MODULE_DEVICE_TABLE(i2c, at24_ids);
254252

255-
static const struct of_device_id __maybe_unused at24_of_match[] = {
253+
static const struct of_device_id at24_of_match[] = {
256254
{ .compatible = "atmel,24c00", .data = &at24_data_24c00 },
257255
{ .compatible = "atmel,24c01", .data = &at24_data_24c01 },
258256
{ .compatible = "atmel,24cs01", .data = &at24_data_24cs01 },
@@ -286,7 +284,7 @@ static const struct of_device_id __maybe_unused at24_of_match[] = {
286284
};
287285
MODULE_DEVICE_TABLE(of, at24_of_match);
288286

289-
static const struct acpi_device_id __maybe_unused at24_acpi_ids[] = {
287+
static const struct acpi_device_id at24_acpi_ids[] = {
290288
{ "INT3499", (kernel_ulong_t)&at24_data_INT3499 },
291289
{ "TPF0001", (kernel_ulong_t)&at24_data_24c1024 },
292290
{ /* END OF LIST */ }
@@ -848,8 +846,8 @@ static struct i2c_driver at24_driver = {
848846
.driver = {
849847
.name = "at24",
850848
.pm = &at24_pm_ops,
851-
.of_match_table = of_match_ptr(at24_of_match),
852-
.acpi_match_table = ACPI_PTR(at24_acpi_ids),
849+
.of_match_table = at24_of_match,
850+
.acpi_match_table = at24_acpi_ids,
853851
},
854852
.probe = at24_probe,
855853
.remove = at24_remove,

0 commit comments

Comments
 (0)